sanitka wrote: ↑Thu Sep 19, 2024 8:02 pm
Item Finder / Inf. Health / Stamina (Attack sb to fill pointer)
The game makes use of the
AbilitySystemComponent shit with
AttributeSet, so pretty much any player stat is handled by the same system and has a base and current value.
The player himself has 16 different AttributeSet classes, so many many values that are handled by the same game code.
For a more simple player enemy compare check at your injection point of
Inf. Health / Stamina (Attack sb to fill pointer) for
rsi +
0x20 as that points to the player address which you can easily use as compare.
I also see you doing float compares to know if you got the right value, which isn't exactly a good solution.
Instead make again use of the previous mentioned register
rsi which holds the base address of the class.
Now within that class
Health for example is at offset
0x40
(+
0x08 BaseValue | +
0x0C CurrentValue)
And
rcx holds the address of the current stat.
So if the pointer value at
rsi +
0x20 equals the player address and the address at
rsi +
0x40 equals the address held in
rcx then it's your health stat.
As alternative, since you do have a player pointer you could also make use of that for all compares.
From the player class go into the pointer at
0x9B0 and from there into the pointer at
0x10A0 (this is an array of all the player's AttributeSet classes) that points at offset
0x18 to the class that holds the health.
Example script based on your scripts:
Code: Select all
[ENABLE]
aobscanmodule(INJHP,$process,CC F3 0F 11 49 08 C3)
define(INJHP,INJHP+01)
alloc(newmem,$100,INJHP)
label(code)
label(return)
label(null)
label(entity)
newmem:
push r12
push r13
mov r12,PlayerPtr
mov r12,[r12]
test r12,r12
jz null
cmp [rsi+20],r12
jne entity
mov r12,[r12+9B0]
test r12,r12
jz null
mov r12,[r12+10A0]
test r12,r12
jz null
mov r12,[r12+18]
test r12,r12
jz null
cmp r12,rsi
jne null
// rsi holds base of health class here
lea r13,[rsi+40] // offset 40 = Health stat
cmp r13,rcx
jne null
// rcx holds the address of the health stat here
lea r13,[rcx-10] // max health stat is at offset 30, so 0x10 bytes before the health stat address
movss xmm1,[r13+08] // read base value of max health stat
movss [rcx+0C],xmm1 // write max value to current value of health stat
jmp null
entity:
null:
pop r13
pop r12
code:
movss [rcx+08],xmm1
jmp return
INJHP:
jmp newmem
return:
registersymbol(INJHP)
[DISABLE]
INJHP:
db F3 0F 11 49 08
unregistersymbol(*)
dealloc(*)
It's rather simple to adjust this to include stuff to set other values besides the health.
And for the
Item Finder (Enter Current and Max item count, wait for result) script, the player items can be found here.
Go into the pointer at PlayerAddress +
0x9B8 and from there to
0xF8 which is a pointer to the item array.
Each item class has a current quantity, a max quantity and a current level value (the rest is rather useless).
Using that path you can easily write a code to dynamically generate pointers for the items.
What I've made so far:
[Link]