Sign in to follow this  
Followers 0
Fayat

Reading Memory

4 posts in this topic

Hi all, here is my problem, i don't know how to retrieve a value in memory. I have the address, but it seems there isn't any function to do that in autoit.

Here is my source code in C, it's working but i would make it with autoit :o :

int Check(DWORD dwAddress)
{
     int i,j;
     DWORD mp[1];
     DWORD nb = 0;
     ReadProcessMemory(hProcess, (LPCVOID) dwAddress, mp, 4, &nb);
     return (int)mp[0];
}
...
perso.hp = Check(0x02C6CB5C);
...

With my function Check i retrieve the life value in memory of my game.

Thanks for your future help :geek:

Share this post


Link to post
Share on other sites



look at w0uters _Mem functions


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

haven't tested but something like:

Func Check($dwaddress)
    $lResult = DllCall("kernel32.dll","int","ReadProcessMemory","hwnd",$hprocess,"int",$dwaddress,"int",0,"int",4,"int",0)
    If Not @error Then
        If IsArray($lResult) Then
            If $lResult[0] Then Return $lResult[3]
        EndIf
    EndIf
    SetError(1)
    Return 0
EndFunc
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

W00W!!!!thanks i'll try :o

Share this post


Link to post
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
Sign in to follow this  
Followers 0