0

I'm using static analysis to verify an OSX program that I have developed personally. using GDB I have found the memory address of a NSString. Is there any way of parsing it as a NSString and read its contents? 'po' does not work as the symbol table is not included. all other examine memory commands do not work. I'm assuming the string literal is contained within the object somewhere, can I dump the entire object UTF-8/16?

1
  • po 0x467954588 or whatever should work if that is the real address, and. not just an uninitialized pointer Commented May 4, 2013 at 12:45

1 Answer 1

1

There are at least two different layouts of constant string object. Both of them store a pointer to the string's bytes in the object; I think one layout uses UTF-8 and the other uses UTF-16. The right set of x/x and x/s commands ought to be able to print the contents, but if the debugger's memory commands aren't working then that doesn't help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.