Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    gruez's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    1
    lemee get this straight:
    1. i make a jmp to my dll somewhere in a engine function
    2. i do whatever i need to do in my dll
    3. i return to the original function

    is that the correct way to do it?

  2. #17
    cardoow's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    215
    Reputation
    28
    Thanks
    766
    My Mood
    Amazed
    Code:
    typedef void ( * Function_ )();
    pFunction_		pFunction;
    
    void __declspec(naked) nFunction()
    {
    	__asm pushad
    
    	do shit here
    
    	__asm popad
    	__asm jmp[pFunction]
    }
    Code:
    pFunction = (Function_)DetourFunction( (PBYTE)0x123456,(PBYTE)nFunction);

  3. The Following User Says Thank You to cardoow For This Useful Post:

    gruez (11-20-2010)

  4. #18
    gruez's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    1
    what file(s) do i have to #include for the above code to work? i tried #include <detours.h> and <detoured.h> but pFunction isnt showing up as a proper identifier. also, i read about detourfunctionwithtrampoline and detourfunction. where can i find the header files for those functions?

  5. #19
    deoxyribonucleicacid's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    The Great White North
    Posts
    53
    Reputation
    19
    Thanks
    36
    MS Detours - Google it - Download it

  6. #20
    gruez's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by cardoow View Post
    Code:
    typedef void ( * Function_ )();
    pFunction_		pFunction;
    
    void __declspec(naked) nFunction()
    {
    	__asm pushad
    
    	do shit here
    
    	__asm popad
    	__asm jmp[pFunction]
    }
    Code:
    pFunction = (Function_)DetourFunction( (PBYTE)0x123456,(PBYTE)nFunction);
    do i use that with detours 1.5 or 2.1?

    and where do i put the hook? the beginning of a engine function, or the end?
    Last edited by gruez; 11-20-2010 at 08:31 AM.

  7. #21
    cardoow's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    215
    Reputation
    28
    Thanks
    766
    My Mood
    Amazed
    Quote Originally Posted by gruez View Post
    do i use that with detours 1.5 or 2.1?

    and where do i put the hook? the beginning of a engine function, or the end?
    i use 1.5, you can set them anywheren in the function you like but be
    carefull that you dont fuckup the asm, then u will crash... i will recommend
    setting it at the top of a engine function

  8. The Following User Says Thank You to cardoow For This Useful Post:

    gruez (11-20-2010)

  9. #22
    gruez's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    1
    oh silly me, the function type is __cdecl, not __stdcall

    old post:
    ok, using the signatures i found on this forum, i determined the offset of the engine function R_RenderScene is 0x006DF9D0. IDA tells me it accepts 2 args. (int, int)

    so heres the code i have:
    Code:
    #include <windows.h>
    #include <detours.h>
    
    #define ADDRESS 0x006DF9D0
    //0x006DF9D0
    //int __stdcall R_RenderScene(int x)
    
    //Original function
    int (__stdcall *R_RenderScene_o)(int x, int y);
    
    //My function
    int __stdcall R_RenderScene(int x,int y)
    {
    	MessageBox(NULL, L"hooked", L"hooked", MB_OK);
    	return R_RenderScene_o(x,y);
    }
    
    
    int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
    {
        switch(dwReason)
        {
        case DLL_PROCESS_ATTACH:
            R_RenderScene_o = (int (__stdcall *)(int,int))DetourFunction((PBYTE)ADDRESS,(PBYTE)R_RenderScene);
            break;
        case DLL_PROCESS_DETACH:
            DetourRemove((PBYTE)ADDRESS, (PBYTE)R_RenderScene);
            break;
        }
        return true;
    }
    after loading a map, a messagebox shows with the text "hooked", showing the hook is working. but after i click ok, i get this:
    Code:
    Debug Error!
    
    Program: ...gram Files\Activision\Call of Duty - Black Ops\patchOpsMP.exe
    Module: ...documents\visual studio 2010\projects\detour\debug\detour.dll
    File: 
    
    Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
    i tried the code without the messagebox, same problem
    Last edited by gruez; 11-20-2010 at 01:24 PM. Reason: epic fail :(

  10. #23
    tang77's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    27
    My Mood
    Hot

  11. #24
    Themonsterman's Avatar
    Join Date
    Feb 2010
    Gender
    female
    Posts
    332
    Reputation
    17
    Thanks
    273
    My Mood
    Yeehaw
    if your using skidrow version there for no vac ?
    use WPM would be alot easyier ?

    i post full code in the mw2 code section of a old hack the source there could help you do what your doing.

    i never gave much credit to cardoow with my hack but i came out to find what i did wanst much to do with supernova as much as cardoow so for a long due thanks, Thanks cardoow for the finds in mw2

  12. #25
    gruez's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    1
    thanks, all of you, for helping me with this. i finally got it working.

    btw, whats WPM?

  13. #26
    WhiteLionATX's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    21
    I am searching a way to send and execute commands by calling function too. I am a bad C++ coder so I hope someone can post source in here. I still dont know what function is now the right one to call after putting the commands to stack !?
    is it:
    004EFA06 |. E8 95071000 CALL BlackOps.005F01A0
    or
    0044de80
    ???
    I set BP on both and hoped it breakes when executing a command by typing in manual in consol. but it didnt!
    thx for help guys!
    Last edited by WhiteLionATX; 11-20-2010 at 05:16 PM.

  14. #27
    gruez's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    1
    you need to hook an engine function, and call sendcommandtoconsole from there. the entire thread probably has enough info to get you started.

  15. #28
    Themonsterman's Avatar
    Join Date
    Feb 2010
    Gender
    female
    Posts
    332
    Reputation
    17
    Thanks
    273
    My Mood
    Yeehaw
    wpm is write process memory which is easyier to do ( my personal view ) than asm_
    and working template is posted in mw2.

    but its bannable as VAC Scans for changes in memory but if your playing without vac then no worries.

    if you can do asm then do that

  16. The Following 2 Users Say Thank You to Themonsterman For This Useful Post:

    Aqollo (11-22-2010),WhiteLionATX (12-05-2010)

  17. #29
    WhiteLionATX's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    21
    can you give an example how to use with process memory ? I still dont know which offset I should fill (where put the string (offset)/which offset needs to be filled to set send trigger ?)! can you/someone help ?

  18. #30
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    /closed due to bump

    Stop hijacking threads.



Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Help] Sprites are crashing the game
    By joered in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 7
    Last Post: 08-16-2011, 07:10 PM
  2. [Solved] Hacks Crash the game
    By F1r3h4VVk in forum Combat Arms Help
    Replies: 17
    Last Post: 07-28-2011, 12:50 PM
  3. [Help] My code keeps crashing the game
    By johnnydicamillo in forum WarRock Hack Source Code
    Replies: 5
    Last Post: 12-17-2010, 09:53 PM
  4. Crossfire Pub Hack Crashes the game.
    By Kalo2502 in forum CrossFire Hacks & Cheats
    Replies: 3
    Last Post: 08-29-2009, 11:58 AM
  5. pic of the game crashing!
    By Spitfire133 in forum Combat Arms Hacks & Cheats
    Replies: 28
    Last Post: 10-29-2008, 07:17 PM