Skip to content

Commit

Permalink
Update bits-info.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Sep 26, 2024
1 parent 7ce5508 commit 37ce773
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,18 @@ main()
_limits_date='32767 2147480047 2147483647 32535215999 32535244799 67767976233529199 67767976233532799 67768036191673199 67768036191676799 9223372036854775807'
_limits_u='65535 2147483647 2147483648 4294967295 18446744073709551615'

shell_exe="$(readlink 2> /dev/null "/proc/${$}/exe")" || shell_exe=''
shell_exe="$(readlink 2> /dev/null "/proc/${$}/exe")" || shell_exe='x'

shell_info="$(get_shell_info || true)"
shell_name="$(printf '%s\n' "${shell_info:?}" | cut -d ' ' -f '1' || true)"

echo "_${shell_exe?}_"
check_bitness_of_pe_file "${shell_exe:?}"
ls -l /proc/$$/path/a.out || true
stat /proc/$$/path/a.out || true
readlink /proc/$$/path/a.out || true
echo '==='

test -n "${shell_exe?}" && check_bitness_of_pe_file "${shell_exe:?}"
if test -n "${shell_exe?}" && tmp_var="$(hexdump 2> /dev/null -v -n 5 -e '/1 "%02x"' -- "${shell_exe:?}")" && test -n "${tmp_var?}" && printf '%s\n' "${tmp_var:?}" | grep -m 1 -q -e '^7f454c46'; then
# On Linux / Android
# ELF header => 0x7F + ELF (0x45 0x4C 0x46) + 0x01 for 32-bit or 0x02 for 64-bit
Expand Down

0 comments on commit 37ce773

Please sign in to comment.