Attack function

12/10/2020 01:11 Hatz~#1
Heya, i've been playing around with the attack function and i've found 2 problems, the first one and most important is that it doesn't matter what skill i pass to the function it always use the basic attack, the other one is that if i pass the skill to the ebx register it cast a basic skill but if i move the character and try to attack again it doesn't work.

Here is my attack function:

Removing the "mov ebx, skill" allows me to cast the basic skill after moving but i can only use the basic skill D: anyone experienced on reversing can help me? :)
12/10/2020 08:45 Pumba98#2
I don't know about the attack function but I learned much about Delphi recently.
Take a look at it's calling convention (register calling convention).
Function arguments are EAX, EDX, ECX, further arguments are pushed on the stack.
If something is moved to ebx that's usually to make sure you don't loose a value when calling a function
12/10/2020 11:03 Hatz~#3
Thanks for the info, so i've figure out that the problem is on the skill parameter, removing the mov esi, skill did not change anything so that means it's actually useless tho, edx and eax are fine. I've tried pushing the skill into the stack before calling the function but didn't work. I've also tryed moving it into ecx but it didnt work, ecx is set to 0 before calling the function