- Код: Выделить всё
__asm call 004e6260h
is an invalid instruction, because ASM blocks are "written as they are", whereas this type of expression would require calculating offsets and whatnot, so it is not allowed. Actual reasoning and explanation might be provided by someone more knowledgeable!
There are two standard ways to do this:
1* use a global /static variable to store the address
- Код: Выделить всё
static int my_addr = 0x4e6260
__asm CALL my_addr
2* use a register (EAX) for the call
- Код: Выделить всё
MOV EAX, 0x4e6260
CALL EAX
#2 is what you get when you use the CALL_X macros.
Alternatively, there's nothing stopping you from adding a member function to _Hero_ that makes this call automatically, simply grab the _Hero_ from ebp+0x14, and test that it exists (if (hero)).
- Код: Выделить всё
int __thiscall HeroSpellSpecialityEffect(_Hero_ *this, int spell, int heroLevel, signed int effect)
Finally, I'm far from certain but this line might not work either:
- Код: Выделить всё
jz 00444d5ch
It's been a while since I've written code in plain assembly, I've gotten rusty (: