From 00bf9b524885c18b0d39862313adc407f496c76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 29 Mar 2024 10:48:59 +0100 Subject: [PATCH] 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. --- scripts/parse_drmingw.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/parse_drmingw.sh b/scripts/parse_drmingw.sh index afa64cdc9..e3aba18ab 100755 --- a/scripts/parse_drmingw.sh +++ b/scripts/parse_drmingw.sh @@ -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]+'