Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


any idea why this kills maple? C++
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Oct 20, 2008 12:39 am    Post subject: any idea why this kills maple? C++ Reply with quote

Code:
DWORD PMA = (DWORD)GetProcAddress(LoadLibrary(_T("USER32.DLL")), "PostMessageA")+5;
_declspec(naked) BOOL PMX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov    edi, edi
      push   ebp
      mov    ebp, esp
      jmp    dword ptr ds:[PMA]
   }
}

void sendshit(UINT key)
{
   HWND mswin;
   DWORD lParam;

   mswin = FindWindowW(L"MapleStoryClass", NULL);
   lParam = MapVirtualKey(key,0) << 16;
   
   PMX(mswin,WM_KEYDOWN,key,lParam);
   Sleep(50);
   PMX(mswin,WM_KEYUP,key,lParam);
}

sendshit(0x5A);


and maple goes non responsive and the send dont send box comes up, any ideas

_________________
Back to top
View user's profile Send private message
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Mon Oct 20, 2008 1:00 am    Post subject: Reply with quote

Code:
jmp PMA

try that
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Oct 20, 2008 1:07 am    Post subject: Reply with quote

nope, still kills it
_________________
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Mon Oct 20, 2008 2:23 am    Post subject: Reply with quote

the code looks absolutely fine
i guess you're trying to create auto loot
try removing KEYUP message and use only key down an sleep(100) or whatever you need

_________________
Stylo
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Oct 20, 2008 4:48 am    Post subject: Reply with quote

Why are you getting MapleStory's HWND every time you send something?
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Oct 20, 2008 4:57 am    Post subject: Reply with quote

i dont know, havent been bothered to change, either way, it doesnt work
_________________
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Mon Oct 20, 2008 9:04 am    Post subject: Reply with quote

Snootae wrote:
i dont know, havent been bothered to change, either way, it doesnt work

add at start-up
Code:

HWND hMod;
while (!(hMod = FindWindowW(L"MapleStoryClass", NULL))) Sleep(100);

So you won't need to find the HWND everytime you use the function.

About the crashing: No idea looks fine for me, though try to take out the key_down.

_________________
Gone
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Mon Oct 20, 2008 12:15 pm    Post subject: Reply with quote

Code:
mswin = FindWindowW(L"MapleStoryClass", NULL);


Probable cause of crash. Call it once only.
Back to top
View user's profile Send private message MSN Messenger
Spawnfestis
GO Moderator
Reputation: 0

Joined: 02 Nov 2007
Posts: 1746
Location: Pakistan

PostPosted: Mon Oct 20, 2008 1:50 pm    Post subject: Reply with quote

noz3001 wrote:
Code:
mswin = FindWindowW(L"MapleStoryClass", NULL);


Probable cause of crash. Call it once only.

I have actually never understood why people don't take time to look over their code for speed and effectiveness, I do that all the time.
The matter between milliseconds may vary - but see, crashes comes with it. Smile

_________________

CLICK TO HAX MAPLESTORAY ^ !!!!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Oct 20, 2008 2:06 pm    Post subject: Reply with quote

Code:
_declspec(naked) BOOL WINAPI PMX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov    edi, edi
      push   ebp
      mov    ebp, esp
      jmp    dword ptr ds:[PMA]
   }
}


Made a difference once when i was hook hopping another function.
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Oct 20, 2008 6:34 pm    Post subject: Reply with quote

no luck, still an effective kill switch (which i was planning on having)
_________________
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Oct 20, 2008 6:47 pm    Post subject: Reply with quote

Try..

Code:
DWORD _PMA = NULL; //global variable

__declspec(naked) BOOL WINAPI _PostMessageA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    __asm
    {
        mov    edi, edi
        push   ebp
        mov    ebp, esp
        jmp    dword ptr ds:[_PMA]
    }
}


Your function:
Code:

void SendKey(unsigned short vk)
{
 _PostMessageA(FindWindow(_T("MapleStoryClass"),NULL),WM_KEYDOWN,vk,MapVirtualKey(vk,0) << 16);
}



On creation:
Code:

_PMA = (DWORD)GetProcAddress(LoadLibrary(_T("user32.dll")), "PostMessageA") + 5;


Now to send a key such as the loot key..(z):
Code:
SendKey(VkKeyScan('z'));
Smile

Last edited by smartz993 on Tue Oct 21, 2008 2:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Oct 20, 2008 6:52 pm    Post subject: Reply with quote

your a legend spence, it works

+rep

(im also gonna keep the other way, for my kill switch

Edit: one last question, how would you use key likes ctrl and alt

i tried CTRL and {CTRL} but no success

_________________
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Oct 20, 2008 8:31 pm    Post subject: Reply with quote

Snootae wrote:
your a legend spence, it works

+rep

(im also gonna keep the other way, for my kill switch

Edit: one last question, how would you use key likes ctrl and alt

i tried CTRL and {CTRL} but no success


Alt = VK_LMENU
Ctrl = VK_LCONTROL

(Replace the L with an R for the other side, but not necessary)
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Oct 20, 2008 8:54 pm    Post subject: Reply with quote

hey smartz... I am wondering the limitations on VkKeyScan()

Will it work for upercase letters and special characters like !@#?

Or will I have to push the shift key for that?

_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites