Thread: detour

Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Hybrid View

  1. #1
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1

    detour

    can anyone teach me how to make a detour or have a detour i can use?

  2. #2
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    Take a look in this section : Combat Arms BR Hack Coding/Source Code

    Have a lot of detours posted
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  3. #3
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    im getting so many errors... it says the arguments for getModuleHandle has to be lpcwstr but we r inputing a const char...

    if( GetModuleHandle( "Kernel32.dll" ) != NULL
    && GetModuleHandle( "d3d9.dll" ) != NULL
    && GetModuleHandle( "Engine.exe" ) != NULL
    && GetModuleHandle( "CShell.dll" ) != NULL
    && GetModuleHandle( "Clientfx.fxd" ) != NULL )

    i get error at all the underlined... im getting like 30 errors idk what to do

    - - - Updated - - -

    hey can you take a look at the code you sent me? i dont know how to fix the errors...
    Last edited by brohizi; 03-07-2015 at 08:44 AM.

  4. #4
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    Quote Originally Posted by brohizi View Post
    im getting so many errors... it says the arguments for getModuleHandle has to be lpcwstr but we r inputing a const char...

    if( GetModuleHandle( "Kernel32.dll" ) != NULL
    && GetModuleHandle( "d3d9.dll" ) != NULL
    && GetModuleHandle( "Engine.exe" ) != NULL
    && GetModuleHandle( "CShell.dll" ) != NULL
    && GetModuleHandle( "Clientfx.fxd" ) != NULL )

    i get error at all the underlined... im getting like 30 errors idk what to do

    - - - Updated - - -

    hey can you take a look at the code you sent me? i dont know how to fix the errors...
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  5. #5
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    wow thank you

    - - - Updated - - -

    i still need to find a detour... i couldnt find one that wouldnt give me errors

    - - - Updated - - -

    tpresent becomes unidentified when i put a different detour in...

  6. #6
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    Quote Originally Posted by brohizi View Post
    wow thank you

    - - - Updated - - -

    i still need to find a detour... i couldnt find one that wouldnt give me errors

    - - - Updated - - -

    tpresent becomes unidentified when i put a different detour in...
    You are making something wrong, the detours posted don´t have errors
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  7. #7
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    LPVOID DetourCreate(BYTE *src, CONST BYTE *dst, CONST INT len)
    {
    BYTE *jmp = (BYTE*)malloc(len + 5);
    DWORD dwBack;
    VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
    memcpy(jmp, src, len);
    jmp += len;
    jmp[0] = '\xE9';
    *(DWORD*)(jmp + 1) = (DWORD)(src + len - jmp) - 5;

    src[0] = '\x90';
    src[1] = '\xD1';
    src[2] = '\xC8';
    src[3] = '\x85';
    src[4] = '\xC0';
    src[5] = '\xE9';

    *(DWORD*)(&src[6]) = (DWORD)(dst - src) - 10;
    for (INT i = 10; i < len; i++) src[i] = 0x90;
    VirtualProtect(src, len, dwBack, &dwBack);

    return (jmp - len);
    }

    LPVOID DetourCreate(BYTE *src, CONST BYTE *dst, CONST INT len)
    {
    BYTE *jmp = (BYTE*)malloc(len + 5);
    DWORD dwBack;
    VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
    memcpy(jmp, src, len);
    jmp += len;
    jmp[0] = '\xE9';
    *(DWORD*)(jmp + 1) = (DWORD)(src + len - jmp) - 5;

    src[0] = '\xD1';
    src[1] = '\xC8';
    src[2] = '\x85';
    src[3] = '\xC0';
    src[4] = '\x90';
    src[5] = '\xE9';

    *(DWORD*)(&src[6]) = (DWORD)(dst - src) - 10;
    for (INT i = 10; i < len; i++) src[i] = 0x90;
    VirtualProtect(src, len, dwBack, &dwBack);

    return (jmp - len);
    }

    LPVOID DetourCreate(BYTE *src, CONST BYTE *dst, CONST INT len)
    {
    BYTE *jmp = (BYTE*)malloc(len + 5);
    DWORD dwBack;
    VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
    memcpy(jmp, src, len);
    jmp += len;
    jmp[0] = '\xE9';
    *(DWORD*)(jmp + 1) = (DWORD)(src + len - jmp) - 5;

    src[0] = '\xD1';
    src[1] = '\xC8';
    src[2] = '\x90';
    src[3] = '\x85';
    src[4] = '\xC0';
    src[5] = '\xE9';

    *(DWORD*)(&src[6]) = (DWORD)(dst - src) - 10;
    for (INT i = 10; i < len; i++) src[i] = 0x90;
    VirtualProtect(src, len, dwBack, &dwBack);

    return (jmp - len);
    }


    this is the detour im using... i get errors... i just paste this in to the detour.h and build it but then it gives me errors about tpresent in main.cpp...
    the only error i get in detour.h is: function 'LPVOID DetourCreate(BYTE *,const BYTE *,const INT)' already has a body line 30

  8. #8
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    You already have a detours with name DetourCreate
    Just rename do DetourCreate2, DetourCreate3..
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  9. #9
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    more errors!!

    term does not evaluate to a function taking 5 arguments line 100
    syntax error : missing ';' before identifier 'DetourCreate' line 105
    syntax error : missing ';' before identifier 'oPresent' line 12
    'DeviceIndex': identifier not found 105
    missing type specifier - int assumed. Note: C++ does not support default-int line 12
    expected a ';' 105
    identifier "tPresent" is undefined line 12
    identifier "tPresent" is undefined line 105

    code:

    #include "others.h"
    #include "detours.h"

    int names, cross, caixa, distance, kill;

    bool nxchams, menu = true;

    tPresent oPresent;

    VOID MEMCPY( LPVOID ADDR, LPVOID byte, INT size )
    {
    DWORD dwBack;
    VirtualProtect( ( LPVOID )ADDR, size, PAGE_EXECUTE_READWRITE, &dwBack );
    memcpy( ( LPVOID )ADDR, byte, size );
    VirtualProtect( ( LPVOID )ADDR, size, dwBack, &dwBack );
    }

    VOID StartFont( LPDIRECT3DDEVICE9 pDevice )
    {
    if( Font )
    {
    Font->Release();
    Font = NULL;
    }

    if( !Font )
    {
    D3DXCreateFont( pDevice,
    14,
    0,
    FW_BOLD,
    1,
    0,
    DEFAULT_CHARSET,
    OUT_DEFAULT_PRECIS,
    DEFAULT_QUALITY,
    DEFAULT_PITCH | FF_DONTCARE,
    "Arial",
    &Font );
    }
    }

    void Funcs(LPDIRECT3DDEVICE9 pDevice)
    {
    AddKey (VK_F5, names);
    AddKey (VK_F6, caixa);
    AddKey (VK_F7, distance);
    AddKey (VK_F8, cross);
    AddKey (VK_F9, kill);

    TeleKillFull(kill, pDevice);

    Esp(caixa, distance, names, pDevice);

    if (cross)
    {
    D3DVIEWPORT9 Viewport;
    pDevice->GetViewport(&Viewport);
    DrawBox(Viewport.Width / 2 - 23, Viewport.Height / 2, 50, 5, TBlack,TBlack, pDevice);
    DrawBox(Viewport.Width / 2, (Viewport.Height / 2) - 23, 5, 50,TBlack,TBlack, pDevice);
    }
    }

    void Menu(LPDIRECT3DDEVICE9 pDevice)
    {

    Funcs(pDevice);

    if (GetAsyncKeyState(VK_INSERT)&1)
    menu =! menu;

    if ( menu )
    {
    DrawBox(PosX,PosY - 5,105,20,TBlack,Red,pDevice); // title
    WriteText( pDevice, PosX + 14, PosY, Red, "Coder.Fail v0.1");

    DrawBox(PosX,PosY + 20,105,115,TBlack,Red,pDevice); // menu

    AddItem("Box", caixa, 0, pDevice);
    AddItem("Distance", distance, 15, pDevice);
    AddItem("Names", names, 30, pDevice);
    AddItem("CrossHair", cross, 45, pDevice);
    AddItem("TeleKill", kill, 60, pDevice);
    }
    }

    HRESULT WINAPI hkPresent(LPDIRECT3DDEVICE9 pDevice, const RECT *a, const RECT *b, HWND c, const RGNDATA *d)
    {
    {
    StartFont(pDevice);
    pDrawPrimitive = *(CILTDrawPrim **)DrawPrimitive;

    Menu(pDevice);
    }

    return oPresent(pDevice, a, b, c, d);
    }

    VOID Hook(void)
    {
    oPresent = (tPresent) DetourCreate((BYTE*) DeviceIndex(17), (BYTE*) hkPresent, 10);
    }

    bool IsGameReady( void )
    {
    if( GetModuleHandle( "Kernel32.dll" ) != NULL
    && GetModuleHandle( "d3d9.dll" ) != NULL
    && GetModuleHandle( "Engine.exe" ) != NULL
    && GetModuleHandle( "CShell.dll" ) != NULL
    && GetModuleHandle( "Clientfx.fxd" ) != NULL )
    return true;

    return false;
    }

    DWORD WINAPI Bypass( LPVOID lpArgs )
    {

    while( memcmp( ( CONST VOID * )ADDR_BYPASS, ( CONST VOID * )"\x0F\x84\xB4\x00\x00\x00", 6 ) != 0 )
    Sleep(100);

    MEMCPY( ( LPVOID )ADDR_BYPASS, "\xE9\x19\x01\x00\x00\x90", 6 );

    while( !IsGameReady() )
    Sleep( 25 );

    Hook();

    return 0;
    }

    BOOL WINAPI DllMain( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    if( dwReason == DLL_PROCESS_ATTACH )
    {
    DisableThreadLibraryCalls( hDll );
    MessageBox( 0, "Simple CANA", "CombatArms", 0 );
    CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)&Bypass, 0, 0, 0 );
    }

    return TRUE;
    }

  10. #10
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    Man, learn a basic of c++
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  11. #11
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    i have learned

  12. #12
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    Quote Originally Posted by brohizi View Post
    i have learned
    Learn more, if you know a basic of c++, you solve it all
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  13. #13
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    i solved it all but it crashed when i injected it...

  14. #14
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    2,136
    Reputation
    242
    Thanks
    12,562
    Quote Originally Posted by brohizi View Post
    i solved it all but it crashed when i injected it...
    If the hack crashed, you didn´t solved
    Member Level 1 since November, 2011
    Contributor since March, 2015
    Game Hacking Team : 06/14/2017

     

  15. #15
    brohizi's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    30
    Reputation
    10
    Thanks
    1
    well... time to search

    - - - Updated - - -

    idk what to do... how do i fix?
    Last edited by brohizi; 03-07-2015 at 03:39 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Detouring MPGH Filters Will Result In A Ban.
    By radnomguywfq3 in forum Combat Arms Hacks & Cheats
    Replies: 0
    Last Post: 11-09-2008, 06:02 PM
  2. Detour problem
    By juppeli in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-16-2008, 03:56 AM
  3. [Realease-Test]Detours Test
    By Kung Fu Penguin31 in forum WarRock - International Hacks
    Replies: 16
    Last Post: 06-29-2008, 05:35 AM
  4. Detour
    By HackingIsMyLife in forum Programming Tutorial Requests
    Replies: 0
    Last Post: 05-20-2008, 07:17 AM
  5. coding detour?
    By laserdude45 in forum C++/C Programming
    Replies: 3
    Last Post: 01-20-2008, 03:11 PM