Skip to content

Instantly share code, notes, and snippets.

@ob
Created March 7, 2019 17:11
Show Gist options
  • Save ob/5f58ec7a458a8b679a2389370d68aab8 to your computer and use it in GitHub Desktop.
Save ob/5f58ec7a458a8b679a2389370d68aab8 to your computer and use it in GitHub Desktop.

Set breakpoint

b <function>

Look at arguments (without knowing the calling convention)

register read $arg1

Use args to print all args

command alias args register read $arg1 $arg2 $arg3 $arg4 $arg5 $arg6

Print char *[] (Assuming r9 holds a pointer to it)

script ## To enter embedded python interpreter
from lldb import *
options = SBExpressionOptions()
i=0
>>> data = frame.EvaluateExpression("*(char **)($r9+{})".format(i), options)
>>> while SBValue.__eol_test__(data) == False:
...     print data
...     i += 8
...     data = frame.EvaluateExpression("*(char **)($r9+{})".format(i), options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment