DirectX/CEGUI hooking? menu

Shout-Out

User Tag List

Page 5 of 5 FirstFirst 12345
Results 61 to 75 of 75
  1. #61
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Thank you so much shynd. This is just what I needed, some spoon feeding :P

    The reason i needed help was there's not very much documentation on this library.

    Its pretty easy to work out if you look at the header files. And theres heaps of information if you just google it.

    DirectX/CEGUI hooking?
  2. #62
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What method do i have to use to inject a dll in to a running WoW window? It looks like the WPM+LoadLibrary() is hooked... so i need help. I've tried using the setwindowshookex() method, but it doesnt seem to work.

  3. #63
    galpha's Avatar Member
    Reputation
    5
    Join Date
    Nov 2007
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    What method do i have to use to inject a dll in to a running WoW window? It looks like the WPM+LoadLibrary() is hooked... so i need help. I've tried using the setwindowshookex() method, but it doesnt seem to work.
    Lanman, I think people did give you great hints on how to get started, but after seing this reply, I don't think you have the knowledge to do this kind of work. I'm not flamming you or anything, just that it takes a lot of coding experience before humping straight into dll injection.

    However, if I'm mistaken, please forget about my comment. Either way, here's 3 methods for doing it:

    Dll Injection
    Last edited by galpha; 09-16-2008 at 08:52 PM.

  4. #64
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have read that many times... I have the knowledge, just curious if there was a way to do it in an easier manner. I guess I'll just use the codecave method.

  5. #65
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a source code version of Forcelib (thank you Google Code for caching this <3) preconfigured for VS2008 and modified to work as a static library.

    http://dl-client.getdropbox.com/u/74..._Preconfig.zip

    From one of my internal projects, should hopefully work for you but if I left out a dependency let me know and I'll upload it or modify the original project.

    Just #include the header(s) you need and add add the lib to your link list.

  6. #66
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What?!?! Forcelib has a funtion that works on WoW? Ugh, I'm retarded. Time to go through that beautiful header file and find these amazing functions...

  7. #67
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    What?!?! Forcelib has a funtion that works on WoW? Ugh, I'm retarded. Time to go through that beautiful header file and find these amazing functions...
    Huh? It can inject a DLL into pretty much any process.

    Some code for you:
    Code:
        // Try and create the process from the current directory
        if (!CreateProcess(NULL,const_cast<char*>(WoWCurrentDir.c_str()),NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,&WoWSi,&WoWPi))
        {
            // Try and create the process from the install directory
            if (!CreateProcess(NULL,const_cast<char*>(WoWPath.c_str()),NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,&WoWSi,&WoWPi))
            {
                // Process creation failed, notify the user and return
                SendMessage(hStatusText,WM_SETTEXT,0,reinterpret_cast<LPARAM>(TEXT("Process creation failed!")));
                return;
            }
        }
    
        // Setup Forcelib for use
        InitForceLib();
    
        // Attempt injection
        if (!ForceLibrary(_tfullpath(NULL, DllName.c_str(), MAX_PATH),&WoWPi))
        {
            // Injection failed so notify the user and terminate the process
            SendMessage(hStatusText,WM_SETTEXT,0,reinterpret_cast<LPARAM>(TEXT("Injection failed!")));
            TerminateProcess(WoWPi.hProcess,0);
            return;
        }
    Also, you don't want to do what I'm doing and const_cast a string. You're better off using a char* that you manually allocated. The only reason I'm const_casting it is because I know that for the particular character set I'm compiling with CreateProcess doesn't modify the char* it's passed, although on Unicode I think it does. So yea, don't do what I'm doing, I just got lazy when I was testing. Speaking of which I'll fix that now.

    EDIT: Forgot to mention originally, because ForceLib was originally designed as a DLL and it had its initialization in DLL_PROCESS_ATTACH I had to move that into its own function which you MUST CALL BEFORE USING ANY OTHER FUNCTIONS. Do what I did in the snippet above and be sure to call that before using ForceLib for the first time (you only need to call it once, from that point on it's fine, although it will work if you recall it without any adverse effect - or at least it should).

    EDIT2: Forgot the accompanying else for the injection.
    Code:
        else
        {
            // Injection succeeded (hopefully)! Resume WoW's primary thread and notify the user 
            ResumeThread(WoWPi.hThread);
            SendMessage(hStatusText,WM_SETTEXT,0,reinterpret_cast<LPARAM>(TEXT("Injection succeeded!")));
    
            // Clean up the handles we used
            CloseHandle(WoWPi.hProcess);
            CloseHandle(WoWPi.hThread);
        }
    Last edited by Cypher; 09-17-2008 at 03:39 AM.

  8. #68
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can ForceLib inject into a running WoW though? I've never been able to, and the method that is left is a pain in the ass. I mean inject into a non-suspended window.

    EDIT: Heh, why not mod the ForceLib.cpp file to automatically call Init....() when you try to inject?
    Last edited by lanman92; 09-17-2008 at 07:08 AM.

  9. #69
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I inject a LoadLibary Struct into some allocated memory of WoW with all the data it needs to load my dll, then I just create a Remote Thread starting at the BaseAdress of the allocated memory, It works pretty good with WoW I'm injecting my nofalldmg patch dll at runtime, I'm even able to register my own console functions by patching the IsFunctionPointerInRange function (just 2bytes), You don't need to start WoW with your Launcher unless you want to install certain D3DHooks that need WoW to load a Wrapper D3D9.dll or some other stuff that needs to be done before WoW starts.
    I hacked 127.0.0.1

  10. #70
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you just write your string to a new section, CreateRemoteThread on load library, with the parameter of your allocated string? Simpler imo.

  11. #71
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never been able to inject a DLL using the standard WPM, Createremotethread() method. I guess I'm doing something wrong, time to write a new injector and make sure everything is correct.

  12. #72
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The following was written, from memory, in this browser, so I apologize for errors. Also, please add some sort of error-checking, if you're going to employ this method.

    Code:
    DWORD InjectDll(DWORD dwProcessId, char *szDllPath)
    {
    	HANDLE hProcess, hThread;
    	LPVOID lpLoadLibraryA, lpDllPath;
    	DWORD dwBaseAddress;
    	
    	//open process for read/write
    	hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcessId);
    	
    	//allocate memory to which we'll write the full path to our dll
    	lpDllPath = VirtualAllocEx(hProcess, NULL, 0x1000, MEM_COMMIT, PAGE_READWRITE);
    	
    	//write the dll path to memory
    	WriteProcessMemory(hProcess, lpDllPath, szDllPath, strlen(szDllPath), NULL);
    	
    	//find out the address of LoadLibraryA in our context, knowing that it is mapped into the same address in all processes
    	lpLoadLibraryA = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
    	
    	//create a thread on the LoadLibraryA, passing the dll path we wrote to memory as the parameter
    	hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)lpLoadLibraryA, lpDllPath, NULL, 0);
    	
    	//wait for the remote thread to exit
    	WaitForSingleObject(hThread, INFINITE);
    	//the exit code will be the return value of LoadLibraryA, or the base address of the dll that was injected
    	//we use this base address to uninject the dll, if we ever want to
    	GetExitCodeThread(hThread, &dwBaseAddress);
    	
    	//clean up the mess we've made
    	CloseHandle(hThread);
    	CloseHandle(hProcess);
    	
    	//return the base address to whomever needs it
    	return dwBaseAddress;
    }

  13. #73
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought WoW hooked VirtualAllocEx() and CreateRemoteThread() or something...?

  14. #74
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh.. WoW hooks nothing.

  15. #75
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Can ForceLib inject into a running WoW though? I've never been able to, and the method that is left is a pain in the ass. I mean inject into a non-suspended window.

    EDIT: Heh, why not mod the ForceLib.cpp file to automatically call Init....() when you try to inject?
    Yes yes and for the last time yes. >_>

    Stop asking the same damn question.

    And re: your edit. Because I'm lazy and it really doesn't bother me.

    Originally Posted by lanman92 View Post
    I thought WoW hooked VirtualAllocEx() and CreateRemoteThread() or something...?

    Lolno.


    Originally Posted by kynox View Post
    Uh.. WoW hooks nothing.
    Made me lol, dunno why.

Page 5 of 5 FirstFirst 12345

Similar Threads

  1. Problem with DirectX CreateDevice Hooking
    By rik.chong in forum WoW Memory Editing
    Replies: 4
    Last Post: 11-30-2012, 04:50 AM
  2. Diablo III Directx 9 ES, DIP, SSS Hook -- By Bit_Hacker
    By BitHacker in forum Diablo 3 Memory Editing
    Replies: 30
    Last Post: 06-19-2012, 09:30 AM
  3. CEGUI - EndScene Hook - DLL Function Call
    By Orix in forum WoW Memory Editing
    Replies: 5
    Last Post: 02-12-2011, 03:51 PM
  4. Hooking DirectX CreateDevice
    By nitrogrlie in forum WoW Memory Editing
    Replies: 13
    Last Post: 01-22-2010, 02:46 PM
  5. Hook a brother up..
    By HaSh in forum World of Warcraft General
    Replies: 0
    Last Post: 01-21-2007, 03:36 PM
All times are GMT -5. The time now is 11:47 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