你可以看看到的gcore:
$ gcore 792
warning: Could not load vsyscall page because no executable was specified
0x00007f5f73998410 in ??()
Saved corefile core.792
,然後在gdb打開它:
$ gdb -c core.792
GNU gdb (GDB) Fedora 8.0.1-30.fc26
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[...]
[New LWP 792]
Missing separate debuginfo for the main executable file
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/09/b9d38bb6291b6282de4a2692e45448828d50da
Core was generated by `./a.out'.
#0 0x00007f5f73998410 in ??()
(gdb) info registers
rax 0xfffffffffffffe00 -512
rbx 0x0 0
rcx 0x7f5f73998410 140047938061328
rdx 0x1 1
rsi 0x7ffd30683d73 140725415591283
rdi 0x3 3
rbp 0x7ffd30683d90 0x7ffd30683d90
rsp 0x7ffd30683d68 0x7ffd30683d68
r8 0x1d 29
r9 0x0 0
r10 0x3 3
r11 0x246 582
r12 0x4006d0 4196048
r13 0x7ffd30683e70 140725415591536
r14 0x0 0
r15 0x0 0
rip 0x7f5f73998410 0x7f5f73998410
eflags 0x246 [ PF ZF IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
$ gcore
usage: gcore [-o filename] pid
所以你可以使用它的PID轉儲過程的核心或甚至使用/ proc中的二進制圖像來獲得一些符號:
gdb -c core.792 /proc/792/exe
您可能知道您可以將腳本傳遞給gdb,這可以使您無需與二進制文件(man gdb獲取更多詳細信息)進行交互。
如果你不想直接使用gdb,你可以嘗試直接使用ptrace()
,但它肯定會有更多的工作。
對於反調試技術,以及...他們的工作,並沒有簡單的方法來直接處理他們,據我所知,每個人可能手動工作,(修補二進制文件,從未對齊的地址手動分解然後在objdump等設置...)
我不是域的專家,我希望這會幫助你一點。
感謝您提供有用的信息。 –