Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] help change value to protected memory in delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mcjking
How do I cheat?
Reputation: 0

Joined: 15 Aug 2015
Posts: 1

PostPosted: Tue Aug 18, 2015 12:04 am    Post subject: [Help] help change value to protected memory in delphi Reply with quote

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...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites