MCPcopy Create free account
hub / github.com/Vector35/debugger / test_memory_read_write

Method test_memory_read_write

test/debugger_test.py:217–235  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

215 dbg.quit_and_wait()
216
217 def test_memory_read_write(self):
218 fpath = name_to_fpath('helloworld', self.arch)
219 bv = load(fpath)
220 dbg = DebuggerController(bv)
221 self.assertNotIn(dbg.launch_and_wait(), [DebugStopReason.ProcessExited, DebugStopReason.InternalError])
222
223 # Due to https://github.com/Vector35/debugger/issues/124, we have to skip the bytes at the entry point
224 addr = dbg.ip + 10
225 data = dbg.read_memory(addr, 256)
226 self.assertFalse(dbg.write_memory(0, b'heheHAHAherherHARHAR'), False)
227 data2 = b'\xAA' * 256
228 dbg.write_memory(addr, data2)
229
230 self.assertEqual(len(dbg.read_memory(0, 256)), 0)
231 self.assertEqual(dbg.read_memory(addr, 256), data2)
232 dbg.write_memory(addr, data)
233 self.assertEqual(dbg.read_memory(addr, 256), data)
234
235 dbg.quit_and_wait()
236
237 # @unittest.skip
238 def test_thread(self):

Callers

nothing calls this directly

Calls 6

launch_and_waitMethod · 0.95
read_memoryMethod · 0.95
write_memoryMethod · 0.95
quit_and_waitMethod · 0.95
DebuggerControllerClass · 0.90
name_to_fpathFunction · 0.85

Tested by

no test coverage detected