aboutsummaryrefslogtreecommitdiff
path: root/bin/keyCalculator.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/keyCalculator.py')
-rw-r--r--bin/keyCalculator.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/keyCalculator.py b/bin/keyCalculator.py
new file mode 100644
index 0000000..9b96700
--- /dev/null
+++ b/bin/keyCalculator.py
@@ -0,0 +1,16 @@
+import pefile
+
+pe = pefile.PE("JonahHex.exe")
+
+ccCount = 0
+text_section = pe.get_data(pe.sections[0].VirtualAddress, pe.sections[0].Misc_VirtualSize)
+
+for byte in text_section:
+ if byte == '\xCC':
+ ccCount += 1
+ if ccCount % 22 == 0:
+ ccCount *= ccCount + 42
+ ccCount %= 0x100
+
+print "AddressOfEntryPoint: " + hex(pe.OPTIONAL_HEADER.AddressOfEntryPoint)
+print "DES key: " + 8*hex(ccCount)[2:] \ No newline at end of file