bdcht / amoco

yet another tool for analysing binaries
GNU General Public License v2.0
462 stars 65 forks source link

Mapper for SHRD #82

Closed LRGH closed 4 years ago

LRGH commented 4 years ago

Another that has been broken.

from amoco.arch.x86 import cpu_x86
from amoco.ui import render

cpu_x86.instruction_x86.set_formatter(cpu_x86.IA32_Binutils_ATT)
render.conf.UI.formatter = 'Null'

c = b'\x66\x0f\xad\xc2'
i = cpu_x86.disassemble(c)
print("'%s'" % i.mnemonic)
print("'%s'" % i) 

from amoco.cas.mapper import mapper
m = mapper()
i(m)
print(m)

Now fails with

Traceback (most recent call last):
  File "/tmp/b.py", line 14, in <module>
    i(m)
  File "amoco/arch/core.py", line 88, in __call__
    i_xxx(self, fmap)
  File "amoco/arch/x86/asm.py", line 1100, in i_SHRD
    fmap[pf] = parity8(x[0:8])
  File "amoco/arch/x86/asm.py", line 37, in parity8
    y = cst(0x6996, 16) >> (y[0:4])
  File "amoco/cas/expressions.py", line 55, in checkarg_numeric
    return f(self, n)
  File "amoco/cas/expressions.py", line 652, in __rshift__
    return cst(self.value >> n.value, self.size)
AttributeError: 'top' object has no attribute 'value'
bdcht commented 4 years ago

nice...fixed by commit da6acb