HELP %A_Index% AOB SCAN

Ask gaming related questions (AHK v1.1 and older)
theon
Posts: 124
Joined: 23 Jun 2019, 15:39

HELP %A_Index% AOB SCAN

Post by theon » 11 Aug 2022, 13:07

I wanted to pull the values of all addresses from aob scan
in the cheat engine it always appears 3 but when I put it like this, the 3 values of addres don't appear, I need it to do the aob search for all the results. more in the ahk scan it only shows one
would there be any way to differentiate the value of the prize loop ?

Code: Select all

#include <classMemory>

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

WinGet, PID, PID, Chara1

mem := new _ClassMemory("ahk_exe ldvboxheadless.exe", "", hProcessCopy)

if !IsObject(mem)
{
    if (hProcess = "")
        msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. Consult A_LastError for more information.
    else msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter.
    ExitApp
}
loop,11
{
SetFormat, IntegerFast, hex
; I just put the pattern in an array so that it's a bit neater with 2 function calls
aPattern%A_Index% := [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, "?", "?", "?", "?", 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x00, 0x00, 0x00, 0x00]
address%A_Index% := mem.processPatternScan(,, aPattern%A_Index%*)
address2%A_Index% := address%A_Index% - 0x180

msgbox, % address2%A_Index%

}

return 

 
@boiler
@BoBo
Last edited by BoBo on 11 Aug 2022, 13:33, edited 1 time in total.
Reason: Moved to 'Gaming'-section.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: HELP %A_Index% AOB SCAN

Post by swagfag » 11 Aug 2022, 18:00

there seems to be some serious lack of understanding of what the method is doing and what it's returning
  • u perform the call
  • u get an address back, maybe(hint: u should be checking this)
  • u perform another call, setting the starting address to the address u (hopefully) got back from the prior call
  • repeat until the calls fail, indicating no more byte patterns are to be found in the remaining address space

theon
Posts: 124
Joined: 23 Jun 2019, 15:39

Re: HELP %A_Index% AOB SCAN

Post by theon » 11 Aug 2022, 19:38

swagfag wrote:
11 Aug 2022, 18:00
there seems to be some serious lack of understanding of what the method is doing and what it's returning
  • u perform the call
  • u get an address back, maybe(hint: u should be checking this)
  • u perform another call, setting the starting address to the address u (hopefully) got back from the prior call
  • repeat until the calls fail, indicating no more byte patterns are to be found in the remaining address space

how do i do that i have no idea

:problem:

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: HELP %A_Index% AOB SCAN

Post by swagfag » 11 Aug 2022, 19:57

a good place to start is reading the processPatternScan method documentation. once u understand that parameters/arguments the method accepts and what range of values it can return and what they all mean, it shouldnt be too hard to adjust ur code. as far as the code is concerned, u surely must have at least some kind of an idea how to pass parameters to functions, how to store their return values in variables and how to perform if-checks... after all, ure already doing all of that in the code uve written so far!

theon
Posts: 124
Joined: 23 Jun 2019, 15:39

Re: HELP %A_Index% AOB SCAN

Post by theon » 11 Aug 2022, 20:17

swagfag wrote:
11 Aug 2022, 19:57
a good place to start is reading the processPatternScan method documentation. once u understand that parameters/arguments the method accepts and what range of values it can return and what they all mean, it shouldnt be too hard to adjust ur code. as far as the code is concerned, u surely must have at least some kind of an idea how to pass parameters to functions, how to store their return values in variables and how to perform if-checks... after all, ure already doing all of that in the code uve written so far!
ok, thank you very much, could you indicate the documentation and processPatternScan, or give me some base example for me to have a north?


theon
Posts: 124
Joined: 23 Jun 2019, 15:39

Re: HELP %A_Index% AOB SCAN

Post by theon » 13 Aug 2022, 17:22

he is scanning now how do I retrieve these values?

Code: Select all

#include <classMemory>


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

WinGet, PID, PID, Chara1

mem := new _ClassMemory("ahk_exe ldvboxheadless.exe", "", hProcessCopy)

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

 aPattern := [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, "?", "?", "?", "?", 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x00, 0x00, 0x00, 0x00]
count := 0
loop, 3 {
SetFormat, IntegerFast, hex
address := mem.processPatternScan(address + 1,, aPattern*)
      count += 1
address2 := address - 0x180
msgbox % "Count: " count "address: " address2
 
 }
 
 return 

Post Reply

Return to “Gaming Help (v1)”