BOOL ReadProcessMemory(
HANDLE hProcess,
LPCVOID lpBaseAddress,
LPVOID lpBuffer,
SIZE_T nSize,
SIZE_T* lpNumberOfBytesRead
);
HANDLE hProcess,
LPCVOID lpBaseAddress,
LPVOID lpBuffer,
SIZE_T nSize,
SIZE_T* lpNumberOfBytesRead
);
解决方案 »
- 照片 坐标
- 如何创建窗口(已作成资源文件)及如何把资源文件里的窗体显示出来
- 最近一段时间,自己、家人或朋友注射过疫苗的请注意了!!!!!!!!!!!!!!
- (100分)求visual c++mfc编程实例的随书实例源码,先发到我邮箱可得全部200分!-- [email protected]
- msdn 有中文的吗
- 请问大虾有关在windows上移植GCC的问题。
- 高手来一下!vc6中定义结构体时有偏移吗?一般是多少个字节?
- VC写的Dll,想要用Delphi调用,存在数据类型上的差异,怎么解决呢?
- 请问那位大侠知道那里有《Visual C++ MFC编程实例》配套光盘的源码下载?
- 我的类跑哪儿去了,各位大哥帮帮忙?
- 关于vc与数据库的语句
- WM_CONTROL与VK_CONTROL有何不同!
这如何实现?ASCII码在ANSI里面是单字节的,在UNICODE里面是双字节的,在UTF-8里面呢
没听过全以4字节来跑的呀。其实,知道了内存地址,那在32位系统(比如现在最常见的PC电脑上),直接地址+4就行了。比如
需要读取内存一共1MB#define SIZE 1048576 // 1MB
int pBuf[SIZE/4+1];
char* addr = 0x.....; //已知的内存地址开始
unsigned int i=0;
for( i=0; i<SIZE; i++ )
{
pBuf[i] = *((int*)addr);
addr += 4;
}
push ebp
mov ebp,esp
lea eax,[ebp+14h]
push eax
push dword ptr [ebp+14h]
push dword ptr [ebp+10h]
push dword ptr [ebp+0Ch]
push dword ptr [ebp+8]
call dword ptr [kernel32!_imp__NtReadVirtualMemory (77e413fc)]
mov ecx,dword ptr [ebp+18h]
test ecx,ecx
jne kernel32!ReadProcessMemory+0x20 (77e41a7f)
test eax,eax
jl kernel32!ReadProcessMemory+0x29 (77e41a86)
xor eax,eax
inc eax
pop ebp
ret 14h
mov edx,dword ptr [ebp+14h]
mov dword ptr [ecx],edx
jmp kernel32!ReadProcessMemory+0x25 (77e41a74)
push eax
call kernel32!BaseSetLastNTError (77e576ba)
xor eax,eax
jmp kernel32!ReadProcessMemory+0x36 (77e41a7b)
取16个字节的长度
ReadProcessMemory(hProc,(void*)(temp_x_peopleInfo+0x430),&strTemp,16,NULL);我用这种方式不行,strTemp是乱码
实际上这块区域应该是一串中文数据
7c92e2bb b8ba000000 mov eax,0BAh
7c92e2c0 ba0003fe7f mov edx,offset SharedUserData!SystemCallStub (7ffe0300)
7c92e2c5 ff12 call dword ptr [edx]
7c92e2c7 c21400 ret 14h
805859c5 6a1c push 1Ch
805859c7 6828ef4f80 push offset nt!MmPagedPoolStart+0x1d0 (804fef28)
805859cc e883a0f8ff call nt!_SEH_prolog (8050fa54)
805859d1 64a124010000 mov eax,dword ptr fs:[00000124h]
805859d7 8bf8 mov edi,eax
805859d9 8a8740010000 mov al,byte ptr [edi+140h]
805859df 8845e4 mov byte ptr [ebp-1Ch],al
805859e2 8b7514 mov esi,dword ptr [ebp+14h]
805859e5 84c0 test al,al
805859e7 0f84c6000000 je nt!NtReadVirtualMemory+0x8a (80585ab3)
805859ed 8b450c mov eax,dword ptr [ebp+0Ch]
805859f0 8d1430 lea edx,[eax+esi]
805859f3 3bd0 cmp edx,eax
805859f5 0f82b1000000 jb nt!NtReadVirtualMemory+0x83 (80585aac)
805859fb 8b4510 mov eax,dword ptr [ebp+10h]
805859fe 8d0c30 lea ecx,[eax+esi]
80585a01 3bc8 cmp ecx,eax
80585a03 0f82a3000000 jb nt!NtReadVirtualMemory+0x83 (80585aac)
80585a09 a1bc745480 mov eax,dword ptr [nt!MmHighestUserAddress (805474bc)]
80585a0e 3bd0 cmp edx,eax
80585a10 0f8796000000 ja nt!NtReadVirtualMemory+0x83 (80585aac)
80585a16 3bc8 cmp ecx,eax
80585a18 0f878e000000 ja nt!NtReadVirtualMemory+0x83 (80585aac)
80585a1e 8b5d18 mov ebx,dword ptr [ebp+18h]
80585a21 85db test ebx,ebx
80585a23 7419 je nt!NtReadVirtualMemory+0x8d (80585a3e)
80585a25 8365fc00 and dword ptr [ebp-4],0
80585a29 a1b4745480 mov eax,dword ptr [nt!MmUserProbeAddress (805474b4)]
80585a2e 3bd8 cmp ebx,eax
80585a30 0f83d7db0400 jae nt!NtReadVirtualMemory+0x59 (805d360d)
80585a36 8b03 mov eax,dword ptr [ebx]
80585a38 8903 mov dword ptr [ebx],eax
80585a3a 834dfcff or dword ptr [ebp-4],0FFFFFFFFh
80585a3e 33c0 xor eax,eax
80585a40 8945dc mov dword ptr [ebp-24h],eax
80585a43 8945d8 mov dword ptr [ebp-28h],eax
80585a46 3bf0 cmp esi,eax
80585a48 7443 je nt!NtReadVirtualMemory+0xdc (80585a8d)
80585a4a 50 push eax
80585a4b 8d45d4 lea eax,[ebp-2Ch]
80585a4e 50 push eax
80585a4f ff75e4 push dword ptr [ebp-1Ch]
80585a52 ff35588c5480 push dword ptr [nt!PsProcessType (80548c58)]
80585a58 6a10 push 10h
80585a5a ff7508 push dword ptr [ebp+8]
80585a5d e87dadfeff call nt!ObReferenceObjectByHandle (805707df)
80585a62 8945d8 mov dword ptr [ebp-28h],eax
80585a65 85c0 test eax,eax
80585a67 7524 jne nt!NtReadVirtualMemory+0xdc (80585a8d)
80585a69 8d45dc lea eax,[ebp-24h]
80585a6c 50 push eax
80585a6d ff75e4 push dword ptr [ebp-1Ch]
80585a70 56 push esi
80585a71 ff7510 push dword ptr [ebp+10h]
80585a74 ff7744 push dword ptr [edi+44h]
80585a77 ff750c push dword ptr [ebp+0Ch]
80585a7a ff75d4 push dword ptr [ebp-2Ch]
80585a7d e855abffff call nt!MmCopyVirtualMemory (805805d7)
80585a82 8945d8 mov dword ptr [ebp-28h],eax
80585a85 8b4dd4 mov ecx,dword ptr [ebp-2Ch]
80585a88 e84353f6ff call nt!ObfDereferenceObject (804eadd0)
80585a8d 85db test ebx,ebx
80585a8f 7410 je nt!NtReadVirtualMemory+0xf9 (80585aa1)
80585a91 c745fc01000000 mov dword ptr [ebp-4],1
80585a98 8b45dc mov eax,dword ptr [ebp-24h]
80585a9b 8903 mov dword ptr [ebx],eax
80585a9d 834dfcff or dword ptr [ebp-4],0FFFFFFFFh
80585aa1 8b45d8 mov eax,dword ptr [ebp-28h]
80585aa4 e8e49ff8ff call nt!_SEH_epilog (8050fa8d)
80585aa9 c21400 ret 14h