summaryrefslogtreecommitdiff
path: root/Scripts/get_dxbc_hash.py
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-03-16 16:03:52 -0400
committerAndrew Opalach <andrew@akon.city> 2026-03-16 16:03:52 -0400
commita6fcd3f4c75651e08c4392dea8a77b7fed1c2fe5 (patch)
treebe60df9efc6961ceb2e96b8411a688ec4e5ed4d6 /Scripts/get_dxbc_hash.py
downloadWorldTuningTool-a6fcd3f4c75651e08c4392dea8a77b7fed1c2fe5.tar.gz
WorldTuningTool-a6fcd3f4c75651e08c4392dea8a77b7fed1c2fe5.tar.bz2
WorldTuningTool-a6fcd3f4c75651e08c4392dea8a77b7fed1c2fe5.zip
Outline of new features
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'Scripts/get_dxbc_hash.py')
-rwxr-xr-xScripts/get_dxbc_hash.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Scripts/get_dxbc_hash.py b/Scripts/get_dxbc_hash.py
new file mode 100755
index 0000000..0c53107
--- /dev/null
+++ b/Scripts/get_dxbc_hash.py
@@ -0,0 +1,17 @@
+#! /usr/bin/env python3
+
+import sys
+import os.path
+import struct
+
+if not os.path.isfile(sys.argv[1]):
+ print(f'File not found: {sys.argv[1]}')
+ sys.exit(1)
+
+for path in sys.argv[1:]:
+ print(path + ':')
+ with open(path, 'rb') as f:
+ if f.read(4).decode('ASCII') == 'DXBC':
+ print(' %08x-%08x-%08x-%08x' % (struct.unpack('<I', f.read(4))[0], struct.unpack('<I', f.read(4))[0], struct.unpack('<I', f.read(4))[0], struct.unpack('<I', f.read(4))[0]))
+ else:
+ print(' Invalid DXBC file.')