Results 1 to 3 of 3
  1. #1
    TEgsgsgsgegss's Avatar
    Join Date
    Oct 2014
    Gender
    female
    Posts
    3
    Reputation
    10
    Thanks
    0

    SAMP ReadProcessMemory

    Why this doesn't work?

    [HTML]
    DWORD PlayerPointer = 0xB6F5F0;
    DWORD HealthOffset = 0x544;

    ReadProcessMemory(hProc, (LPVOID*)(PlayerPointer + HealthOffset), &f, sizeof(float), NULL);[/HTML]

    ht tp://ww w.gtamodding.co m/?title=Memory_Addresses_%28SA%29#General

    0xB6F5F0 - Player pointer (CPed)
    CPed +0x540 = [float] Health

  2. #2
    Knochove's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    :(
    Posts
    48
    Reputation
    10
    Thanks
    11
    My Mood
    Tired
    I've never done external hacks or games without static addresses but my guess would be that you need to add the game's base address. So it becomes :

    Code:
    ReadProcessMemory(hProc, (LPVOID*)((DWORD)GetModuleHandle(0) + PlayerPointer + HealthOffset), &f, sizeof(float), NULL);

  3. #3
    殺す必要がある唯一のものは殺されるために準備され人 々である。
    Premium Member
    Hitokiri~'s Avatar
    Join Date
    Oct 2012
    Gender
    female
    Location
    Cancer.
    Posts
    1,201
    Reputation
    24
    Thanks
    937
    My Mood
    Bitchy
    You need a better understanding of how pointers work.
    Since I'm too lazy to explain, I'll leave you to google.

    Code:
    // N.B. This differs from multi-level points as it requires multiple ReadProcessMemory's.
    DWORD PlayerPointer = 0xB6F5F0;
    DWORD HealthOffset = 0x544;
    
    DWORD ptrOffs = 0, out = 0;
    if(ReadProcessMemory(hProc, LPCVOID(PlayerPointer), &ptrOffs, sizeof(DWORD), &out) && ( ptrOffs += HealthOffset, ReadProcessMemory(hProc, LPCVOID(ptrOffs), &f, sizeof(float), &out) )
       Alert( "Read memory: [ %f ]", f );
    else
       Alert( "RPM returned false!" );

Similar Threads

  1. ReadProcessMemory
    By Void in forum C++/C Programming
    Replies: 17
    Last Post: 04-03-2010, 07:12 AM
  2. [Request] Samp Admin Hack
    By Kirtz in forum Hack Requests
    Replies: 1
    Last Post: 01-21-2010, 06:02 AM
  3. SAMP Hacks?
    By nightfox121 in forum Hack Requests
    Replies: 4
    Last Post: 07-19-2009, 08:23 PM
  4. SAMP money Freeze hack
    By Aragorn in forum Hack Requests
    Replies: 2
    Last Post: 07-18-2009, 07:45 PM
  5. Write/ReadProcessMemory errors
    By Dragonion in forum General Game Hacking
    Replies: 0
    Last Post: 09-23-2008, 08:11 AM