我使用winappdbg爲了設置斷點NTDLL!NtWriteVirtualMemory。winappdbg NtWriteVirtualMemory處理錯誤
我的目標是檢查遠程進程的內存保護PAGE_EXECUTE。
所以我成功地在NtWriteVirtualMemory上設置了斷點,問題是我得到了 函數中的一個參數(例如0x20),但是當我在腳本中使用它時它是無效的。
我嘗試使用winappdbg.win32.VirtualQueryEx(GOT句柄無效)
任何想法?
def action_callback(event):
print "ntdll!NtWriteVirtualMemory was called!"
process = event.get_process()
thread = event.get_thread()
# Get the address of the top of the stack.
stack = thread.get_sp()
# Get the return address of the call.
retAddress = process.read_pointer(stack)
print "ret address " + hex(retAddress)
processHandle = process.read_pointer(stack+4)
print "processHandle " + hex(processHandle)
BaseAddress = process.read_pointer(stack+8)
print "BaseAddress " + hex(BaseAddress)
Buffer = process.read_pointer(stack+12)
print "Buffer " + hex(Buffer)
NumberOfBytesToWrite = process.read_pointer(stack+16)
print "NumberOfBytesToWrite " + hex(NumberOfBytesToWrite)
NumberOfBytesWritten = process.read_pointer(stack+16)
print "NumberOfBytesWritten " + hex(NumberOfBytesWritten)
print "====================="
print "virtualQuery - " + VirtualQueryEx(int(processHandle), BaseAddress)
謝謝!!