Skip to content

Commit

Permalink
extração de opcodes de um exe
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascarvalhoroncoroni committed May 11, 2017
1 parent 8603bda commit 70d1bbd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Binary file modified mainProject/SFAnalytics/__pycache__/tools.cpython-36.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions mainProject/SFAnalytics/tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import subprocess
import re

class handleFile(object):

@staticmethod
Expand All @@ -7,3 +10,19 @@ def saveFile(data, path):
destination.write(chunk)

destination.close()

#improve this to get file locations and path
class opcodeFile(object):
#only an exapmle to extract objcode with objdump
@staticmethod
def opcode(path):
out = subprocess.run(['.\objdump.exe', '-d','7zFM.exe'], stdout=subprocess.PIPE, shell=True).stdout.decode().splitlines()
r = []
for o in out:
i = re.findall(r'\d*:\t.*\t(\w*)', o)
if i:
r.append(i[0])

#print opcodes in r
#for x in xrange(len(r)):
# print(r[x] + '\n')

0 comments on commit 70d1bbd

Please sign in to comment.