Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 337

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 339

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 341

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 343
Injecting and Hooking CoD

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    17

    Injecting and Hooking CoD

    I've spending the last few days messing with random hooking tutorials, and I even made the InsertDateTime redirect for Notepad and scared a few people by thinking I gave them a virus xD

    I'm moved back to CoD and I used OllyDBG to locate the "WEAPON_FIRING" function in cgamex86.dll. but I'm not sure the adress is correct... because when I inject my DLL without any function hooking, CoD starts up, but when I add my hooks, it doesn't start up.

    Adresses:
    Code:
    3000CCC5    |. E8 26C50000    CALL cgamex86.300191F0
    3000CCCA    |. 83C4 04        ADD ESP,4
    3000CCCD    |. 5E             POP ESI
    3000CCCE    |. C3             RETN
    3000CCCF       68 E46D0530    PUSH cgamex86.30056DE4      ASCII"WEAPON_FIRING"
    dllmain.cpp:
    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include "detours.h"
    #include "dll.h"
    
    BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                           DWORD reason        /* Reason this function is being called. */ ,
                           LPVOID reserved     /* Not used. */ )
    {
        switch (reason)
        {
          case DLL_PROCESS_ATTACH:
              MessageBox(0, "Injected!", "TehBlizzy's CoDHook", MB_OK);
              WEAPON_FIRING = (int (__stdcall*)(void))DetourFunction((PBYTE)<adress?>, (PBYTE)HookWEAPON_FIRING);
            break;
    
          case DLL_PROCESS_DETACH:
            break;
    
          case DLL_THREAD_ATTACH:
            break;
    
          case DLL_THREAD_DETACH:
              DetourRemove((PBYTE)<adress?>, (PBYTE)WEAPON_FIRING); //Remove hook
            break;
        }
    
        /* Returns TRUE on success, FALSE on failure */
        return TRUE;
    }
    dll.h:
    Code:
    #ifndef _DLL_H_
    #define _DLL_H_
    
    #if BUILDING_DLL
    # define DLLIMPORT __declspec (dllexport)
    #else /* Not BUILDING_DLL */
    # define DLLIMPORT __declspec (dllimport)
    #endif /* Not BUILDING_DLL */
    
    int (__stdcall* WEAPON_FIRING)(void);
    
    void HookWEAPON_FIRING(void)
    {
    MessageBox(0, "You just fired a round.", "Function Called", MB_OK);
    return;
    }
    
    #endif /* _DLL_H_ */
    Can anyone point me in the right direction of what address(es) I'm supposed to hook and get this to work?

  2. #2
    Admin King-OrgY's Avatar
    Join Date
    Nov 2007
    Posts
    4,567

    Re: Injecting and Hooking CoD

    you will hook cod sp?

    is for mp
    scr includet
    http://aimbots.net/attachments/sugge...1-norecoil.zip


    just search for string=ASCII "CG_FireWeapon: ent->weapon > BG_GetNumWeapons()"

    and press enter the second FireWepon line

    and search the 2X call

    the offset for sp is then
    Code:
    0x3002C4F0

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    17

    Re: Injecting and Hooking CoD

    Ah... I was using a complete different method for looking for the functions, thanks man!

    *
    I just finished trying it out... and what can I say.... there literally is -no- recoil. I'll work on making it so I can toggle it on and off(Pretty simple)

    *
    I'm looking in OllyDBG and where you said "just search for string=ASCII CG_FireWeapon: ent->weapon > BG_GetNumWeapons()", how would I do that?

    What I know to do:

    1.Open cgamex86.dll in OllyDBG.
    2.Right Click -> Search -> For all Referenced Text Strings
    3. Scroll to very top and look down the list and I find:
    "3000CCCF 68 E46D0530 PUSH cgamex86.30056DE4 ; ASCII "WEAPON_FIRING
    ""
    4. When I hit enter or double-click it it just expands that to show the PUSH, ADD, POP, RETN above/below it.

    ^---- Is that what I'm supposed to be doing?

    *
    Ah! Never mind about finding those addresses, I was looking at the wrong areas.

Similar Threads

  1. Injecting
    By Korruption in forum Enemy Territory Cheats
    Replies: 9
    Last Post: November 29th, 2007, 01:11
  2. Help with injecting.. for cod1
    By jumpmanjoker23 in forum Call of Duty 2 Cheats
    Replies: 5
    Last Post: September 24th, 2007, 17:58
  3. [injecting]
    By [Sniper] in forum Enemy Territory Cheats
    Replies: 4
    Last Post: September 23rd, 2007, 04:28
  4. injecting
    By =-Slayer-= in forum Enemy Territory Cheats
    Replies: 10
    Last Post: July 22nd, 2007, 09:55
  5. Help with Injecting
    By zyon00z in forum Enemy Territory Cheats
    Replies: 2
    Last Post: July 4th, 2007, 15:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •