tommy3467 posted on Sep 22, 2017 1:01:45 AM - Report post
Both work! However, the results were unexpected.
mov dword ptr[ecx+18],(float)999
This code appears to change my HP to 999, but it also turns the enemy's HP to 999.
fld dword ptr[ecx+18+4] fstp dword ptr[ecx+18]
This code is amazing. Every time damage is taken the health keeps ticking back up. However, it appears also to heal the enemy as well. The good news is I have been able to locate what I believe is the function that handles health.
i.imgur.com/XHXCxPB.png
Now I need to figure out which one only affects my character and inject the code there. Challenge accepted.
Thanks, 0x09!
STAFF
0x90 posted on Sep 22, 2017 1:28:26 AM - Report post
Then the function is shared. Right click on the opcode where you inject and select Find out what addresses this will show up all addresses that are running through the function. If you only see one and its your health, then attack an enemy and it should also show up his health address.
Then you need to use the structure dissect tool.
Paste both base addresses (health address - offset) and look for differences between player structure and enemy structure. The more enemy structures you have to compare against the player, the more reliable your filter will be.
STAFF
0x90 posted on Sep 22, 2017 1:28:34 AM - Report post
Now the differences can be everything. It can be a boolean/byte like developers have a isPlayer boolean in the structure which would be the easiest for you. But it can also be a string like 'Player'. It can be a pointer that points to another structure which AI doesnt have, or worst there is no difference at all.
Once you found a difference you need to add a compare to your script. Lets say its a boolean and the boolean is located at offset 300. Then you write before the code where you set your health
cmp byte ptr[ecx+300],1 jne code
If its a pointer you use dword instead of byte as pointers takes 4 bytes in 32bit games. But first see if you can find a difference.