Created
January 26, 2017 19:49
-
-
Save herrcore/c9cf29daf1ab4a83543e553e60f53dba to your computer and use it in GitHub Desktop.
String decryption for unknown Brazil banker trojan; packed:dc8a114965069f91081c2bb0b9a0e8635c1627648a9b599f573c35713724b204, unpacked: 96d4a0d59f27be9cceb1473cb3d5f4dc2863837a9dfd94f0dfeab20092ea6466
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def decrypt_string(ctxt): | |
tbl = 'UmlXZEyNki880daneIlvAipdZ5Kz45FucTmGiIhYdbFHromzJjbisCtBCm' | |
ctxt_bin = '' | |
for i in re.findall('..',ctxt): | |
ctxt_bin += chr(int(i,16)) | |
ptxt = '' | |
for i in range(0,len(ctxt_bin) - 1): | |
mut_chr = ord(ctxt_bin[i]) | |
tmp_chr = ord(ctxt_bin[i+1]) ^ ord(tbl[i]) | |
if mut_chr > tmp_chr: | |
ptxt += chr(0xff + tmp_chr - mut_chr) | |
else: | |
ptxt += chr(tmp_chr - mut_chr) | |
return ptxt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment