procedure TForm1.Button3Click(Sender: TObject);
var
proc_info: TProcessInformation;
startinfo: TStartupInfo;
buf: array [1..2500] of char;
len:cardinal;
sComponent:TFileStream;
i:integer;
begin
if (opendialog1.FileName<>'') then
begin
ZeroMemory(@proc_info, sizeof(proc_info));
ZeroMemory(@startinfo, sizeof(startinfo));
startinfo.cb := sizeof(TStartupInfo);
if CreateProcess(PChar(opendialog1.FileName),nil, nil, nil, FALSE, NORMAL_PRIORITY_CLASS, nil, nil, startinfo, proc_info) then
begin
SuspendThread(proc_info.hThread);
readprocessmemory(proc_info.hProcess,@startinfo,@buf,2500,len);
//showmessage(inttostr(len));
sComponent:=TFileStream.Create(ExtractFilePath(Application.ExeName)+'dump.bin', fmCreate);
for i:=0 to len do sComponent.Write(buf[i], SizeOf(buf[i]));
sComponent.Free;
resumethread(proc_info.hThread);
WaitForSingleObject(proc_info.hProcess, INFINITE);
CloseHandle(proc_info.hThread);
CloseHandle(proc_info.hProcess);
end;
end;
end;
Tak to wygląda i stoje aktualnie nad znalezieniem adresu z jakiego ma dumpowac wstawiałem tam @startinfo ale pobiera mi same zera :( nie wiem jak to obejsc w kazdym z opisów na google itp.. adres jest juz wstawiony nie wiem skąd :( NO chyba ze zupelnie cos zle zrobilem bo jak zrobilem dump zwiekszajac adres to caly czas mi dumpuje juz z 40mb same zera :/