summaryrefslogtreecommitdiff
path: root/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts')
-rwxr-xr-xScripts/generate_diffs.sh5
-rwxr-xr-xScripts/get_dxbc_hash.py17
2 files changed, 22 insertions, 0 deletions
diff --git a/Scripts/generate_diffs.sh b/Scripts/generate_diffs.sh
new file mode 100755
index 0000000..b0c5687
--- /dev/null
+++ b/Scripts/generate_diffs.sh
@@ -0,0 +1,5 @@
+#! /usr/bin/env sh
+
+#wine cmd_Decompiler.exe -d ../Shaders/Original/*.dxbc
+#wine cmd_Decompiler.exe -d ../Shaders/*.shdr
+#diff -u orig.asm edit.asm
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.')