Registriert seit: 2. Dez 2009
Ort: München
320 Beiträge
Lazarus
|
Re: HILFE! Suchen nach Unicode im Speicher!!
17. Dez 2009, 15:56
Hallo NetComPlus, du kannst dir folgende Funktion umbauen.
Für die Suche schau mal da.
http://www.delphipraxis.net/internal...light=scanfile
http://www.delphipraxis.net/internal...light=scanfile
http://www.delphipraxis.net/internal...light=scanfile
http://www.delphipraxis.net/internal...light=scanfile
Delphi-Quellcode:
function GetMemoryDump(dwProcessId : DWORD) : string;
var
hProcess : THandle;
cbRead : cardinal;
buf : array of char;
memStart : pointer;
memInfo : MEMORY_BASIC_INFORMATION;
FileStream: TFileStream;
begin
result := '';
hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, FALSE, dwProcessId);
if hProcess = 0 then exit;
FileStream := TFileStream.Create('MemoryDump.bin', fmCreate or fmShareDenyNone);
memstart := pointer($00000);
while VirtualQueryEx(hProcess, memstart, memInfo, SizeOf(MEMORY_BASIC_INFORMATION)) = SizeOf(MEMORY_BASIC_INFORMATION) do
begin
if (meminfo.State = MEM_COMMIT) then
begin
setlength(buf, meminfo.RegionSize);
if ReadProcessMemory(hProcess, memInfo.BaseAddress, buf, memInfo.RegionSize, cbRead) then
FileStream.Write(buf[0], cbRead);
//-- hier Buffer durchsuchen, wenn gefunden BaseAddress + regionsize - offset -> ausgeben
setlength(buf, 0);
buf := nil;
end;
DWORD(memstart) := DWORD(meminfo.BaseAddress) + meminfo.regionsize;
end;
CloseHandle(hProcess);
FileStream.Free;
end;
lg. Astat
Lanthan Astat 06810110811210410503210511511603209711003210010110 9032084097103
03211611111604403209711003210010110903210010510103 2108101116122
11610103209010110510810103206711110010103210511003 2068101108112
10410503210310111509910411410510109810111003211910 5114100046
|
|
Zitat
|