(self)
| 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): |
nothing calls this directly
no test coverage detected