From 70d1bbd0006b99018ed1a655992b9679ab698cf5 Mon Sep 17 00:00:00 2001 From: lucascarvalhoroncoroni Date: Thu, 11 May 2017 03:41:06 -0300 Subject: [PATCH] =?UTF-8?q?extra=C3=A7=C3=A3o=20de=20opcodes=20de=20um=20e?= =?UTF-8?q?xe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/tools.cpython-36.pyc | Bin 590 -> 956 bytes mainProject/SFAnalytics/tools.py | 19 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/mainProject/SFAnalytics/__pycache__/tools.cpython-36.pyc b/mainProject/SFAnalytics/__pycache__/tools.cpython-36.pyc index ffe48d2022d54e1ac2445e27b56ca23470084fef..40d7e8e54ff72f8b294aee58589d629c12d9687b 100644 GIT binary patch delta 409 zcmY*VyGq1B6rD#B*JyCplr|QNFokJEZMG1^T?7pa+9+1Z44M!(VI~0?kS*5MLi~~~ z1;4=$7)$X#ypt5_g>yJ(E_3dk`EcG>&h~=9*WcmQ8%F30{V50Z5kL)rCWs@Bp8x_a z=rsmUI0a8zPq=e|n7bT(;+N6EysXlai*Z(n6jIwFz%JkzptgZ(lw*!<$}I&A3EX|A zIbEPf%n_t{u@0h}GRb*!Uq#|UXtK+7?@*7=t-EBzc&g@QQyW*^iK1YR@l}&la$crF zDMMv5GtTsMdIINFk<~>u6N(YJ3gZohi*g-QM}a-_y2Y(lc40*H;P)+2Cu8Qy4d}_f trGceQOIw!O!2SQRGK9_=pv~-&*2j#(xFi>8E$tu4@O4ObJUg}T{{ZdoS-t=O delta 92 zcmdnPevZY)n3tF9?j`QXzYGivkAWBtSb!`CATAaG67CEs3@MB)K%C0Z%pAp-!W7J) f$-L3$HY2Z}Cetmp{G_bZKpGhUOOq0W diff --git a/mainProject/SFAnalytics/tools.py b/mainProject/SFAnalytics/tools.py index 25b65ee..ef76404 100644 --- a/mainProject/SFAnalytics/tools.py +++ b/mainProject/SFAnalytics/tools.py @@ -1,3 +1,6 @@ +import subprocess +import re + class handleFile(object): @staticmethod @@ -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')