MCPcopy Create free account
hub / github.com/dobin/SuperMega / test_asm_fixup

Method test_asm_fixup

tests/test_asmparser.py:25–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23
24
25 def test_asm_fixup(self):
26 asm_in: FilePath = "tests/data/peb_walk_pre_fixup.asm"
27 asm_text = file_readall_text(asm_in)
28 injectable = Injectable("fake.exe")
29 injectable.add_datareuse_fixup(DataReuseEntry("supermega_payload"))
30 settings: Settings = Settings()
31 settings.payload_location = PayloadLocation.DATA
32 asm_text_lines = parse_asm_text_file(injectable, asm_text, settings)
33
34 # cmp DWORD PTR n$1[rsp], 11223344 ; 00ab4130H
35 # cmp DWORD PTR n$1[rsp], 272 ; 00ab4130H
36 #self.assertTrue(", 272" in lines[192-1])
37 #self.assertTrue("11223344" not in lines[192-1])
38
39 # Original:
40 # mov r8, QWORD PTR supermega_payload
41 # New:
42 # lea r8, [shcstart]
43 #self.assertTrue("lea r8, [shcstart]" in asm_text_lines[198-1-1])
44 self.assertTrue("DB 0" in asm_text_lines[198-1-1])
45
46
47 def test_asm_iat_request(self):

Callers

nothing calls this directly

Calls 6

add_datareuse_fixupMethod · 0.95
InjectableClass · 0.90
DataReuseEntryClass · 0.90
SettingsClass · 0.90
parse_asm_text_fileFunction · 0.90
file_readall_textFunction · 0.85

Tested by

no test coverage detected