如何重新调整 IDA 以匹配 GDB

逆向工程 艾达 linux 数据库
2021-06-19 11:19:23

我想使用 GDB 在 linux 上调试我的 elf 文件并按照 IDA 中的反汇编进行操作,这可能吗?如果是这样,我将如何重新调整 IDA 以与 GDB 匹配?

谢谢!

1个回答

如果你想重新设置一个精灵,你可以做info proc mappings. 这将显示所有映射的地址。(这也可以通过做查看cat /proc/<pid>/map

然后只需通过 EDIT->Segments->Rebase 程序重新设置您的 IDA,然后Image Base从单选按钮中进行选择

前任:

(gdb) info proc mappings 
process 12383
Mapped address spaces:
    Start Addr   End Addr       Size     Offset objfile
     0x8048000  0x8049000     0x1000          0      /home/user/my_elf
     0x8049000  0x804a000     0x1000          0      /home/user/my_elf
     0x804a000  0x804b000     0x1000     0x1000      /home/user/my_elf
    0xb7e73000 0xb7e74000     0x1000          0
    0xb7e74000 0xb7fbd000   0x149000          0     /lib/i386-linux-gnu/libc-2.13.so
    0xb7fbd000 0xb7fbe000     0x1000   0x149000     /lib/i386-linux-gnu/libc-2.13.so
    0xb7fbe000 0xb7fc0000     0x2000   0x149000     /lib/i386-linux-gnu/libc-2.13.so
    0xb7fc0000 0xb7fc1000     0x1000   0x14b000     /lib/i386-linux-gnu/libc-2.13.so
    0xb7fc1000 0xb7fc4000     0x3000          0
    0xb7fdf000 0xb7fe1000     0x2000          0
    0xb7fe1000 0xb7fe2000     0x1000          0           [vdso]
    0xb7fe2000 0xb7ffe000    0x1c000          0     /lib/i386-linux-gnu/ld-2.13.so
    0xb7ffe000 0xb7fff000     0x1000    0x1b000     /lib/i386-linux-gnu/ld-2.13.so
    0xb7fff000 0xb8000000     0x1000    0x1c000     /lib/i386-linux-gnu/ld-2.13.so
    0xbffdf000 0xc0000000    0x21000          0           [stack]

如果我要查看 IDA 中的精灵,我会使用 0x8048000 作为基础。如果我要查看 libc-2.13.so,我会使用 0xb7e74000。

希望有帮助。