| View previous topic :: View next topic |
| Author |
Message |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Oct 20, 2008 12:39 am Post subject: any idea why this kills maple? C++ |
|
|
| 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 |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Mon Oct 20, 2008 1:00 am Post subject: |
|
|
try that
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Oct 20, 2008 1:07 am Post subject: |
|
|
nope, still kills it
_________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Oct 20, 2008 2:23 am Post subject: |
|
|
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 |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Mon Oct 20, 2008 4:48 am Post subject: |
|
|
| Why are you getting MapleStory's HWND every time you send something?
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Oct 20, 2008 4:57 am Post subject: |
|
|
i dont know, havent been bothered to change, either way, it doesnt work
_________________
|
|
| Back to top |
|
 |
GMZorita Grandmaster Cheater Supreme
Reputation: 0
Joined: 21 Mar 2007 Posts: 1361
|
Posted: Mon Oct 20, 2008 9:04 am Post subject: |
|
|
| 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 |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Oct 20, 2008 12:15 pm Post subject: |
|
|
| Code: | | mswin = FindWindowW(L"MapleStoryClass", NULL); |
Probable cause of crash. Call it once only.
|
|
| Back to top |
|
 |
Spawnfestis GO Moderator
Reputation: 0
Joined: 02 Nov 2007 Posts: 1746 Location: Pakistan
|
Posted: Mon Oct 20, 2008 1:50 pm Post subject: |
|
|
| 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.
_________________
CLICK TO HAX MAPLESTORAY ^ !!!! |
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Mon Oct 20, 2008 2:06 pm Post subject: |
|
|
| 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 |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Oct 20, 2008 6:34 pm Post subject: |
|
|
no luck, still an effective kill switch (which i was planning on having)
_________________
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Mon Oct 20, 2008 6:47 pm Post subject: |
|
|
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')); |
Last edited by smartz993 on Tue Oct 21, 2008 2:22 pm; edited 1 time in total |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Oct 20, 2008 6:52 pm Post subject: |
|
|
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 |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Mon Oct 20, 2008 8:31 pm Post subject: |
|
|
| 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 |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Mon Oct 20, 2008 8:54 pm Post subject: |
|
|
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 |
|
 |
|