What?, that depends on the function that u use or you code to do array of bytes search here's a simple example of how to implement. Sorry for the awful code
#include <NomadMemory.au3>
#include <WinAPI.au3>
#include <WinAPIProc.au3>
#include <Array.au3>
Global $open = _MemoryOpen(ProcessExists("Test.exe")); test exe is a c++ test program
#cs
Test.cpp
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
float life = 100;
printf("Hit shift to downgrade life \n");
printf("Your current life is: %.2f",life);
srand(time(NULL));
while(1)
{
Sleep(20);
if (GetAsyncKeyState(VK_SHIFT)&1)
{
system("cls");
life -= rand()%10;
if (life < 0)
{
printf("you are dead :( \n");
break;
}else
printf("U get hurt, your life now is %.2f",life);
}
}
system("pause");
return 0;
}
#ce
$yourPattern = "\0x00\0x00\0x00\0x42\0x60\0x19\0x40" ;search with cheat engine or something
$byteMask = "???xxxx"
$Addr = FindPattern($yourPattern, $byteMask,0x0022FAFF,0x4000000) ;(pattern,mask,initAddr,finalAddr)
MsgBox(0, "", "pattern finded at: " & Hex($Addr, 8))
Func GetModuleInfo($pid)
$str = _WinAPI_GetModuleInformation($pid[1], Null)
Return $str
EndFunc ;==>GetModuleInfo
Func FindPattern($pattern, $mask,$from,$to)
$ModuleData = GetModuleInfo($open)
$lpBase = DllStructGetData($ModuleData,1)
$sizeOfImage = DllStructGetData($ModuleData, 2)
$EntryPoint = DllStructGetData($ModuleData, 3) ;some data sometimes useful don't know :p
Local $Pat = PattArray($pattern)
Local $M = MaskArray($mask)
MsgBox(0,"","LPBASE: " & $lpBase & @CRLF & _
"size: " & $sizeOfImage & @CRLF & _
"Entry point: "& $EntryPoint )
$patternLen = StringLen($mask)
For $i = $from To $to;$sizeOfImage - $patternLen - 1
$found = True
ToolTip("Searching: " & Hex($lpBase + $i, 8), 0, 0)
For $j = 0 To $patternLen - 1
$bool = $M[$j] = "?" Or Hex($Pat[$j], 2) = MemReadHexChar($lpBase + $i + $j) ;our bool expresion, will be 1 if the byte that we are reading is a ? in the mask, or are the same bytes, else is a 0
$found = BitAND($found, $bool) ;we and the values , if all the bytes match then we find our pattern, else we don't
Next
If $found Then Return $lpBase + $i ;founded ? yey
Next
EndFunc ;==>FindPattern
Func PattArray($pattern) ;crap func to make the pattern an array to work with
$split = StringSplit(StringMid($pattern, 2, StringLen($pattern)), "\", 2)
Return $split
EndFunc ;==>PattArray
Func MaskArray($mask) ;crap func to make the mask an array to work with
Local $array[StringLen($mask)]
For $i = 0 To UBound($array) - 1
$array[$i] = StringMid($mask, $i + 1, 1)
Next
Return $array
EndFunc ;==>MaskArray
Func MemReadHexChar($addres) ;crap func to get byte value at memory pos
$byte = Hex(_MemoryRead($addres, $open, "byte"), 2)
Return $byte
EndFunc ;==>MemReadHexChar
Not my own code get some of here
and implement with autoit some adaptions to make it work faster then...
Wonder why that page is blocked here... , replace the 5 with S
why not?, what aob scan method are u using, maybe something bad implemented in the code thought.
If the memory region is non accessible the search should continue anyway...
That method that u use is faster because searchs a lot of memory per step but, when reading non-access memory the method fails and the reading returns 0x000000000000000000000000000000000000000000000000 000000000000000...
U will have to skip non-acess memory, and about the ?? if you want to search for a pattern you need a mask where the ? will replace any value that could change.
For example your memory is:
48 65 6c 6c 6f 20 57 6f 72 6c 64 20 31 30 31 (Hello World 101) and lets say that the word World never changes but the rest does.
Your aob array will be $SearchAoB="48 65 6c 6c 6f 20 57 6f 72 6c 64 20 31 30 31"
and your mask: $mask = "??????xxxxx????"
each ? represents a changing byte and each x represents a static one.