Detour, SourceCode in C++ menu

User Tag List

Results 1 to 8 of 8
  1. #1
    ajox86's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detour, SourceCode in C++

    Hi!

    Felt like contributing something so here is my Detour class in C++. It might already exist im not sure, but here is my version and in open-source. Note that its not entirely finished but it does what its supposed to do i guess. Hooking peices of codes that start with 0xE8 will not work. Will fix that later. Anyways, its ugly but my ++ skills are very limited though im a hardcore C-guy. Enjoy.

    Download

    EDIT: New downloadlink

    /* XDetour v0.3 - Executable Code Rerouter, (C)oded by ajo 2009

    With this detour library you can redirect executable code from anyware, to call your custom peice of
    code without interrupting the codeflow. The class has an internal disassembler (XDE by z0mbie) that
    makes you able to reroute codepeices in the middle of nested jumps calls etc. XDetour also has
    highlevel plain C functions to read registers from the pushed stack which makes it easier to write
    higher level code and avoid as much assembly as possible.

    This code is probebly ugly for a C++ person but i wrote it to get myself back to shape while still
    trying to use some C++. Althou I'm a plain C into the bone im trying...

    Feel free to use this code for anything you want aslong as you give credits, enjoy.

    - Use XDETOUR_API as declspec when you write your hook procedures
    - Use XDETOUR_ENTER/XDETOUR_LEAVE for prolog/epilog and no flags/registers will be touched!!
    - Use XDetourGetEAX()..EBX()..etc for reading registers in your callback
    - Use XDetourSetEAX()..EBX()..etc for writing registers in your callback

    [Original]-->[RouteCode]-->[DetourProcedure]-->[RouteCode]-->[Original+5]

    RouteCode Looks like this:
    003B45E8 E8 1D CA 05 00 call HookProc (41100Ah) ;Call our detour
    003B45ED 55 push ebp ;Copied from printf
    003B45EE 8B EC mov ebp,esp ;Copied from printf
    003B45F0 6A FE push 0FFFFFFFEh ;Copied from printf
    003B45F2 E9 FE 9D E7 0F jmp printf+5 (1022E3F5h) ;jump back to hook+CopyLen

    Due to the internal reassembly the following code that is dependent on the flags and
    uses a relative jump can be hook without any problems:-

    00495ED1 8BF0 MOV ESI,EAX
    00495ED3 85F6 TEST ESI,ESI
    00495ED5 74 64 JE SHORT 00495F3B

    ... Which will give a routecode as follows...

    0B632A18 E8 EDF0DEFC CALL 08421B0A ;Hookfunction
    0B632A1D 8BF0 MOV ESI,EAX ;Copied
    0B632A1F 85F6 TEST ESI,ESI ;Copied
    0B632A21 0F84 1435E6F4 JE 00495F3B ;Reassembled
    0B632A27 E9 AB34E6F4 JMP 00495ED7 ;Jump back+6
    */
    Last edited by ajox86; 04-22-2009 at 10:18 AM.

    Detour, SourceCode in C++
  2. #2
    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)
    Thanks for the share!

  3. #3
    Xzibit's Avatar Banned
    Reputation
    22
    Join Date
    Apr 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya thanks! I may use this in the future

  4. #4
    greasemonkey's Avatar Member
    Reputation
    8
    Join Date
    Apr 2009
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XDetour Rapdishare

    hi

    I want to download the file but it has a limit of 10 downloads. May you upload it again?

  5. #5
    ajox86's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by greasemonkey View Post
    hi

    I want to download the file but it has a limit of 10 downloads. May you upload it again?
    Oh i didnt know that. I had some trouble with the builtin attachment so i used rapidshare.

    EDIT: New download link in main post
    Last edited by ajox86; 04-24-2009 at 09:59 AM.

  6. #6
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any chance someone could re-upload?
    https://tanaris4.com

  7. #7
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is this thing superior to microsoft's detour in any case?

  8. #8
    xinjingjing's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    New download link, Requested file is deleted.....

Similar Threads

  1. [C#] Detouring
    By jjaa in forum WoW Memory Editing
    Replies: 5
    Last Post: 03-16-2009, 02:34 PM
  2. Problems with Detours v1.5
    By lanman92 in forum WoW Memory Editing
    Replies: 11
    Last Post: 12-01-2008, 04:29 AM
  3. Nofalldmg Detour causes wow to crash
    By Xarg0 in forum WoW Memory Editing
    Replies: 42
    Last Post: 09-21-2008, 11:18 AM
All times are GMT -5. The time now is 06:51 PM. 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