Results 1 to 2 of 2
  1. #1

    [Help]Cod5 Chams

    Here is this Source That I gave to Seraphim to test/compile it for me.
    Well after that I decided to start coding and stuff.

    Well I am getting a Error on compile.

    There is 2 things I want in this thread:
    1. To fix the Error, (What I want the most)
    2. I want to add Team Recognize (Axis/Allies) (Just a side thing, that if you want to help me)

    Error:
    Code:
    1>------ Build started: Project: CoD5_Public_Framework_v3.0, Configuration: Release Win32 ------
    1>main.obj : error LNK2005: _DllMain@12 already defined in DLL_Main.obj
    1>main.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileInMemory@16
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Cod5 Engine Chams
    Code:
    #define WIN32_LEAN_AND_MEAN
    
    #include <windows.h>
    #include <WinBase.h>
    #include <detours.h>
    #include <Psapi.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <d3dx9tex.h>
    #include <d3dx9math.h>
    
    #pragma comment( lib, "d3dx9.lib." )
    
    typedef struct
    {
    	IDirect3DDevice9 * device;
    } cod5_device_t;
    
    cod5_device_t *     cod5_device     = (cod5_device_t *)        ( 0x1087DD08 );
    
    bool once = true;
    
    LPDIRECT3DTEXTURE9 texBlue;
    LPDIRECT3DTEXTURE9 texRed;
    LPDIRECT3DTEXTURE9 texYel;
    LPDIRECT3DTEXTURE9 texGreen;
    
    const BYTE bYellow[60] = 
    { 
    	0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    	0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 
    	0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 
    	0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    	0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00, 
    	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    	0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00     
    };
    
    const BYTE bGreen[60] = 
    { 
    	0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    	0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 
    	0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 
    	0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    	0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00, 
    	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    	0x20, 0xA0, 0x00, 0x00, 0xFF, 0xFF 
    }; 
    
    const BYTE bBlue[60] =
    {
    	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    	0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
    	0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
    	0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
    	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    	0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    const BYTE bRed[60] =
    {
    	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    	0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
    	0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
    	0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
    	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    	0x00, 0x00, 0xCC, 0x00, 0x00, 0x00
    };
    
    void ( *orig_DrawXModelSkinnedCached ) ( int a1, int a2, int a3 );
    void R_DrawXModelSkinnedCached ( int a1, int a2, int a3 )
    {
    	if(once)
    	{
    		D3DXCreateTextureFromFileInMemory( cod5_device->device,(LPCVOID)&bBlue,60,&texBlue);
    		D3DXCreateTextureFromFileInMemory( cod5_device->device,(LPCVOID)&bRed,60,&texRed);
    		D3DXCreateTextureFromFileInMemory( cod5_device->device,(LPCVOID)&bYellow,60,&texYel);
    		D3DXCreateTextureFromFileInMemory( cod5_device->device,(LPCVOID)&bGreen,60,&texGreen);
    
    		once = false;
    	}
    
    	cod5_device->device->SetRenderState( D3DRS_LIGHTING, FALSE );
    	cod5_device->device->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
    	cod5_device->device->SetTexture( 0, texBlue );
    
    	orig_DrawXModelSkinnedCached( a1, a2, a3 );
    
    	cod5_device->device->SetTexture( 0, texGreen );
    	cod5_device->device->SetRenderState( D3DRS_LIGHTING, FALSE );
    	cod5_device->device->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
    
    	orig_DrawXModelSkinnedCached( a1, a2, a3 );
    }
    
    BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
    {
    	switch( dwReason )
    	{
    	case DLL_PROCESS_ATTACH:
    		if( DisableThreadLibraryCalls( hModule ) )
    		{
    			DetourFunction((PBYTE)0x00714780, (PBYTE)R_DrawXModelSkinnedCached);
    			_asm mov [ orig_DrawXModelSkinnedCached ], eax;
    
    		}
    		return TRUE;
    	}
    	return TRUE;
    }

  2. #2
    Senior Member
    Join Date
    Oct 2009
    Posts
    118

    Re: [Help]Cod5 Chams

    Linker errors say it clearly enough:
    1.In your project you have another file where DLLMain is called( DLL_Main.cpp ),soo just delete that file and you should be good.
    2.You need to download DirectX SDK,maybe you have it already,if soo,check directories in VC++ settings for SDK folders,could be that program didn't locate them soo you need to do that manually.

    ~Inferno

Similar Threads

  1. [Release]Cod5 Chams
    By x33x in forum Call of Duty 5 Cheat Downloads
    Replies: 1
    Last Post: November 19th, 2013, 06:52
  2. [Release] CoD5 Simple Chams
    By Seraphim in forum Call of Duty 5 Cheat Downloads
    Replies: 15
    Last Post: July 24th, 2012, 01:35
  3. any cod5 v1.7 wh?
    By *Ghost_ in forum Call of Duty 5: World at War Cheats
    Replies: 1
    Last Post: July 16th, 2011, 13:08
  4. D3D for COD5
    By Hc4lNickNL in forum Call of Duty 5 Cheat Downloads
    Replies: 15
    Last Post: October 12th, 2009, 23:14
  5. CoD5
    By oneShot in forum Other Games
    Replies: 10
    Last Post: June 18th, 2009, 23:42

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
  •