Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###
- ### RDR2 Companion App "Super String Decryptor PRO ((ULTIMATE EDITION)) v1.2" Script Utility (IDA Pro)
- ### © 2018 Fireboyd78
- ###
- ### If this script helps you in any way, please give credit where it's due ;)
- ###
- def get_decrypt_key(ea):
- name = Name(ea)
- if not name.startswith("_ZTS"):
- print("**** Can't get decrypt key! ****")
- return
- str = name[4:]
- buffer = [ord(c) for c in str] + [0]
- index = 0
- count = len(buffer)
- #print('"%s"(%02d):' % (str, count))
- key = []
- while index < count:
- b = Byte(ea + index)
- v = buffer[index]
- k = (b ^ v)
- key.append(k)
- #print('%02x\t\t%02x\t\t^%02x' % (v, b, k))
- index += 1
- #print(''.join(["%02x " % k for k in key]))
- return key
- # 82 characters!
- # TODO: Find the actual key
- DECRYPT_KEY = get_decrypt_key(0x2A91C10)
- def get_decrypt_buffer(ea):
- index = 0
- buffer = []
- while index < 256:
- b = Byte(ea + index)
- buffer.append(b)
- index += 1
- return buffer
- # TODO: Wrong key?!
- # uses 's_FromBase64LUT' buffer
- # (sorry folks, not posting the key here)
- #DECRYPT_KEY = get_decrypt_buffer(0x2B18C68)
- def decrypt_string(ea, makeCmt = True):
- index = 0
- max_len = len(DECRYPT_KEY)
- buffer = []
- eos = False
- while index < max_len:
- b = Byte(ea + index)
- k = DECRYPT_KEY[index]
- v = (b ^ k)
- # read up until null-terminator
- if v == 0:
- eos = True
- break
- buffer.append(v)
- index += 1
- str = ''.join([chr(b) for b in buffer])
- # string longer than decryption buffer?
- if not eos:
- print("**** Couldn't decrypt entire string (only up to %d bytes) ****" % max_len)
- if makeCmt:
- MakeRptCmt(ea, 'decrypted: "%s"' % str)
- return str
- def decrypt_string_ptr(ea, makeCmt = True):
- ptr = Qword(ea)
- return decrypt_string(ptr, makeCmt)
- def decrypt_string_ptr_list(ea, count = 1, makeCmt = True):
- index = 0
- list = []
- while index < count:
- str = decrypt_string_ptr(ea + (index * 8), makeCmt)
- list.append(str)
- index += 1
- return list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement