Vector35 / debugger

Binary Ninja debugger
Other
217 stars 15 forks source link

Qemu remote debugging does not work if the user opens a file in binja that cannot be recognized by LLDB #669

Open xusheng6 opened 3 days ago

xusheng6 commented 3 days ago
  1. qemu-system-x86_64 -bios bios.bin -drive file=disk.img,format=raw -m 1G -S -s
  2. Open bios.bin in binja
  3. Debugger -> Connect To Remote Process
  4. Select gdb-remote, and type host:port as 127.0.0.1:1234
  5. See the following error message:
LLDB failed to connect to target with "'/Users/xusheng/Downloads/CatbertRansomware/bios.bin' doesn't contain any 'host' platform architectures: arm64, armv7, armv7f, armv7k, armv7s, armv7m, armv7em, armv6m, armv6, armv5, armv4, arm, thumbv7, thumbv7k, thumbv7s, thumbv7f, thumbv7m, thumbv7em, thumbv6m, thumbv6, thumbv5, thumbv4t, thumb, x86_64, x86_64, arm64, arm64e, arm64, arm64e"

Screenshot 2024-11-26 at 12 27 18 PM

I am very grateful for this lengthy and useless error message

The issue here is the user can technically open anything before they try to debug, so chances are there will be sth that cannot be recognized by LLDB. And we should tell LLDB to not bother with that

If, however, I open a particular TE binary in the UEFI firmware, e.g., Section_PE32_image_FullShell_Shell_body.efi.zip, the debugging can be started since LLDB recognizes it

xusheng6 commented 3 days ago

Relevant files:

disk.img.zip bios.bin.zip