Jump to content

Need Help - Get a value from a a memory address


Fayat
 Share

Recommended Posts

Hi all! I just searched over the forum, and just tried with some exemples, but i didn't succed to get the value of my caster ' mana points. I mean, i play on a mmorpg, and just found in the process the adress for the Mana Point.

here is the exemple: at 02C6CB6C is stocked my MP, so i would just read in memory this value and store it in a variable. So i tried :

Opt("WinTitleMatchMode", 3)

$pid = WinGetProcess("MYMMORPG")

$open = _MemOpen($pid)

$read = _MemRead($open,0x02C6CB6C,4)

MsgBox(0,"",$read)

EDIT: i use W0uter fonctions : _MemOpen & _MemRead

It prompt a blank MessageBox, so if you could help me to retrieve this value, i would share my final code with you, thanks a lot.

:">

Edited by Fayat
Link to comment
Share on other sites

#include <Array.au3>

Opt("WinTitleMatchMode", 3)

$pid = WinGetProcess("MYMMORPG")

$open = _MemOpen($pid)

$read = _MemRead($open,0x02C6CB6C,4)

_ArrayDisplay ( $read, "" )

_Memread returns an array, rather than a single value(i think)

Edited by death pax
Link to comment
Share on other sites

Ok thanks i'll take a look at it o:)

EDIT: I don't succeed in retrieve my value....damn...look at my C code, this is working, and i need the same in autoit script :lmao: :

#include <windows.h>
#include <stdio.h>

int main()
{
    int i,j;
    HANDLE hProcess;
    printf("[*]Recuperation du Handle sur le processus...\n");
    hProcess = OpenProcess(PROCESS_VM_READ, FALSE, 1324);
    if (hProcess == NULL)
    {
                printf("[-]Ouverture du processus impossible...\n");
    }
    else
    {
        //BYTE tab[2];
        DWORD tab[2];
        char test[2];
        DWORD dwAddress = 0x02C6CB6C;
        DWORD nb = 0;
        printf("[*]Lecture de l adresse: %x\n", dwAddress);
        ReadProcessMemory(hProcess, (LPCVOID) dwAddress, tab, 4, &nb);
        printf("Nombre de bytes lus: %d\n", nb);
        for(i=0;i<=1;i++)
        {
                          printf("tab[%d]: %x\n", i, tab[i]);
        }

    }
    scanf("%d",j);
}

With this i get the mana value in my game memory, and i have still a problem, this value is in hex format, and i need it in decimal, in exemple i have 434 mana point, so i retrieve this value : 1B2 in little indian ;)

Thanks for your help

Edited by Fayat
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...