Created
May 18, 2015 01:56
-
-
Save hhc0null/8106cdbfb1ddc0af7b35 to your computer and use it in GitHub Desktop.
[DEFCON_23_Quals-misc-patcher-3pts]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import binascii | |
import re | |
import struct | |
import sys | |
uh = lambda x: binascii.unhexlify(x) | |
hx = lambda x: binascii.hexlify(x) | |
p = lambda x: struct.pack("<I", x) | |
u = lambda x: struct.unpack("<I", x) | |
data = "" | |
with open("./cybergrandsandbox_e722a7ec2ad46b9fb8472db37cb95713", "rb") as f: | |
data = f.read() | |
hexstr = hx(data) | |
hexstr = hexstr.replace(hx(p(0x1388)), hx(p(0x1388+(0x2000*100)))) | |
hexstr = hexstr.replace(hx(p(0x138c)), hx(p(0x138c+(0x2000*100)))) | |
hexstr = hexstr.replace(hx(p(0x1390)), hx(p(0x1390+(0x2000*100)))) | |
hexstr = hexstr.replace(hx(p(0x1394)), hx(p(0x1394+(0x2000*100)))) | |
with open("./patched", "wb") as f: | |
f.write(uh(hexstr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know this is a bonus problem.