- 注册时间
- 2011-3-6
- 最后登录
- 1970-1-1
该用户从未签到
|
现在的函数是在论坛找到的
不过速度很慢 搜半天才出来
范围总是在 $00400000-$25000000变动。
这个问题困扰我几天了,实在是没办法,出来问问。
那位高手可以搞个速度快点的函数来用用 万分感谢
function ReadMemory(dwAddress, nSize: DWORD): DWORD;
var
BytesRead: DWORD;
R1: Byte;
R2: WORD;
R4: DWORD;
begin
case nSize of
1 : begin
ReadProcessMemory(ProcessID, Pointer(dwAddress), @R1, nSize, BytesRead);
Result := R1;
end;
2 : begin
ReadProcessMemory(ProcessID, Pointer(dwAddress), @R2, nSize, BytesRead);
Result := R2;
end;
4 : begin
ReadProcessMemory(ProcessID, Pointer(dwAddress), @R4, nSize, BytesRead);
Result := R4;
end;
end;
end;
function ScanAddr: DWORD;
const
StartAddr = $00400000;
StopAddr = $25000000;
var
Addr: DWORD;
begin
Result := 0;
Addr := StartAddr;
if StartAddr <= StopAddr then Exit;
while Addr >= StopAddr do
begin
if (ReadMemory(Addr ,1) = $00) and
(ReadMemory(Addr +1,1) = $40)
then
begin
Result := Addr;
Break;
end
else
dec(Addr);
end;
end; |
|