def test_dh(self): """ Test de l'initialisation du moteur disass 32 """ try: register = Register32() except: assert False return register.edx = 0x080484cc if register.dh != 0x84: assert False return register.dh = 0x77 if register.dh != 0x077: assert False return if register.edx != 0x080477cc: assert False return assert True return
def test_compute_instructrion(self, o): """ Test """ register = Register32() value = compute_operation(o[0], register) if value != o[1]: assert False else: assert True
def test_create_register(self): """ Test de l'initialisation du moteur disass 32 """ try: register = Register32() except: assert False return assert True return
def test_compute_operation_register(self, o): """ Test de l'initialisation du moteur disass 32 """ register = Register32() register.eax = 5 register.edx = 1 r = compute_operation(o[0], register) if r == o[1]: assert True else: print o[0], o[1], r assert False return
def test_compute_operation_basic(self, o): """ Test de l'initialisation du moteur disass 32 """ register = Register32() r = compute_operation(o[0], register) if r == o[1]: print o[1], "=", str(r) assert True else: print "%s !!! %s != %s " % (o[0], str(r), str(o[1])) assert False return
def __init__(self, path=None, data=None, verbose=False): self.verbose = verbose self.path = path self.register = Register32(self) self.map_call = dict() self.map_call_by_name = dict() self.pe = None self.action_reverse = dict() self.symbols_imported = dict() self.symbols_imported_by_name = dict() self.symbols_exported = dict() self.symbols_exported_by_name = dict() self.decode = None self.backhistory = [] self.data_code = '' self.stack = list() self.xref = dict() self.load_win32_pe(path=path, data=data)
def test_eax(self): """ Test de l'initialisation du moteur disass 32 """ try: register = Register32() except: assert False return register.eax = 0x080484cc if register.eax == 0x080484cc: assert True else: assert False return
def test_eip(self): """ Test de l'initialisation du moteur disass 32 """ try: register = Register32() except: assert False return register.eip = 0x11111111 if register.eip != 0x11111111: assert False return assert True return
def test_al(self): """ Test de l'initialisation du moteur disass 32 """ try: register = Register32() except: assert False return register.al = 0x84cc if register.al != 0xcc: assert False return if register.eax != 0xcc: assert False return assert True return
def test_xor(self): """ Test de l'initialisation du moteur disass 32 """ try: register = Register32() except: assert False return register.eax = 0x25 register.ebx = 0x12 r = 0x25^0x12 register.set('ecx',register.eax^register.ebx) if register.ecx != r: print register.ecx, r assert False assert True return