qiling icon indicating copy to clipboard operation
qiling copied to clipboard

Pwndbg context won't work with gdb remote debugging

Open dzonerzy opened this issue 3 years ago • 5 comments
trafficstars

Describe the bug

Maybe this bug is pwndbg related and not qiling fault, but still worth to ask, when i use the remote gdb debugging with qiling and I connect with pwmdbg, the debugger works but the context is fucked up like in the screenshot:

img

Sample Code

from qiling import *
from qiling.arch.arch import QL_ARCH
if __name__ == "__main__":
    ql = Qiling(["rootfs/hello.arm"], "rootfs")
    ql.debugger = "gdb:127.0.0.1:9999"
    ql.run()

Expected behavior Pwndbg should just work fine

Additional context The infinite loop seems to happen when pwndbg looks for binary memory mappings

dzonerzy avatar Jul 07 '22 16:07 dzonerzy

There is a fix here https://github.com/qilingframework/qiling/pull/1148#issuecomment-1120480972

Looks like it’s left out with that PR? Would have a look tomorrow.

wtdcode avatar Jul 07 '22 16:07 wtdcode

Tried that fix and seems to work but still can't show context now i have this error:

err

maybe this is something you already solved

dzonerzy avatar Jul 07 '22 17:07 dzonerzy

This issue is related to pwndbg.regs.cpsr not being set and thus being None, if you tell me what I should look i can try to fix it

dzonerzy avatar Jul 07 '22 17:07 dzonerzy

I'm on fixing this however it somehow involves a deeper refactor so the fix might be a bit late.

wtdcode avatar Jul 10 '22 10:07 wtdcode

This issue is related to pwndbg.regs.cpsr not being set and thus being None, if you tell me what I should look i can try to fix it

I can't reproduce this.

wtdcode avatar Jul 10 '22 14:07 wtdcode

Close for now.

We updated the codebase for Qiling and Unicorn since this issue being posted.

Feel free to try the latest version.

xwings avatar Oct 06 '22 03:10 xwings