def platformGetRegCtx(self, tid):
ctx = self.archGetRegCtx()
# NOTE: the tid *is* the port...
state = STRUCT_X86_THREAD_STATE32()
scount = ctypes.c_uint32(ctypes.sizeof(state) / 4)
ret = self.libc.thread_get_state(tid, x86_THREAD_STATE32, addrof(state), addrof(scount));
if ret != 0:
raise Exception('thread_get_state (THREAD_STATE32) failed: 0x%.8x' % ret)
ctx._rctx_Import(state)
state = STRUCT_X86_DEBUG_STATE32()
scount = ctypes.c_uint32(ctypes.sizeof(state) / 4)
ret = self.libc.thread_get_state(tid, x86_DEBUG_STATE32, addrof(state), addrof(scount));
if ret != 0:
raise Exception('thread_get_state (DEBUG_STATE32) failed: 0x%.8x' % ret)
ctx._rctx_Import(state)
return ctx
评论列表
文章目录