下面是准备直接调用系统的NtReadVirtualMemory代码:
NTSTATUS MyNtReadVirtualMemory(
IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
OUT PVOID Buffer,
IN ULONG NumberOfBytesToRead,
OUT PULONG NumberOfBytesReaded)
{
NTSYSAPI
NTSTATUS
NTAPI
NtReadVirtualMemory(
IN HANDLE ProcessHandle,
IN PVOID BaseAddress,
OUT PVOID Buffer,
IN ULONG BufferLength,
OUT PULONG ReturnLength OPTIONAL
);
Buffer 这个r3与r0通信 非常容易出错,传入地址与传入数据与大小是否正确?读不出数据,你是否打开句柄,获取的NtReadVirtualMemory函数地址是否正确?。
你为什么这样写函数,是否有HOOK,没有HOOK的话,直接调用就行了,论坛上有模拟ReadVirtualMemory