From 0df954ea7dd55ab79d7e4e5895456122b912709e Mon Sep 17 00:00:00 2001 From: ale5000 <15793015+ale5000-git@users.noreply.github.com> Date: Fri, 27 Sep 2024 00:20:51 +0200 Subject: [PATCH] Update bits-info.sh --- tools/bits-info.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/bits-info.sh b/tools/bits-info.sh index 1916613b..c26a20e2 100755 --- a/tools/bits-info.sh +++ b/tools/bits-info.sh @@ -259,7 +259,9 @@ check_bitness_of_pe_file() # More info: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format +hexdump 1>&2 -v -s 0x3C -n 4 -e '/1 "%02x\n"' -- "${1:?}" | tac | tr -d '\n' if _pe_header_pos="$(hexdump -v -s 0x3C -n 4 -e '/1 "%02x\n"' -- "${1:?}" | tac | tr -d '\n')" && test -n "${_pe_header_pos?}" && _pe_header_pos="0x${_pe_header_pos:?}"; then +hexdump 1>&2 -v -s "${_pe_header_pos:?}" -n 6 -e '/1 "%02x"' -- "${1:?}" if _pe_header="$(hexdump 2> /dev/null -v -s "${_pe_header_pos:?}" -n 6 -e '/1 "%02x"' -- "${1:?}")" && printf '%s\n' "${_pe_header?}" | grep -m 1 -q -e '^50450000'; then # PE header => PE (0x50 0x45) + 0x00 0x00 + Machine field case "${_pe_header?}" in