Patching vs. Detouring menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Patching vs. Detouring

    Hi,

    I was looking at Apoc's code (WhiteMagic) and I am wondering what the hell is patching and what is the difference to detouring? I found this class PatcherManager and it has almost the same methods as DetourManager, these are Apply and Remove and they basically replace some original addresses with your own.

    Code:
    /// <summary>
            /// Removes this Patch from memory. (Reverts the bytes back to their originals.)
            /// </summary>
            /// <returns></returns>
            public bool Remove()
            {
                if (_win32.WriteBytes(_address, _originalBytes) == _originalBytes.Length)
                {
                    IsApplied = false;
                    return true;
                }
                return false;
            }
    
            /// <summary>
            /// Applies this Patch to memory. (Writes new bytes to memory)
            /// </summary>
            /// <returns></returns>
            public bool Apply()
            {
                if (_win32.WriteBytes(_address, _patchBytes) == _patchBytes.Length)
                {
                    IsApplied = true;
                    return true;
                }
                return false;
            }
    http://www.mmowned.com/forums/wow-me...ml#post1680184
    Viano

    Patching vs. Detouring
  2. #2
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Patch is supposed to "patch" any bytes in memory

    Detour is for "redirecting" function calls and calling the original one

  3. #3
    GliderPro's Avatar Member
    Reputation
    -1
    Join Date
    Mar 2009
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A detour uses a patch to redirect functions.

  4. #4
    nitrogrlie's Avatar Member
    Reputation
    11
    Join Date
    Oct 2009
    Posts
    81
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A detour is essentially a patch ( as you write bytes to jmp to your detour in the original function ). The main difference is that usually when you 'patch' you are changing the instructions executed (usually to skip some code path or modify a return value). When you 'detour' you tend to not change the original code directly as you still execute it, you just also do additional work surrounding that functions (aka prologue/epilogue).

  5. #5
    WannaBeProgrammer's Avatar Member
    Reputation
    2
    Join Date
    Feb 2009
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by nitrogrlie View Post
    A detour is essentially a patch ( as you write bytes to jmp to your detour in the original function ). The main difference is that usually when you 'patch' you are changing the instructions executed (usually to skip some code path or modify a return value). When you 'detour' you tend to not change the original code directly as you still execute it, you just also do additional work surrounding that functions (aka prologue/epilogue).
    Just a noobish question, what does prologue/epilogue mean?( I Googled it btw nothing refing to what you talking about)

  6. #6
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You didn't even bother to search what prologue/epilogue mean? Pick up a dictionary. It's not even a technical term...

  7. #7
    nitrogrlie's Avatar Member
    Reputation
    11
    Join Date
    Oct 2009
    Posts
    81
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by WannaBeProgrammer View Post
    Just a noobish question, what does prologue/epilogue mean?( I Googled it btw nothing refing to what you talking about)
    AKA prolog/epilog

    The Rootkit Arsenal: Escape and ... - Google Books

    If your scroll up to page 350, it will show you a graphical representation of what they are...
    Last edited by nitrogrlie; 01-29-2010 at 07:01 AM.

Similar Threads

  1. WoW Nude Patch (Real & Working)
    By Cypher in forum World of Warcraft Exploits
    Replies: 126
    Last Post: 07-06-2007, 12:55 AM
  2. 1.11 Patch - Tonnes of Naxxramas Information!
    By Dwarpy in forum World of Warcraft General
    Replies: 3
    Last Post: 05-21-2006, 11:44 AM
  3. World of Warcraft Naked Patch (Client-Side Only)
    By Matt in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 05-19-2006, 10:33 PM
  4. How to get rid of 1.10 patch?
    By Bossman4 in forum World of Warcraft General
    Replies: 1
    Last Post: 05-02-2006, 01:36 AM
  5. 1.1 Patch!
    By janzi9 in forum World of Warcraft General
    Replies: 2
    Last Post: 03-29-2006, 11:03 PM
All times are GMT -5. The time now is 01:38 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