summaryrefslogtreecommitdiffhomepage
path: root/src/refs/nthash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/refs/nthash.sh')
-rwxr-xr-xsrc/refs/nthash.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/refs/nthash.sh b/src/refs/nthash.sh
new file mode 100755
index 0000000..fc9d3ba
--- /dev/null
+++ b/src/refs/nthash.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+printf '#define __NTAPI_HASH_TABLE %s\n' '\'
+
+N=0; for f in $(cat NTHASH); do
+ HASH="0x$(printf "%s\n" $f | mdso -c32 - | cut -d' ' -f1)";
+ printf "\t{0x%08x,\t(%d)},\t/* %s */ %s\n" $HASH $N $f '\';
+ N=$((N + 1));
+done | sort -k2 -g
+
+printf '\n#define __NT_IMPORTED_SYMBOLS_ARRAY_SIZE\t%d\n' "$(cat NTHASH | wc -l)"