Skip to content

Instantly share code, notes, and snippets.

@x56
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x56/1cba2aca1a31f0facaff to your computer and use it in GitHub Desktop.
Save x56/1cba2aca1a31f0facaff to your computer and use it in GitHub Desktop.
PPAlgorithm encodeResource
#!/usr/bin/env python
#
# public domain
import sys
if len(sys.argv) != 3:
print "pp_res_deobfuscate.py [input file] [output file]"
sys.exit(1)
datain = ""
dataout = ""
with open(sys.argv[1], "rb") as infile:
datain = infile.read()
for i in range(len(datain)):
dataout += chr((i * 0xc * 0x4ec4ec4f >> 0x22) + (i * 0xc * 0x4ec4ec4f >> 0x3f) & 0xef ^ ord(datain[i]) & 0xff)
with open(sys.argv[2], "wb") as outfile:
outfile.write(dataout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment