Hello. I've been reading a lot about how to find memory address and it's value. I had lot of trouble, cause the address used to change later and I had no any idea about how to go with the base memory and offset.
Happily, there is a very simple solution and it's working for me well.
Apparently, those dynamic addresses, if they crush, they just run on a different version of those addresses and as you collect another addresses, you can place a code, before they are check.
ex.
this when the program starts
$mainwindow="METIN2"
$pid=WinGetProcess($mainwindow)
$iHD=0
if $xy_version = 1 Then
$address_coord_x="0x03872C38"; dynamic address
$address_coord_y="0x03872C3C"; dynamic address
EndIf
if $xy_version = 2 Then
$address_coord_x="0x03872C48"; dynamic address
$address_coord_y="0x03872C4C"; dynamic address
EndIf
$MemArray=_Memoryopen($pid)
$out_x=_MemoryRead($address_coord_x,$MemArray)
$out_y=_MemoryRead($address_coord_y,$MemArray)
and that, when the value is going to be check
if $out_x < 1000 or $out_x > 150000 or $out_y < 1000 or $out_y > 150000 Then
$xy_version = $xy_version + 1
if $xy_version > 2 Then
$xy_version = 1
EndIf
EndIf
$mainwindow="METIN2"
$pid=WinGetProcess($mainwindow)
$iHD=0
if $xy_version = 1 Then
$address_coord_x="0x03872C38"; dynamic address
$address_coord_y="0x03872C3C"; dynamic address
EndIf
if $xy_version = 2 Then
$address_coord_x="0x03872C48"; dynamic address
$address_coord_y="0x03872C4C"; dynamic address
EndIf
$MemArray=_Memoryopen($pid)
$out_x=_MemoryRead($address_coord_x,$MemArray)
$out_y=_MemoryRead($address_coord_y,$MemArray)
So as opportunate a crush, the program is going to check the criteria, for the value and if they are wrong, go with another version of those values. And it works without bunch of stuff necessary to find the base memory and offset.