SHOW:
|
|
- or go back to the newest paste.
1 | - | www.GamerSoul.com |
1 | + | |
2 | - | By Goon Life of www.GamerSoul.com |
2 | + | By Goon Life |
3 | //Form1 shits | |
4 | ||
5 | #pragma region Auto Loot | |
6 | ||
7 | bool EnableLooting = false; | |
8 | ||
9 | void StartLoot() | |
10 | { | |
11 | while(EnableLooting) | |
12 | { | |
13 | HWND MShwnd = FindWindowA("MapleStoryClass", NULL); | |
14 | PostMessage(MShwnd, WM_KEYDOWN, 0x60, MapVirtualKeyA(0x60, 0) << 16); | |
15 | Sleep(100); | |
16 | } | |
17 | } | |
18 | ||
19 | #pragma endregion | |
20 | ||
21 | bool LeftWall(int X) | |
22 | { | |
23 | return ((int)ReadPointer(WallBase, LeftWallOffset) <= X); | |
24 | } | |
25 | ||
26 | bool TopWall(int Y) | |
27 | { | |
28 | return ((int)ReadPointer(WallBase, LeftWallOffset + 4) <= Y); | |
29 | } | |
30 | ||
31 | bool RightWall(int X) | |
32 | { | |
33 | return ((int)ReadPointer(WallBase, LeftWallOffset + 8) >= X); | |
34 | } | |
35 | ||
36 | bool BottomWall(int Y) | |
37 | { | |
38 | return ((int)ReadPointer(WallBase, LeftWallOffset + 12) >= Y); | |
39 | } | |
40 | ||
41 | void Teleport(int X,int Y) | |
42 | { | |
43 | if(LeftWall(X) && RightWall(X) && TopWall(Y) && BottomWall(Y)) | |
44 | { | |
45 | *(DWORD*)(*(DWORD*)CharBase + TeleportOffset + 8) = X; | |
46 | *(DWORD*)(*(DWORD*)CharBase + TeleportOffset + 12) = Y; | |
47 | *(DWORD*)(*(DWORD*)CharBase + TeleportOffset) = 1; | |
48 | } | |
49 | } | |
50 | ||
51 | ||
52 | long int ItemX = 0, | |
53 | ItemY = 0; | |
54 | ||
55 | void __declspec(naked) _stdcall ItemHookAsm() | |
56 | { | |
57 | __asm | |
58 | { | |
59 | cmp dword ptr [esp],ItemHookCMPAddy | |
60 | jne NormalAPICall | |
61 | push eax | |
62 | mov eax,[esp+0x0C] | |
63 | mov [ItemX],eax | |
64 | mov eax,[esp+0x10] | |
65 | mov [ItemY],eax | |
66 | pop eax | |
67 | ||
68 | NormalAPICall: | |
69 | jmp dword ptr PtInRect | |
70 | } | |
71 | } | |
72 | ||
73 | int LootWhen; | |
74 | HANDLE hKamiLoot; | |
75 | void KamiLoot() | |
76 | { | |
77 | for(;; Sleep(333)) | |
78 | { | |
79 | if (ReadPointer(ItemBase, ItemCountOffset) > LootWhen) | |
80 | { | |
81 | for(unsigned char uc = 0; | |
82 | uc <= 40 && ReadPointer(ItemBase, ItemCountOffset); | |
83 | uc++, Sleep(500)) | |
84 | { | |
85 | Teleport(ItemX,ItemY); | |
86 | } | |
87 | continue; | |
88 | } | |
89 | } | |
90 | } | |
91 | ||
92 | void Form1::checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) | |
93 | { | |
94 | if(checkBox1->Checked) | |
95 | { | |
96 | *(unsigned long*) PtInRectAddy = (unsigned long)ItemHookAsm; | |
97 | LootWhen = Convert::ToInt32(this->textBox1->Text); | |
98 | this->textBox1->Enabled = false; | |
99 | OpenThread(hKamiLoot,KamiLoot); | |
100 | CreateThread(NULL, 0, (::LPTHREAD_START_ROUTINE)&StartLoot, NULL, 0, NULL); | |
101 | EnableLooting = true; | |
102 | } | |
103 | else | |
104 | { | |
105 | *(unsigned long*) PtInRectAddy = (unsigned long)PtInRect; | |
106 | this->textBox1->Enabled = true; | |
107 | CloseThread(hKamiLoot); | |
108 | EnableLooting = false; | |
109 | } | |
110 | } | |
111 | ||
112 | // Functions | |
113 | #define OpenThread(Handle, void) Handle = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&void, NULL, NULL, NULL); | |
114 | #define CloseThread(Handle) TerminateThread(Handle, 0); | |
115 | ULONG_PTR ReadPointer(DWORD Address, INT nOffset) | |
116 | { | |
117 | ULONG_PTR* ulBase = (ULONG_PTR *)Address; | |
118 | if ( !IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)) ) | |
119 | if ( !IsBadReadPtr((VOID*)((*(ULONG_PTR*)ulBase)+nOffset), sizeof(ULONG_PTR)) ) | |
120 | return *(ULONG_PTR*)((*(ULONG_PTR*)ulBase)+nOffset); | |
121 | return 0; | |
122 | } | |
123 | ||
124 | /* Addresses */ | |
125 | #define ItemHookCMPAddy 0x00553F0C | |
126 | #define PtInRectAddy 0x01007994 | |
127 | ||
128 | /* Pointers & Offsets*/ | |
129 | #define CharBase 0x00FFA564 | |
130 | #define TeleportOffset 0x5318 | |
131 | ||
132 | #define WallBase 0x00FFECF0 | |
133 | #define LeftWallOffset 0x001C | |
134 | ||
135 | #define ItemBase 0x010024A0 | |
136 | #define ItemCountOffset 0x0014 |