APICall results in error #132 menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Cromon's Avatar Legendary


    Reputation
    840
    Join Date
    Mar 2008
    Posts
    714
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    APICall results in error #132

    Hello everybody!

    Im creating to inject a DLL into wow. Not much to say, i think i just post the code:
    Code:
    typedef HINSTANCE (__stdcall *fpLoadLibrary)(char*);
    typedef int (__stdcall *fpMsgBox)(HWND, LPCSTR, LPCSTR, UINT);
    
    struct INJECTSTRUCT
    {
          fpLoadLibrary LoadLibrary;
    	  fpMsgBox MsgBox;
          char path[255];
    };
    
    DWORD WINAPI threadstart(LPVOID addr)
    {
    	INJECTSTRUCT* is = (INJECTSTRUCT*)addr;
    	is->MsgBox(0, is->path, is->path, MB_OK);
    	return 0;
    }
    
    int main()
    {
    	HANDLE hProc;
    	LPVOID start;
    	HINSTANCE hDll;
    	INJECTSTRUCT is;
    
    	CMemoryInterface intr;
    	hProc = intr.OpenProcess("Wow.exe");
    	hDll = LoadLibrary("KERNEL32.dll");
    	is.LoadLibrary = (fpLoadLibrary)GetProcAddress(hDll, "LoadLibraryA");
    	strcpy(is.path, "C:\\HookDLL.dll");
    	hDll = LoadLibrary("USER32.dll");
    	is.MsgBox = (fpMsgBox)GetProcAddress(hDll, "MessageBoxA");
    
    	start = VirtualAllocEx(hProc, 0, 0x2000, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    
    	WriteProcessMemory(hProc, start, (LPVOID)&is, sizeof(INJECTSTRUCT), NULL);
    	WriteProcessMemory(hProc, (LPVOID)((DWORD)start + sizeof(INJECTSTRUCT)), threadstart, 0x2000 - sizeof(INJECTSTRUCT), NULL);
    	
    	HANDLE hThread = CreateRemoteThread(hProc, 0, 0, (LPTHREAD_START_ROUTINE)((DWORD)start + sizeof(INJECTSTRUCT)), (LPVOID)start, 0, 0);
    	
    	WaitForSingleObject(hThread, INFINITE);
    	CloseHandle(hProc);
    	printf("Made...\n");
    	getchar();
    	return 0;
    }
    Well, what happens? The messagebox appears and displays C:\HookDLL.dll as intended. When i press "ok" on the box i get the following error:
    Code:
    ERROR #132 (0x85100084) Fatal Exception
    Program:	C:\Users\Public\Games\World of Warcraft\Wow.exe
    Exception:	0x80000003 (BREAKPOINT) at 001B:02AD004F
    Im working on that since houres and i cant get it to work. I guess my problem is that i dont have the correct size of the function. But my problem is that i cant figure it out. I made a function threadend just after the end of threadstart but if i subtract threadstart from threadend i get values like 0xEF32BB43.

    It would be nice if someone can point me to the right direction.

    Greetings
    Cromon

    APICall results in error #132
  2. #2
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Write your dllpath to memory and start a remote thread on LoadLibrary instead of messing around with that attempt
    Hey, it compiles! Ship it!

  3. #3
    Cromon's Avatar Legendary


    Reputation
    840
    Join Date
    Mar 2008
    Posts
    714
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, loading the library now works perfectly, but it would be interesting why the above code fails.

Similar Threads

  1. [please help] error 132# when entering my own server...
    By _DEFiANT in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 09-15-2008, 08:13 PM
  2. error 132 in WOTLK
    By luciferc in forum World of Warcraft General
    Replies: 1
    Last Post: 07-29-2008, 03:37 PM
  3. WoW error 132
    By Happyguy in forum Community Chat
    Replies: 0
    Last Post: 06-26-2008, 04:31 PM
  4. Instance [Error 132]
    By Strupantwn in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 06-09-2008, 05:50 PM
  5. Error 132
    By Tresspass in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 11-19-2007, 04:01 PM
All times are GMT -5. The time now is 02:30 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search