Beispiel #1
0
 def setUpClass(cls):
     super(SmdaIntegrationTestSuite, cls).setUpClass()
     disasm = Disassembler(config)
     with open(
             os.path.join(config.PROJECT_ROOT, "tests",
                          "asprox_0x008D0000_xored"), "rb") as f_binary:
         binary = f_binary.read()
     decrypted = bytearray()
     for index, byte in enumerate(binary):
         if isinstance(byte, str):
             byte = ord(byte)
         decrypted.append(byte ^ (index % 256))
     cls.asprox_disassembly = disasm.disassemble(bytes(decrypted), 0x8D0000)
Beispiel #2
0
def disassembleFile(file_path, base_addr, map_file=False):
    print("now analyzing {}".format(file_path))
    loader = FileLoader(file_path, map_file=map_file)
    file_content = loader.getData()
    disasm = Disassembler(config)
    start = time.clock()
    try:
        disassembly = disasm.disassemble(file_content, base_addr, timeout=config.TIMEOUT)
        report = disasm.getDisassemblyReport(disassembly)
        report["filename"] = os.path.basename(file_path)
        print(disassembly)
    except Exception as exc:
        print("-> an error occured (", str(exc), ").")
        report = {"status":"error", "meta": {"traceback": traceback.format_exc(exc)}, "execution_time": time.clock() - start}
    return report
Beispiel #3
0
 def setUpClass(cls):
     super(SmdaIntegrationTestSuite, cls).setUpClass()
     # remove the win7 library as asprox had been dumped on win_xp
     config.API_COLLECTION_FILES.pop("win_7")
     disasm = Disassembler(config)
     with open(
             os.path.join(config.PROJECT_ROOT, "tests",
                          "asprox_0x008D0000_xored"), "rb") as f_binary:
         binary = f_binary.read()
     decrypted = bytearray()
     for index, byte in enumerate(binary):
         if isinstance(byte, str):
             byte = ord(byte)
         decrypted.append(byte ^ (index % 256))
     cls.asprox_disassembly = disasm.disassemble(bytes(decrypted), 0x8D0000)