[src][C++] Yet another detour menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    DarthTon's Avatar Contributor
    Reputation
    171
    Join Date
    Apr 2010
    Posts
    108
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [src][C++] Yet another detour

    So i decided to rewrite a bit my detour class using some C++11 stuff.

    And that's what i have for now:
    - Detouring __cdecl, __stdcall, __thiscall functions (__fastcall can be detoured too, but not with generic method)
    - x64 support
    - Free functions and class member functions as hooks (static and non-static)
    - Function splicing and HWBP as detour methods
    - Clean user callbacks


    Things i'm aware of and don't have yet:
    - No check for detours already present in function when using splice
    - HWBP's are applied only to threads that exist at the moment of detour application

    Quick usage example (you can find more in Test file in sources):
    PHP Code:
    #include "DSDetour.h"

    using namespace ds_detour;

    class 
    TestClass1
    {
    public:
        
    TestClass1(): junk(5) { }
        ~
    TestClass1() { }

        
    int TestMsgBoxHWNDa1LPCSTRa2LPCSTRa3UINTa4 )
        {
            
    a2 "NewMessage";
            
    a4 MB_ICONQUESTION;

            return 
    100500;
        }

    private:
        
    int junk;
    };

    int _tmain(int argc_TCHARargv[])
    {
        
    TestClass1 mclass;

        
    CDSDetourint  HWNDLPCSTRLPCSTRUINT ) > detourMsgBox(DetourType::HWBPReturnType::New, CallOrder::BeforeOriginal);

        
    detourMsgBox.DetourFunction(&MessageBoxA, &TestClass1::TestMsgBox, &mclass);

        
    int retval MessageBoxA(0"Test""Caption"MB_ICONEXCLAMATION);

        return 
    0;

    To compile it you need VS2012 + VC CTP Nov 2012 (for variadic templates) . Or you can do lots of tweaks and make it with GCC or Clang

    Repository: https://www.assembla.com/code/darkde...bversion/nodes
    Attached Files Attached Files
    Last edited by DarthTon; 12-10-2012 at 05:25 PM. Reason: x64 support

    [src][C++] Yet another detour
  2. #2
    Kanyle's Avatar Corporal
    Reputation
    9
    Join Date
    Jul 2011
    Posts
    19
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good job. I did something similar using variadic templates, except very simple

Similar Threads

  1. [masm32] YAWR (+src) - Yet another WoW radar
    By KcDan in forum WoW Memory Editing
    Replies: 18
    Last Post: 05-26-2009, 10:06 AM
  2. Yet another hearthstone trick
    By lvlrbojang1es in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 06-19-2006, 02:48 PM
  3. Yet Another Ony Guide
    By Amedis in forum World of Warcraft Guides
    Replies: 0
    Last Post: 06-04-2006, 10:14 AM
All times are GMT -5. The time now is 10:51 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