Quote:
Originally Posted by Smurfin
thanks for the illustration and moveto function :handsdown: I'll try to make an autoit function based on that as well :D turns out the char need to be moved a bit closer because sometimes even though some ground resources are nearby, the function won't pick them, but it's not the function's fault because items detection function also won't list in in arraydisplay even though it's really not too far, it's just the game's behaviour.
about the example, assuming $x=$base=00000004, for $AppBaseAddress=memread($base)+0x1c, then the result would be :
00000010 + 0x1C = 2C , right ?
and for $CharacterDatabase = memread(memread($AppBaseAddress) + 0x20)
the result would be memread(2C+20) = memread(0000004C), and the result would be taken from value column.
hehe tks again for the example, I hope I got it right :p
|
Almost, you got $appBaseAddress = 2C, so then $characterDatabase = memread(memread(2C) + 0x20) = memread(CCCCCCCC + x20) = memread(CCCCCCEC)
example for reading say, your HP:
memread(memread(memread(memread($baseAddress)+0x1C )+0x20)+$hpOffset) would be the HP value of your character for example. SO you'd get to this value by doing it as follows, say $HPOffset = 0x464:
Code:
address value
00000000 00000000
00000004 00000010
00000008 00000000
0000000C 00000000
00000010 00000028
00000014 00000000
00000018 00000000
0000001C 00000000
00000020 AAAAAAAA
00000024 00000000
00000028 BBBBBBBB
0000002C CCCCCCCC
------------------------
CCCCCCEC 87654320
------------------------
57463524 76463768
57463528 00000003
5746352C 00000001
57463530 87654320
------------------------
876546C0 57463524 ;
8765477C 0000005B ;91
87654780 00000030 ;
87654784 000013EC ;5100
87654788 00000546 ;1350
8765478C 0023CACE ;2345678
87654790 0009FBF1 ;654321
87654794 00000000 ;0
87654798 0000012B ;299
$val1 = memread($baseAddress) ;00000010 (no offsets used here)
$val2 = memread($val1 + 0x1C) ;memread(0000002C) = CCCCCCCC
$character_database = memread($val2 + 0x20) ;memread(CCCCCEC) = 87654320
$HP = memread($character_database +0x464) ;memread(87654784) = 5100
As you can see, 4 bytes below in memory the MP would be located (offset 0x468), 8 bytes above it would be your lvl, etcetera. All the values contained in the addresses between 0x87654320 and 0x8765477C would also contain values that are inherent to your character, either actual values, such as your level, or your chi, or addresses to the start of other structures/strings/lists that should be part of your character, such as lists of your equipment, your character name, or your genie. These things have an address instead of a value, because they usually envelop more than 4 bytes and are stored elsewhere in memory.
Take for example your genie, it's an object and thus too big to be stored in just 4 bytes. Instead you will get an address of the start of this object in memory. This address will be stored somewhere in your character_database, say at offset 0x3A0. So in order to get values belonging to your genie, you'd do:
$genie = memread($character_database + 0x3A0) = 0x57463524
now if you'd want the genie type for example you'd do
$geneType = memread($genie + 0x8) = memread(0x5746352C ) = 1
or if you'd want to see the owner of the genie you'd do
$owner = memread($genie + 0xC) = 87654320, which is the address of our character_database again :p