Question about target and attack functions

03/02/2025 20:01 SalvoM#1
Hello there, about six months ago i started my personal project for a bot, i thought i was doing fine until i got to call attack and target functions.
I have just these six months of experience with software developing in c++ and absolutely zero experience or knowledge about assembly but i managed to make it work for others functions like move, movepet and loot, by copy-paste the function found with cheat engine and passing the right value.
Sadly this didn't work for target and attack functions, for the first it work well, but the name shown above is incorrect, i get the name of the last manually-target and if there is none it show just "name".
The attack function does not work at all, or well, it just work at random so at least i know i'm in the right function.
It can not work sometimes, then i restart the system or the game and then it work perfectly.
These are the functions.
Someone more experienced can help me please?
03/03/2025 12:33 JONNST4R#2
you can remove a in Target it does nothing because you overwrite eax later on
03/04/2025 11:10 SalvoM#3
Quote:
Originally Posted by JONNST4R View Post
you can remove a in Target it does nothing because you overwrite eax later on
Hello, thank you for your time.
I think i got around the attack function, at least for the previous five or six times it worked without problems.
I tried to remove "a" but nothing changed. The function work just fine, but that name above just trigger my ocb. I tryed to add a MOV ECX, a or just change a with the name value and address but again nothing changed.
EDIT. Nope, attack function doesn't work.
03/09/2025 13:48 Terraya#4
You can find the triggered function using CE, copy the function address, use xdbg or IDA Pro (IDA Pro preffered), the offset of the function to not have to search it over and over again, using IDA Pro you see the decompiled function in assembly and its paramters.

Usually its pretty easy afterwards to identify what is asked for.
04/07/2025 10:41 SalvoM#5
Quote:
Originally Posted by Terraya View Post
You can find the triggered function using CE, copy the function address, use xdbg or IDA Pro (IDA Pro preffered), the offset of the function to not have to search it over and over again, using IDA Pro you see the decompiled function in assembly and its paramters.

Usually its pretty easy afterwards to identify what is asked for.
Thank you for your answer.
Yes, i know that i can find the function with CE, i already found it, found the memory pattern to find the starting address and it's parameters (target pointer and pointer to unitmanager).
The function work, but after a while (20 to 60 minutes, sometimes more)the game crash with an error about an invalid pointer. I already used debug strings to show Target and UnitManager addresses when the error occur and the addresses are the right ones. Another problem is that whatever the call target, in the monster widget that appears above with monster name, type, and hp, it always show the name of the last manually targeted monster, for example, if i manually target "turtle" and the bot after that target "scheleton" , the hp are that of scheleton, but the name shown is "turtle". If i target nothing before starting the bot, it show "name".
So maybe the problems are related.