Skip to content

Commit

Permalink
.Net files are always 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Oct 18, 2024
1 parent f237c42 commit ab41672
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions build-exe/check-bits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,61 @@ fi
checkBits()
{
local checkMe="$1"
local actualBits
case "$(basename "$checkMe")" in
GNU.Gettext.dll | msgfmt.net.exe | msgunfmt.net.exe)
actualBits=32
;;
*)
actualBits=$BITS
;;
esac
printf 'Checking %s... ' "$checkMe"
local info="$(file -bEh -- "$checkMe" | head -n1)"
case "$info" in
PE32\ executable\ \(console\)\ Intel\ 80386*)
printf '32-bit exe (console): '
if [ $BITS -ne 32 ]; then
if [ $actualBits -ne 32 ]; then
echo 'INVALID'
return 1
fi
echo 'OK'
;;
PE32\ executable\ \(GUI\)\ Intel\ 80386*)
printf '32-bit exe (GUI): '
if [ $BITS -ne 32 ]; then
if [ $actualBits -ne 32 ]; then
echo 'INVALID'
return 1
fi
echo 'OK'
;;
PE32\ executable\ \(DLL\)\ \(console\)\ Intel\ 80386*)
printf '32-bit dll: '
if [ $BITS -ne 32 ]; then
if [ $actualBits -ne 32 ]; then
echo 'INVALID'
return 1
fi
echo 'OK'
;;
PE32+\ executable\ \(console\)\ x86-64*)
printf '64-bit exe (console): '
if [ $BITS -ne 64 ]; then
if [ $actualBits -ne 64 ]; then
echo 'INVALID'
return 1
fi
echo 'OK'
;;
PE32+\ executable\ \(GUI\)\ x86-64*)
printf '64-bit exe (GUI): '
if [ $BITS -ne 64 ]; then
if [ $actualBits -ne 64 ]; then
echo 'INVALID'
return 1
fi
echo 'OK'
;;
PE32+\ executable\ \(DLL\)\ \(console\)\ x86-64*)
printf '64-bit dll: '
if [ $BITS -ne 64 ]; then
if [ $actualBits -ne 64 ]; then
echo 'INVALID'
return 1
fi
Expand Down

0 comments on commit ab41672

Please sign in to comment.