Engine chams cod4 / any cod game really

Manucod1

New member
Since I never posted anything on aimbots yet I'll post some poc code and explain. A little what's happening.

First of all I gave some info without code on other sites. If you look for it you should find info on mw2 and cod4.

Basically you hook surfaces camera and modify the texture that's going to be used by the game to Display the model.
You can easily achieve different colors depending on if model is visible or not.

This sample code only changes it to one color and as is won't work if you want a visible and not visible color to put on the players.

one thing i never did was find out how to properly duplicate a material so that you can use one type of material for vis and not vis mat.

Credits: me me and me
ApplicationFrameHost_KbnRW0PUHh.png
C++:
cod4 engine chams

```
void hkR_AddDObjSurfacesCamera_Wrapper() {
    if (SceneEntity && gGfxMaterial) {
        GfxSceneEntity* gfxSceneEntity = (GfxSceneEntity*)SceneEntity;
        MaterialProperAlignment* gfxMaterial = (MaterialProperAlignment*)gGfxMaterial;
        if (Players::Players[gfxSceneEntity->entnum].isEnemy && Players::Players[gfxSceneEntity->entnum].alive) {
            auto mat= MaterialRegister("mc/mtl_weapon_reflex_lens", 7);
            if (mat->MaterialTextureDef->u.image->texture.map != RedTexture) {
                omtl_weapon_acog_lens = mat->MaterialTextureDef->u.image->texture.map;
                mat->MaterialTextureDef->u.image->texture.map = RedTexture;
            }
            gGfxMaterial = (DWORD)mat;
        }
    }
}

__declspec(naked) void hkR_AddDObjSurfacesCamera() {
    __asm {
        mov SceneEntity, ebp
        mov gGfxMaterial, ecx
        pushad
    }
    hkR_AddDObjSurfacesCamera_Wrapper();
    __asm {
        popad
        mov ecx, gGfxMaterial
        jmp oR_AddDObjSurfacesCamera
    }
}

```
 
Last edited:
Top