seclab-ucr / SyzGen_setup

MIT License
43 stars 13 forks source link

A strange code snippet in LLDBDebugger.run #5

Closed Kiprey closed 2 years ago

Kiprey commented 2 years ago

Sorry for poor English. :)

in SyzGen/syzgen/debugger/lldbproxy.py , LLDBDebugger.run executes the following code:

# For unknown reason, we have to invoke 'script' in advance.
lldb.sendline("script")
lldb.expect(">>>")
outs = lldb.before
print(outs)

lldb.sendline("quit()")
lldb.expect("\\(lldb\\)")
print(lldb.before)

What is the purpose of this code? I may have had a similar problem. When executing the custom command in debug.py, lldb reports an error, indicating that lldb.target cannot be found.

Kiprey commented 2 years ago

I found a way to bypass the lldb error. Just simply replace all lldb.target with lldb.debugger.GetSelectedTarget()