Skip to content

Instantly share code, notes, and snippets.

@nattybear
Created November 30, 2016 08:53
Show Gist options
  • Save nattybear/f78aa2b3b961cc09524f4edb9a80a2fd to your computer and use it in GitHub Desktop.
Save nattybear/f78aa2b3b961cc09524f4edb9a80a2fd to your computer and use it in GitHub Desktop.
from sys import argv, exit
from struct import unpack
from StringIO import StringIO
if len(argv) != 2:
print '[*] Usage: python', argv[0], '<arc>'
exit()
fp = open(argv[1], 'rb')
fp.seek(6)
buf = fp.read(2)
num = unpack('H', buf)[0]
print '[*] Number of files :', str(num)
fp.seek(0)
buf = fp.read()
fp.close()
fbuf = StringIO(buf)
list = [x * 80 + 87 for x in range(num)]
for i in list:
fbuf.seek(i)
fbuf.write(b'\x40')
fp = open(argv[1] + '_', 'wb')
fbuf.seek(0)
fp.write(fbuf.read())
print '[*]', argv[1] + '_', 'saved'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment