Memory script help Topic is solved

Ask gaming related questions
Mightykiller
Posts: 56
Joined: 09 Oct 2017, 13:34

Memory script help

14 Oct 2019, 18:46

Hi i need help with this memory script.
What i need is to check a pointer address value in String every time it changes and do action.

This is the pointer static address i got:
106E00E8
"Storm.dll"+00055538 ->14FE0000
Screenshot_1.png
Screenshot_1.png (80.34 KiB) Viewed 279 times
This is the script i use before to check a string in a game, i need to change this script to search for a pointer address i got from cheat engine.

Code: Select all

#SingleInstance Force
#Include <classMemory>

if !A_IsAdmin 
{
        Run *RunAs "%A_ScriptFullPath%"
        exitapp 
}


if (_ClassMemory.__Class != "_ClassMemory")
{
    msgbox class memory not correctly installed. 
    ExitApp
}


_ClassMemory.setSeDebugPrivilege() ; Required - must be first thing called


TargetProcess := new _ClassMemory("ahk_exe game.exe",, hProcessCopy)


if !isObject(TargetProcess) 
{
    if (hProcessCopy = 0)
        msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter. 
    else if (hProcessCopy = "")
        msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. _ClassMemory.setSeDebugPrivilege() may also be required. Consult A_LastError for more information.
    ExitApp
}


myAOBstringpattern := "Test123"

Loop
{
    myAOBscan := TargetProcess.stringToPattern(myAOBstringpattern, "UTF-8")    
    myAOBaddressdec := TargetProcess.processPatternScan(,, myAOBscan*)
    if (myAOBaddressdec > 0) ;AOB found, stop scanning and convert it from decimal to hexadecimal
    {
        msgbox Address found
    }
    else ;AOB not found, continue scanning
    {
        Sleep, 500
    }

}
RHCP
Posts: 194
Joined: 30 Sep 2013, 10:59

Re: Memory script help  Topic is solved

15 Oct 2019, 06:48

Something like this:

Code: Select all

#SingleInstance Force
#Include <classMemory>

if !A_IsAdmin 
{
        Run *RunAs "%A_ScriptFullPath%"
        exitapp 
}


if (_ClassMemory.__Class != "_ClassMemory")
{
    msgbox class memory not correctly installed. 
    ExitApp
}


_ClassMemory.setSeDebugPrivilege() ; Required - must be first thing called


TargetProcess := new _ClassMemory("ahk_exe game.exe",, hProcessCopy)


if !isObject(TargetProcess) 
{
    if (hProcessCopy = 0)
        msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter. 
    else if (hProcessCopy = "")
        msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. _ClassMemory.setSeDebugPrivilege() may also be required. Consult A_LastError for more information.
    ExitApp
}


base := TargetProcess.getModuleBaseAddress("Storm.dll")
msgbox % "Module Base: " base

value := TargetProcess.readString(base + 0x00055538, 0, "utf-8", 0x118, 0x15C, 0x44, 0x1EC, 0x0)
msgbox % "result: " value
Mightykiller
Posts: 56
Joined: 09 Oct 2017, 13:34

Re: Memory script help

17 Oct 2019, 19:52

Thank you it works fine now.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 27 guests