Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2
You last visited: Today at 05:05

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Metin2 SetAttackKeyState

Discussion on Metin2 SetAttackKeyState within the Metin2 forum part of the Popular Games category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2009
Posts: 101
Received Thanks: 167
Metin2 SetAttackKeyState


why when i call this function game crash?
atac1 and atac2 contain the right values
when i set push to 0 game don't crash :/

What i do wrong? (
3t3r4n is offline  
Old 07/31/2014, 23:06   #2
 
[uLow]Beni's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 1,781
Received Thanks: 618
for what does setne stand? I cant see any usage of dl, arguments are normally just pushed, but i dont know what the dl flag/byte does.
Did you make a breakpoint at it?
and when does it crash, it seems you should also push ecx on the stack and pop it after the call atac2.
you could also look at the function it should never set dl but it should use it.
[uLow]Beni is offline  
Old 08/01/2014, 08:52   #3
 
KaMeR1337's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,415
Received Thanks: 5,444
try

Quote:
mov eax, atac1
mov ecx, dword ptr ds:[eax]
push 1
call atac2
KaMeR1337 is offline  
Thanks
1 User
Old 08/01/2014, 11:28   #4
 
[uLow]Beni's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 1,781
Received Thanks: 618
void CPlayer::SetAttackKeyState(bool isPress)
Code:
# add ; at end of line (c is ****)
typedef void(__fastcall *tSetAttackKeyState)(void*, void*, bool)
void* pThis = atac1
tSetAttackKeyState SetAttackKeyState = (tSetAttackKeyState) atac2
SetAttackKeyState(pThis, NULL, true)
Should work

EDIT:
Take a look at this:

it seems the most clear method.


Code:
class IMyShitClass {
     void im_just_a_helper() = 0;
};
void (IMyShitClass::* pAttackKeyState)(bool) = atac2;
auto p = (IMyShitClass*)atac1;
p->*pAttackKeyState(true)
None of my code is tested but should work with right compiler
[uLow]Beni is offline  
Thanks
1 User
Old 08/01/2014, 12:32   #5
 
elite*gold: 0
Join Date: Dec 2009
Posts: 101
Received Thanks: 167
Thanks Kamer and Beni <3
3t3r4n is offline  
Closed Thread




All times are GMT +2. The time now is 05:05.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.