Registriert seit: 2. Dez 2009
Ort: München
320 Beiträge
Lazarus
|
Re: Auslesen eines Strings aus dem Ram eines Prozesses
31. Jan 2010, 15:57
Hallo roflcopter100.
Delphi-Quellcode:
function InfoAuslesen(ptrOffset: Pointer; cbData: DWORD): Pointer; stdcall;
var
hWindow: HWND;
dwPID: DWORD;
cbRead: DWORD;
hProc: THandle;
begin
result := nil;
hWindow := FindWindow(nil, 'Form1');
if hWindow <> 0 then begin
if GetWindowThreadProcessId(hWindow ,@dwPID) <> 0 then begin
hProc := OpenProcess(PROCESS_VM_READ ,False , dwPID);
GetMem(Result, cbData);
if not ReadProcessMemory(hProc, ptrOffset, Result, cbData, cbRead) then
RaiseLastWin32Error;
CloseHandle(hProc);
end;
end else
RaiseLastWin32Error;
end;
var
ptrData: Pointer;
begin
ptrData := InfoAuslesen(ptr($00000001), 11);
writeln(PChar(ptrData));
FreeMem(ptrData);
end.
lg. Astat
Lanthan Astat 06810110811210410503210511511603209711003210010110 9032084097103
03211611111604403209711003210010110903210010510103 2108101116122
11610103209010110510810103206711110010103210511003 2068101108112
10410503210310111509910411410510109810111003211910 5114100046
|
|
Zitat
|