From 0bcd78be9657f35dd27a02c16cb70234b1e44d5b Mon Sep 17 00:00:00 2001 From: n0p <0x90@n0p.cc> Date: Mon, 27 Oct 2014 19:07:43 +0100 Subject: Reversing challenge 300 from hack.lu 2014. --- bin/keyCalculator.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 bin/keyCalculator.py (limited to 'bin/keyCalculator.py') 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 -- cgit v1.2.3