mcjking How do I cheat?
Reputation: 0
Joined: 15 Aug 2015 Posts: 1
|
Posted: Tue Aug 18, 2015 12:04 am Post subject: [Help] help change value to protected memory in delphi |
|
|
hello
the problem is
when I try to change the value of a memory address, detects that been been modified
I use this source delphi
Code: | uses TlHelp32;
Const ProgramName = 'main.exe';
function GetProcessID(Const ExeFileName: string; var ProcessId: integer): boolean;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := false;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while integer(ContinueLoop) <> 0 do begin
if (StrIComp(PChar(ExtractFileName(FProcessEntry32.sz ExeFile)), PChar(ExeFileName)) = 0)
or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0) then begin
ProcessId:= FProcessEntry32.th32ProcessID;
result := true;
break;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Address : Integer;
PidId, Valor : Integer;
PidHandle : THandle;
Buffer : Cardinal;
begin
if GetProcessID(ProgramName, PidId) then
begin
PidHandle := OpenProcess(PROCESS_ALL_ACCESS,False,PidId);
Valor := 65535;
ReadProcessMemory(PidHandle, Pointer($077C2A08),@Address,4,buffer);
WriteProcessMemory(PidHandle, Pointer(Address + $1A),@Valor,4,Buffer);
end;
end; |
as could modify the memory protected?
thanks...
|
|