Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys, os
- if len(sys.argv) < 3:
- print "Usage: %s auPath outputPath" % os.path.split(sys.argv[0])[-1]
- sys.exit(-1)
- f = open(sys.argv[1])
- s=f.read()
- f.close()
- BinaryToStrings = s.split('BinaryToString')
- outString = BinaryToStrings[0]
- for i in range(1,len(BinaryToStrings)):
- stringStart = BinaryToStrings[i].find('0x')
- tmpString = BinaryToStrings[i][stringStart+2:]
- endString = tmpString.find('"') + len('("0x')
- tmpString = tmpString.split('"')[0]
- outString += BinaryToStrings[i][0:stringStart]
- string = ''
- for byte in range(len(tmpString)/2):
- string += chr(int(tmpString[byte*2:byte*2 + 2],16))
- print string
- outString += string + BinaryToStrings[i][endString:]
- f = open(sys.argv[2],'wb')
- s=f.write(outString)
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement