I need help - Reverse ASM Attack Function

03/06/2021 17:24 Celid#1
Hello guys, I'm trying to reverse the attack fn but I've some problems with the skills.

I guess I found the function.
According to the ASM calling convention EAX, EBX and EDX should be the registers for the arguments of the function.

I saw that the client before to call the function moves on the registers the values as the code below:

Code:
mov eax, playerManager
mov ebx, skill
mov edx, mapMonsterObj
call attackFunc
The function works, my character interacts with the monster but I don't understand why the skill parameter is not working and he use always the basic skill.
I'm not sure if I should put the skill somewhere on the stack before to call the function.

Have I found a wrong function?
Can you help me to figure out?

Thank you guys!
03/06/2021 17:34 Hatz~#2
Quote:
Have I found a wrong function?
No, you are on the right function but to make it work you'll have to do one more thing, just keep the good work.

About the calling convention EBX is not used as a parameter, in delphi the parameters go into EAX, EDX, ECX in that order and if there are more arguents they're pushed into the stack (thanks to Pumba for this info :3)
03/06/2021 19:17 Celid#3
Hello Hatz~, yes you are right about the calling convention EAX, EDX, ECX registers are used. I don't know why I remember EAX, EBX, EDX.

Thank you for your reply, I'll continue to work on that function. :)