Make parse_drmingw.sh script also useable on Windows with MSYS2

Use `objdump` instead of `winedump` to determine the image base address of the executable file, as `winedump` is not easily available on Windows.

It should be enough to install the `binutils` package (containing `addr2line` and `objdump`) from a package manager to use the script now.
This commit is contained in:
Robert Müller 2024-03-29 10:48:59 +01:00
parent 172bc33137
commit 00bf9b5248

View file

@ -30,7 +30,7 @@ if [ "$TMP_OFFSET" != "0" ]; then
echo "Module offset: 0x$TMP_OFFSET"
fi
ADDR_BASE=$(winedump -f "$1" | grep -E -o "image base[ ]*0x[0-9A-Fa-f]*" | grep -E -o "0x[0-9A-Fa-f]+" | tail -1)
ADDR_BASE=0x$(objdump -x "$1" | grep -E -o "^ImageBase\s+[0-9A-Fa-f]+$" | grep -E -o "[0-9A-Fa-f]+$")
echo "Image base: $ADDR_BASE"
ADDR_PC_REGEX='[0-9A-Fa-f]+ [0-9A-Fa-f]+ [0-9A-Fa-f]+ [0-9A-Fa-f]+'