Thema: Delphi Memory Adress lesen

Einzelnen Beitrag anzeigen

MasterTobi

Registriert seit: 29. Apr 2007
212 Beiträge
 
#1

Memory Adress lesen

  Alt 5. Jul 2010, 09:36
hallo ich hab hier folgendes Problem

hier erstmal die adresse aus dem Ram

0xB6F5F0 - Player pointer (CPed)

This pointer:
+0 = Contains a pointer to the first element in the pool
+4 = Contains a pointer to a byte map indicating which elements are in use
+8 = [dword] Is the maximum number of elements in the pool
+12 = [dword] Is the current number of elements in the pool

Each ped object is 1988 (0x7C4) bytes.

For each ped in the pool:

In most cases, you can use even the dword of playeraddress as CPed value
CPed +0x14 = Pointer to XYZ position structure (and rotation)
(CPed+0x14) +0x0 to +0x2C = [dword] Is the rotation matrix
(CPed+0x14) +0x30 = [dword] XPos
(CPed+0x14) +0x34 = [dword] YPos
(CPed+0x14) +0x38 = [dword] ZPos


so nun möchte ich zb (CPed+0x14) +0x30 = [dword] XPos auslesen

ich mache dies so:
Delphi-Quellcode:
var i,x,y:integer;
cx,cy:dword;
begin
if ActiveCaption = 'GTA:SA:MPthen begin
WindowName :=FindWindow(nil,'GTA:SA:MP');
GetWindowThreadProcessId(WindowName ,@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);



    ReadProcessMemory(HandleWindow ,ptr($B6F5F0+$14+$30 ),@i,4,cx); //lesen aus einem Offset
  //lesen aus einem Offset
    label11.caption:=inttostr(i);
    closehandle(HandleWindow);
end;
end;
aber da kommen ganz andere werte raus also die xpos stimmt nicht wenn ich es so auslese wie hier

kann mir jemand helfen ?
MFG
Tobi
  Mit Zitat antworten Zitat