Debian Codegraph @

debian/check_nx

raw
1 #!/bin/sh
2 #
3 # Helper script - check if a binary is tagged as NX-compatible or not.
4
5 set -e
6
7 for FILE in "$@"; do
8
9 if [ ! -f "${FILE}" ]; then
10 echo "${FILE} does not exist. ABORT."
11 exit 1
12 fi
13
14 echo "Checking NX bit on ${FILE}:"
15 DLL_CHARACTERISTICS=$(objdump -x "${FILE}" | awk '/DllCharacteristics/ {print $2}')
16
17 echo " DllCharacteristics $DLL_CHARACTERISTICS"
18 case $DLL_CHARACTERISTICS in
19 00000000)
20 echo " NOT tagged as NX-compatible"
21 ;;
22 00000100)
23 echo " tagged as NX-compatible"
24 ;;
25 *)
26 echo " UNRECOGNISED value, ABORT";
27 exit 1
28 ;;
29 esac
30
31 done
32