From 474a8d0100873376b0bca77ecdcd0d12bb1002d8 Mon Sep 17 00:00:00 2001 From: n0p <0x90@n0p.cc> Date: Sat, 10 Mar 2018 00:56:20 +0100 Subject: Added miasm as submodule and adjusted SystemCalls.py to this miasm version. --- .gitmodules | 3 +++ SystemCalls.py | 25 +++++++++++++------------ miasm | 1 + 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .gitmodules create mode 160000 miasm diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..dfe4df9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "miasm"] + path = miasm + url = https://github.com/cea-sec/miasm.git diff --git a/SystemCalls.py b/SystemCalls.py index 6f4a0c7..7b007f9 100644 --- a/SystemCalls.py +++ b/SystemCalls.py @@ -9,25 +9,26 @@ by n0p """ -try: - from miasm2.core.bin_stream_ida import bin_stream_ida - from miasm2.analysis.depgraph import DependencyGraph - - from utils import guess_machine -except: - guess_machine = None - import idaapi -import idc import ida_idaapi import ida_bytes import ida_gdl import ida_idp import ida_search import ida_segment +import idautils +import idc import time +try: + from miasm2.core.bin_stream_ida import bin_stream_ida + from miasm2.analysis.depgraph import DependencyGraph + + from utils import guess_machine +except: + guess_machine = None + from SystemCalls_constants import * @@ -194,7 +195,7 @@ class SystemCall(): self.ir_arch = self.ira(self.mdis.symbol_pool) # Populate symbols with ida names - for ad, name in Names(): + for ad, name in idautils.Names(): if name is None: continue self.mdis.symbol_pool.add_label(name, ad) @@ -277,8 +278,8 @@ class SystemCall(): cur_bloc = list(self.ir_arch.getby_offset(addr))[0] cur_label = cur_bloc.label - for line_nb, l in enumerate(cur_bloc.lines): - if l.offset == addr: + for line_nb, l in enumerate(cur_bloc): + if l.instr.offset == addr: break # Get dependency graphs diff --git a/miasm b/miasm new file mode 160000 index 0000000..6f43586 --- /dev/null +++ b/miasm @@ -0,0 +1 @@ +Subproject commit 6f43586f6e4e8314861b2ddadaba452b829be4c3 -- cgit v1.2.3-54-g00ecf