thanks link, but now i've got another problem, omg.
Code:
char chCooldownInfo[0] = "Cooldown value: %d\n";
void Naked NewCooldown()
{
__asm
{
MOV EAX, [ESP+0x04]
MOV [dwCooldown], EAX
MOV [ECX+0x20], EAX
// trying to push EAX on stack as a variable for chCooldownInfo
// EAX already hold the value so there is no need to copy dwCooldown on stack, right?
PUSH EAX
MOV EAX, OFFSET chCooldownInfo
PUSH EAX
CALL printf
// clean up the stack
POP EBX
POP EBX
// return
RETN 4
}
}
Cleaning the stack by overwriting a 'sensitive' register like ebx (it could still hold some value important to the caller) isn't the best way.
In case of calling a cdecl-function just increment esp by the amount of bytes you have pushed before and are meant as parameters (printf gets 2 dwords as params -> add esp,8).
Either define chCooldownInfo as a global variable and use "offset chCooldownInfo" or define it inside a function to make it exist on the stack as long as the function itself gets executed and use "lea eax,[chCooldownInfo]".
In the latter case chCooldownInfo is just a pseudo-label for sth like ebp-4, therefore its address has to be calculated, in the former chCooldownInfo is an absolute label, means "push offset chCooldownInfo" would be like "push 00400210h"
EDIT:
ah, and as far as I recall you have to call API functions in this manner "call dword ptr [printf]" as no jump-table gets generated and printf is the address of an IAT-entry which holds the function's actual address.
oops.. having a naked function with neither prologue nor epilogue and using local variable doesn't make sense..
The prologue actually adjusts esp and makes room for the local variables, thus declaring the function as naked but trying to access local variables is erroneous, didn't think of it..
this asm code looks strange to me and its even more confusing
maybe this code is erasing some important registers?
maybe I should tell you few words on how this native function works
Code:
006952E9 - 8B 44 24 04 - mov eax,[esp+04]
006952ED - 89 41 20 - mov [ecx+20],eax
006952F0 - C2 0400 - ret 0004
// eax = 1140735489, 1144036829, and so on.
eax contains something like a timestamp+skill charge+cooldown, so game will know how long the cooldown should last.
these values are different from the one I can get by GetTickCount but every time I use skill value is increased by same amount:
current timestamp + (skill charge time + skill cooldown time)
i bot run time error 13 type mimatch 01/17/2011 - Silkroad Online - 2 Replies i use i bot now for 3 days they send me some scripts at temple job cave with the scripts that they do the quest and then it finish it ... i go there it picking up the quest go at the training place it goes ba ck to turn in the quest BUT WHEN IT GOES BA CK AGAIN AT TRAINING PLACE AT THE SPOT I GET THE ERROR MSG ''RUN TIME ERROR 13 TYPE MISMATCH'' can someone pls help me with this i will be very appriciate it
thank you !
[Ribot] Error 13 type mismatch 02/05/2010 - Silkroad Online - 2 Replies If got the 'error 13 type mismatch'. I didn't got it before but I logged in to my char (I normally use clientless) and then I wanted to do clientless again and it gives that error. When I try to use bot + client it says error 6 overflow.
I tried to install the ocx files again and reinstalled the bot. Still doesn't work!
Anybody got the answer for this?
Thanks in advance!
Error Code6 Type 412 11/20/2009 - Cabal Online - 5 Replies i am search and search
Cabal update and now comes
Error Code6 Type 412 wenn iam loging in
i get cabalrider but in the forum nothing for this error
have everybody the same error Code
what can i do
Have you experienced Error Code: 6 Type: 421 ? 06/17/2009 - Cabal Online - 2 Replies Have you experienced Error Code: 6 Type: 421? Any known solutions for this one - whitout having to re-install the game?
Thanks
Different type of error 04/09/2009 - Aion - 4 Replies after installing both the torrent version and the multiple files from the chinese site this is the error i recieve after i click (Y) to install.
http://img19.imageshack.us/img19/5062/75705188.jp g
im useing vista x64 with all drivers updated.
Now i did try the English clients offered in the FAQ thread, and it installs fine. but that's not for the chinese open beta. Can anyone give me a hand here?