-
Notifications
You must be signed in to change notification settings - Fork 0
/
deobfuscators.py
79 lines (57 loc) · 1.32 KB
/
deobfuscators.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
infile = open('app42-dec.bin','rb')
orig = infile.read()
# ** byte reversal
# **
print("byte reversal")
data = bytearray( reversed(orig) )
outfile = open('del-xor-bytewise','wb')
outfile.write(data)
outfile.close()
# ** XOR bytewise
# **
print("XOR bytewise")
data = bytearray( orig )
for i in range( len(data) ):
x = orig[i] ^ 255
data[i] = x
outfile = open('del-xor-bytewise','wb')
outfile.write(data)
outfile.close()
# ** XOR continuous
# **
print("XOR continuous down")
data = bytearray( orig )
for i in range( len(data)-1 ):
x = orig[i] ^ orig[i+1]
data[i+1] = x
outfile = open('del-xor-cont-down','wb')
outfile.write(data)
outfile.close()
# **
print("XOR continuous up")
data = bytearray( orig )
for i in reversed(range( len(data)-1 )):
x = orig[i] ^ orig[i+1]
data[i] = x
outfile = open('del-xor-cont-up','wb')
outfile.write(data)
outfile.close()
# ** XOR progressive
# **
print("XOR progressive up")
data = bytearray( orig )
for i in reversed(range( len(data)-1 )):
x = data[i] ^ data[i+1]
data[i] = x
outfile = open('del-xor-prog-up','wb')
outfile.write(data)
outfile.close()
# **
print("XOR progressive down")
data = bytearray( orig )
for i in range( len(data)-1 ):
x = data[i] ^ data[i+1]
data[i+1] = x
outfile = open('del-xor-prog-down','wb')
outfile.write(data)
outfile.close()