mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Add GDB scripts for dynamic debugging of Win32 binaries via Wine.
This commit is contained in:
parent
92b15fed6e
commit
38eb0448b5
3 changed files with 107 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
# A GDB command to obtain the PID of a traced process, which must be running
|
||||
# on an x86 Linux host. This is primarily useful when running gdbserver.exe
|
||||
# under Wine.
|
||||
#
|
||||
# Note that binaries linked with non-executable stacks, such as those
|
||||
# created by the `-z,noexecstack` or `/NXCOMPAT` options, should replace
|
||||
# `($esp-7)` with an address that will be mapped to an executable region.
|
||||
# Selection of such an address is platform- and binary-specific.
|
||||
|
||||
define getpid-linux-i386
|
||||
# MOV eax,20 [SYS_getpid]
|
||||
# INT 0x80
|
||||
# RET
|
||||
set $linux_getpid = {int (void)}($esp-7)
|
||||
set {unsigned char[8]}($linux_getpid) = {\
|
||||
0xB8, 0x14, 0x00, 0x00, 0x00, \
|
||||
0xCD, 0x80, \
|
||||
0xC3 \
|
||||
}
|
||||
output $linux_getpid()
|
||||
echo \n
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue