Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- By Goon Life
- //Form1 shits
- #pragma region Auto Loot
- bool EnableLooting = false;
- void StartLoot()
- {
- while(EnableLooting)
- {
- HWND MShwnd = FindWindowA("MapleStoryClass", NULL);
- PostMessage(MShwnd, WM_KEYDOWN, 0x60, MapVirtualKeyA(0x60, 0) << 16);
- Sleep(100);
- }
- }
- #pragma endregion
- bool LeftWall(int X)
- {
- return ((int)ReadPointer(WallBase, LeftWallOffset) <= X);
- }
- bool TopWall(int Y)
- {
- return ((int)ReadPointer(WallBase, LeftWallOffset + 4) <= Y);
- }
- bool RightWall(int X)
- {
- return ((int)ReadPointer(WallBase, LeftWallOffset + 8) >= X);
- }
- bool BottomWall(int Y)
- {
- return ((int)ReadPointer(WallBase, LeftWallOffset + 12) >= Y);
- }
- void Teleport(int X,int Y)
- {
- if(LeftWall(X) && RightWall(X) && TopWall(Y) && BottomWall(Y))
- {
- *(DWORD*)(*(DWORD*)CharBase + TeleportOffset + 8) = X;
- *(DWORD*)(*(DWORD*)CharBase + TeleportOffset + 12) = Y;
- *(DWORD*)(*(DWORD*)CharBase + TeleportOffset) = 1;
- }
- }
- long int ItemX = 0,
- ItemY = 0;
- void __declspec(naked) _stdcall ItemHookAsm()
- {
- __asm
- {
- cmp dword ptr [esp],ItemHookCMPAddy
- jne NormalAPICall
- push eax
- mov eax,[esp+0x0C]
- mov [ItemX],eax
- mov eax,[esp+0x10]
- mov [ItemY],eax
- pop eax
- NormalAPICall:
- jmp dword ptr PtInRect
- }
- }
- int LootWhen;
- HANDLE hKamiLoot;
- void KamiLoot()
- {
- for(;; Sleep(333))
- {
- if (ReadPointer(ItemBase, ItemCountOffset) > LootWhen)
- {
- for(unsigned char uc = 0;
- uc <= 40 && ReadPointer(ItemBase, ItemCountOffset);
- uc++, Sleep(500))
- {
- Teleport(ItemX,ItemY);
- }
- continue;
- }
- }
- }
- void Form1::checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e)
- {
- if(checkBox1->Checked)
- {
- *(unsigned long*) PtInRectAddy = (unsigned long)ItemHookAsm;
- LootWhen = Convert::ToInt32(this->textBox1->Text);
- this->textBox1->Enabled = false;
- OpenThread(hKamiLoot,KamiLoot);
- CreateThread(NULL, 0, (::LPTHREAD_START_ROUTINE)&StartLoot, NULL, 0, NULL);
- EnableLooting = true;
- }
- else
- {
- *(unsigned long*) PtInRectAddy = (unsigned long)PtInRect;
- this->textBox1->Enabled = true;
- CloseThread(hKamiLoot);
- EnableLooting = false;
- }
- }
- // Functions
- #define OpenThread(Handle, void) Handle = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&void, NULL, NULL, NULL);
- #define CloseThread(Handle) TerminateThread(Handle, 0);
- ULONG_PTR ReadPointer(DWORD Address, INT nOffset)
- {
- ULONG_PTR* ulBase = (ULONG_PTR *)Address;
- if ( !IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)) )
- if ( !IsBadReadPtr((VOID*)((*(ULONG_PTR*)ulBase)+nOffset), sizeof(ULONG_PTR)) )
- return *(ULONG_PTR*)((*(ULONG_PTR*)ulBase)+nOffset);
- return 0;
- }
- /* Addresses */
- #define ItemHookCMPAddy 0x00553F0C
- #define PtInRectAddy 0x01007994
- /* Pointers & Offsets*/
- #define CharBase 0x00FFA564
- #define TeleportOffset 0x5318
- #define WallBase 0x00FFECF0
- #define LeftWallOffset 0x001C
- #define ItemBase 0x010024A0
- #define ItemCountOffset 0x0014
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement