3

I got the string objects from a Ghidra project using this code:

 l = list()
def callback(s):
   l.append(s)
ss = StringSearcher(currentProgram, 5, 1, False, True)
ss.search(None, callback, True, monitor)

print(l[0])

got it from the thread How to use findStrings flat API (#1964).

The problem is that in order to get the actual string, a Memory object is needed as a param of the getString() function.

I'm not really sure how to create this object or what it exactly represents… any right way/good example for this situation?

1

Ok I got it apparently currentProgram has a get attribute that returns said Memory (MemoryMapDB): StringObj.getString(currentProgram.getMemory())

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.