Ejemplo n.º 1
0
 def testCrawlToyData(self):
     test_binary = b"\00" * 0x10 + b"\x34\x12\x00\x00" + b"\00" * 0x10 + b"\x78\x56\x00\x00\x00\x00\x00\x00" + b"\00" * 0x10
     scout = ApiScout()
     scout.api_maps["test_1"] = {0x1234: ("test.dll", "TestApi", 32)}
     scout.api_maps["test_2"] = {0x5678: ("test2.dll", "TestApi2", 64)}
     scout.has_64bit = True
     results = {
         'test_2': [(36, 22136, 'test2.dll', 'TestApi2', 64, None, 1)],
         'test_1': [(16, 4660, 'test.dll', 'TestApi', 32, None, 1)]
     }
     self.assertEqual(results, scout.crawl(test_binary))
Ejemplo n.º 2
0
 def testCrawlToyData(self):
     test_binary = "\00" * 0x10 + struct.pack(
         "I", 0x1234) + "\00" * 0x10 + struct.pack("Q",
                                                   0x5678) + "\00" * 0x10
     scout = ApiScout()
     scout.api_maps["test_1"] = {0x1234: ("test.dll", "TestApi", 32)}
     scout.api_maps["test_2"] = {0x5678: ("test2.dll", "TestApi2", 64)}
     scout.has_64bit = True
     results = {
         'test_2': [(36, 22136, 'test2.dll', 'TestApi2', 64)],
         'test_1': [(16, 4660, 'test.dll', 'TestApi', 32)]
     }
     self.assertEqual(results, scout.crawl(test_binary))