If it works, then it's ok, np.
You can also remove:
label(code)
code:
If you want to keep them (
label (code) and
code:), you can add your modified code in
newmem: and this is for coins:
newmem:
mov [rax],(float)9999
movsxd rax,dword ptr [rdi+50]
jmp return
code:
movss [rax],xmm5
movsxd rax,dword ptr [rdi+50]
jmp return
Well you get the idea, now with health, adding
// in front of the code will nop it, you can also add
ret in
newmem: to return , now
// in this case works since the code is only for the main character, it's not shared, if that would have been the case, it just wouldn't work, crash and whatnot might have happened.
In your case,you health can be like this below:
[ENABLE]
{$Lua}
LaunchMonoDataCollector()
{$Asm}
aobscan(Infinite.Health,41 89 47 20 85 FF)
alloc(newmem,$1000,190E3076)
label(code)
label(life)
label(return)
life:
db 0
newmem:
mov [life],eax
test edi,edi
jmp return
code:
mov [r15+20],eax
test edi,edi
jmp return
Infinite.Health:
jmp newmem
nop
return:
registersymbol(Infinite.Health)
[DISABLE]
Infinite.Health:
db 41 89 47 20 85 FF
unregistersymbol(Infinite.Health)
dealloc(newmem)
or
[ENABLE]
{$Lua}
LaunchMonoDataCollector()
{$Asm}
aobscan(Infinite.Health,41 89 47 20 85 FF)
alloc(newmem,$1000,190E3076)
label(return)
newmem:
//mov [life],eax
test edi,edi
jmp return
Infinite.Health:
jmp newmem
nop
return:
registersymbol(Infinite.Health)
[DISABLE]
Infinite.Health:
db 41 89 47 20 85 FF
unregistersymbol(Infinite.Health)
dealloc(newmem)
That
mov [r15+20],eax can also be, only if the address is used by the character only, if it's shared you'll make also enemies invincible:
mov [r15+20],(float)10 = if the value is 10 on float
mov [r15+20],(int)10 = if it's an integer (4 bytes for example), you can add (int)10 if the value is 10 or the value you want to be
mov [r15+20],A = A is 10 in HEX, use win calculator
If you'll encounter this situation , using your code for heath, this is some example for compare, this is as simple as it gets:
[ENABLE]
{$Lua}
LaunchMonoDataCollector()
{$Asm}
aobscan(Infinite.Health,41 89 47 20 85 FF)
alloc(newmem,$1000,190E3076)
label(code)
label(return)
newmem:
cmp [r15+...]...
jne code
jmp return
code:
mov [r15+20],eax
test edi,edi
jmp return
Infinite.Health:
jmp newmem
nop
return:
registersymbol(Infinite.Health)
[DISABLE]
Infinite.Health:
db 41 89 47 20 85 FF
unregistersymbol(Infinite.Health)
dealloc(newmem)
So how to?This one added in
newmem:?
cmp [r15+...]...
jne code
jmp return
I advice to read/watch some tuts regarding compares, doing it the first time and making it working makes you fell really cool.SO let's say you have found the right offset and value, some example might be:
cmp [r15+44]1
jne code
jmp return
Where
44 is the offset and
1 is the value ...only if this was on 4 byte, you can add (float)value in hex for 1, or (int)1, or (double)1 but you need to allocate some newmem: first or split the double , you get the idea
Doing cmp works also if the same code is shared for more, like health, gold, ammo, armor etc you can make multiple cmp ..now let's say you had a code like this, for all i said up:
code:
mov [rax],rcx
jmp return
If you'll modify with # or (float) or (int) will work for the moment or for few seconds, but will freeze other things used by the same code, i'll give you an example, let's say the same code is for ammo, but how to get the ammo ...well remember CMP, in the code you'll add:
label(ammo)
newmem:
cmp [rax+...]...
jne ammo
jmp code
code:
mov [rax],rcx
jmp return
ammo:
mov [rax],3E7
jmp return
3E7 = 999 in HEX, or it can be with (float)999, with #999 or (int)999 , again you need to make a cmp and find the real value of your ammo and cmp with other, this way will always work without problem..now there's multiple ways, but as a start might give some idea to whoever might read this.
You get the idea, in any case this is on unity, so if you know how to export the values, you can find them really fast with dnspy and then find the exact address with CE, since all have their exact offset and value, so you can easily to cmp.
All the best!
Your girl,
V