Skip to content

Instantly share code, notes, and snippets.

@herrcore
Created November 23, 2016 23:34
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 herrcore/8e2fa6a523e52928e03a027531de6bac to your computer and use it in GitHub Desktop.
Save herrcore/8e2fa6a523e52928e03a027531de6bac to your computer and use it in GitHub Desktop.
import idaapi, idc, idautils
import re
import struct
start = 0x0041A558
end = 0x0041B1E8
for ptr in range(start,end,8):
key = Byte(ptr)
len = Word(ptr + 2)
ptr_str = Dword(ptr + 4)
out =''
for i in range(0,len):
out += chr(((key ^ i ^ Byte(ptr_str + i))^0xff) & 0xff)
print out
@herrcore
Copy link
Author

Not polished, just the algorithm.
Only works for unpacked samples.
Replace start,end with address from the .rdata encrypted strings table (pointer in the string decryption function)
Yara key to locate string decrypt function $a = {0F B7 D3 F6 D1 32 0C 10 32 CB 43}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment