diff options
| author | serpilliere <devnull@localhost> | 2012-07-27 20:32:13 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-07-27 20:32:13 +0200 |
| commit | 699fef619157212209d4f0fdcc2ecf69bb0cdd19 (patch) | |
| tree | b958bff69f006a496e8b64408c46539450c29ca9 /miasm/arch/java_arch.py | |
| parent | 61fa2b382970497e7dffff6bc0f667e8bb070bd7 (diff) | |
| download | focaccia-miasm-699fef619157212209d4f0fdcc2ecf69bb0cdd19.tar.gz focaccia-miasm-699fef619157212209d4f0fdcc2ecf69bb0cdd19.zip | |
arch: dis function has a new generic API!
Diffstat (limited to 'miasm/arch/java_arch.py')
| -rw-r--r-- | miasm/arch/java_arch.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/miasm/arch/java_arch.py b/miasm/arch/java_arch.py index 3672b778..3bbe0077 100644 --- a/miasm/arch/java_arch.py +++ b/miasm/arch/java_arch.py @@ -393,10 +393,10 @@ mnemonic('iflt', 155, 3, "if 'value' is less than 0, branch to the 16-bit instru class java_mnemo_metaclass(type): rebuilt_inst = False - def dis(cls, op, admode=None, sex=0, offset=0, ): + def dis(cls, op, attrib = {} ): i = cls.__new__(cls) - i.__init__(sex) - u = i._dis(op, offset) + i.__init__(0) + u = i._dis(op) if not u: return None return i @@ -457,8 +457,10 @@ class java_mnemo_metaclass(type): class java_mn: __metaclass__ = java_mnemo_metaclass def __init__(self, sex=0): - self.sex = sex - + self.sex = 0 + def get_attrib(self): + return {} + def breakflow(self): return self.m.breakflow def splitflow(self): @@ -551,15 +553,15 @@ class java_mn: return out return "%-15s" % self.m.name + " ".join(map(str, arg)) - def _dis(self, bin, offset=0): + def _dis(self, bin): if type(bin) is str: from miasm.core.bin_stream import bin_stream bin = bin_stream(bin) - self.offset = bin.offset + offset + self.offset = bin.offset try: self.m = mnemo_db[ord(bin.readbs(1))] self.arg = self.m.argfmt.get(bin, sex=self.sex, address=self.offset) - self.l = bin.offset + offset - self.offset + self.l = bin.offset - self.offset except Exception as e: log.warning(e.message) return False |