about summary refs log tree commit diff stats
path: root/miasm2/jitter
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/jitter')
-rw-r--r--miasm2/jitter/jitcore.py14
-rw-r--r--miasm2/jitter/loader/elf.py2
2 files changed, 11 insertions, 5 deletions
diff --git a/miasm2/jitter/jitcore.py b/miasm2/jitter/jitcore.py
index bf56b9de..9d36bb97 100644
--- a/miasm2/jitter/jitcore.py
+++ b/miasm2/jitter/jitcore.py
@@ -16,6 +16,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 from hashlib import md5
+import warnings
 
 from miasm2.core.asmblock import disasmEngine, AsmBlockBad
 from miasm2.core.interval import interval
@@ -52,7 +53,6 @@ class JitCore(object):
         self.addr2obj = {}
         self.addr2objref = {}
         self.blocs_mem_interval = interval()
-        self.disasm_cb = None
         self.split_dis = set()
         self.options = {"jit_maxline": 50,  # Maximum number of line jitted
                         "max_exec_per_call": 0 # 0 means no limit
@@ -65,7 +65,6 @@ class JitCore(object):
             follow_call=False,
             dontdis_retcall=False,
             split_dis=self.split_dis,
-            dis_block_callback=self.disasm_cb
         )
 
 
@@ -145,7 +144,6 @@ class JitCore(object):
 
         # Prepare disassembler
         self.mdis.lines_wd = self.options["jit_maxline"]
-        self.mdis.dis_block_callback = self.disasm_cb
 
         # Disassemble it
         cur_block = self.mdis.dis_block(addr)
@@ -295,3 +293,13 @@ class JitCore(object):
                                              self.log_regs,
                                              block_raw)).hexdigest()
         return block_hash
+
+    @property
+    def disasm_cb(self):
+        warnings.warn("Deprecated API: use .mdis.dis_block_callback")
+        return self.mdis.dis_block_callback
+
+    @disasm_cb.setter
+    def disasm_cb(self, value):
+        warnings.warn("Deprecated API: use .mdis.dis_block_callback")
+        self.mdis.dis_block_callback = value
diff --git a/miasm2/jitter/loader/elf.py b/miasm2/jitter/loader/elf.py
index deaebd09..01dea647 100644
--- a/miasm2/jitter/loader/elf.py
+++ b/miasm2/jitter/loader/elf.py
@@ -32,7 +32,6 @@ def preload_elf(vm, e, runtime_lib, patch_vm_imp=True):
     # XXX quick hack
     fa = get_import_address_elf(e)
     dyn_funcs = {}
-    # log.debug('imported funcs: %s' % fa)
     for (libname, libfunc), ads in fa.items():
         for ad in ads:
             ad_base_lib = runtime_lib.lib_get_add_base(libname)
@@ -77,7 +76,6 @@ def vm_load_elf(vm, fdata, name="", **kargs):
         # -2: Trick to avoid merging 2 consecutive pages
         i += [(a_addr, b_addr - 2)]
     for a, b in i.intervals:
-        # print hex(a), hex(b)
         vm.add_memory_page(a, PAGE_READ | PAGE_WRITE, "\x00" * (b + 2 - a),
                            repr(name))