diff options
| author | Ajax <commial@gmail.com> | 2017-07-21 17:26:53 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-07-21 17:26:53 +0200 |
| commit | ee7de9598b33718797b823a652aa93ead8eeb51c (patch) | |
| tree | 94a72fad0a01f3809af289694abf1d542b567208 | |
| parent | 5bad1c259075bb730da09942b1a6f5c4d3de6af2 (diff) | |
| download | miasm-ee7de9598b33718797b823a652aa93ead8eeb51c.tar.gz miasm-ee7de9598b33718797b823a652aa93ead8eeb51c.zip | |
Add arch-desc in hash, avoiding multi-arch collision
Example: a single PUSH in x86-32 / x86-64
| -rw-r--r-- | miasm2/jitter/jitcore.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/miasm2/jitter/jitcore.py b/miasm2/jitter/jitcore.py index cc49240c..741760cd 100644 --- a/miasm2/jitter/jitcore.py +++ b/miasm2/jitter/jitcore.py @@ -37,6 +37,7 @@ class JitCore(object): """ self.ir_arch = ir_arch + self.arch_name = "%s%s" % (self.ir_arch.arch.name, self.ir_arch.attrib) self.bs = bs self.known_blocs = {} self.lbl2jitbloc = BoundedDict(self.jitted_block_max_size, @@ -276,8 +277,9 @@ class JitCore(object): @block: asmblock """ block_raw = "".join(line.b for line in block.lines) - block_hash = md5("%X_%s_%s_%s" % (block.label.offset, - self.log_mn, - self.log_regs, - block_raw)).hexdigest() + block_hash = md5("%X_%s_%s_%s_%s" % (block.label.offset, + self.arch_name, + self.log_mn, + self.log_regs, + block_raw)).hexdigest() return block_hash |