#include "Hacks.h"
BOOL WINAPI WaitForGameLibs(LPVOID)
{
try
{
if(!Hacks->ReadyForHacks()) throw 1;
}
catch (int error)
{
switch (error)
{
case 1:
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)WaitForGameLibs, NULL, NULL, NULL);
return false;
default:
return false;
}
}
Hacks = new cHacks();
return true;
}
BOOL WINAPI DllMain(HINSTANCE Instance, DWORD Reason, LPVOID Reserved)
{
if(Reason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(Instance);
MessageBoxA(0, "Jeff's Undetected Crossfire Base", "MPGH", 0);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE) WaitForGameLibs, 0, 0, 0);
}
return true;
}
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define Grenades ((i==6)||(i==7)||(i==8)||(i==64)||(i==100)||(i==126)||(i==135)||(i==209)||(i==210)||(i==240)||(i==263)||(i==272)||(i==338)||(i==382)||(i==383)||(i==384))
#define Knifes ((i==5)||(i==35)||(i==74)||(i==132)||(i==239)||(i==372)||(i==381))
class cWeaponMgr
{
public:
static const DWORD DamageCameraPenalty = 0x2418;
static const DWORD MoveSpeedPenalty = 0x2454;
static const DWORD ZoomInMoveSpeedPenalty = 0x2458;
static const DWORD MovePenaltyForDelayFire = 0x245C;
static const DWORD ZoomTargetType = 0x2460;
static const DWORD DamagePenaltyTimeAndMoveRate = 0x265C;
static const DWORD NanoGhostDamagePenaltyTimeAndMoveRate1 = 0x2660;
static const DWORD NanoGhostDamagePenaltyTimeAndMoveRate2 = 0x2654;
static const DWORD WallShotDamageRatio = 0x2658;
static const DWORD ChangeWeaponAnimRatio = 0x26A0;
static const DWORD ReloadAnimRatio = 0x269C;
static const DWORD CrossHairRatioPerRealSize = 0x26A4;
static const DWORD KnockBack = 0x278C;
static const DWORD AmmoDamage = 0x7F8;
static const DWORD Range = 0x7EC;
static const DWORD GunKnifeRange = 0x2784;
static const DWORD KnifeNormalAniRate = 0xA28;
static const DWORD GunKnifeAmmoDamage = 0x2788;
static const DWORD UnlimitedAmmo = 0x7FC;
static const DWORD LowerAnimRate = 0x2520;
static const DWORD BulletPosOffset1 = 0x1928;
static const DWORD BulletPosOffset2 = 0x192C;
static const DWORD BulletPosOffset3 = 0x1930;
static const DWORD BulletPosOffset4 = 0x258C;
static const DWORD BulletPosOffset5 = 0x2520;
static const DWORD BulletPosOffset6 = 0x2594;
static const DWORD BulletPosOffset7 = 0x2590;
};
class cWallMgr
{
public:
static const DWORD EdgeShotEnabled = 0x4E8;
static const DWORD WallShotEnabled = 0x4EC;
static const DWORD PerfectShotEnabled = 0x4F0;
};
class cPlayerInfo
{
public:
char Spacer00[4];
float MovementSpeed;
float MovementWalkRate;
float MovementDuckWalkRate;
float MovementSideMoveRate;
float MovementFrontBackRunAnimationRate;
float MovementLeftRightRunAnimationRate;
float MovementFrontBackWalkAnimationRate;
float MovementLeftRightWalkAnimationRate;
float MovementAcceleration;
float MovementFriction;
float JumpTime;
float JumpVelocity;
float JumpLandedWaitTime;
float JumpLandedNoJumpTimeRate;
float JumpRepeatPenaltyMoveRate;
float JumpRepeatPenaltyHeightRate;
float JumpLandedMovePenaltyTimeRate;
float JumpLandedMovePenaltyMoveRate;
char Spacer01[40];
float DamagePenaltyTime;
float DamagePenaltyMoveRate;
float C4PlantTime;
float C4DefuseTime;
float MaxCanDefuseDistance;
float CharacterHiddenAlpha;
float CharacterHiddenWalkAlpha;
float CharacterHiddenRunAlpha;
float MovementHiddenRate;
DWORD CrossHairColor;
float CrossHairRedChangeRate;
float CrossHairGreenChangeRate;
float CrossHairBlueChangeRate;
};
class cHacks
{
public:
bool ReadyForHacks();
DWORD GetAddressFromOffset(DWORD Base, DWORD Offset);
cWeaponMgr* WeaponMgr;
cWallMgr* WallMgr;
cPlayerInfo* PlayerInfo;
cHacks();
~cHacks();
private:
#define WeaponMgrOffset 0xA68F90
#define WallMgrOffset 0xA68F74
#define PlayerMgrOffset 0xA69BF8
#define PlayerInfoOffset 0xA02204
DWORD dwWeaponMgr, dwWallMgr, dwPlayerMgr, dwPlayerInfo;
};extern class cHacks* Hacks;
#include "Hacks.h"
cHacks* Hacks;
cHacks::cHacks()
{
DWORD CShell = (DWORD) GetModuleHandleA("CShell.dll");
if(!CShell) return;
dwWeaponMgr = *(DWORD*)GetAddressFromOffset(CShell, WeaponMgrOffset);
dwWallMgr = *(DWORD*)GetAddressFromOffset(CShell, WallMgrOffset);
dwPlayerMgr = *(DWORD*)GetAddressFromOffset(CShell, PlayerMgrOffset);
dwPlayerInfo= *(DWORD*)GetAddressFromOffset(CShell, PlayerInfoOffset);
if(dwWeaponMgr && dwWallMgr && dwPlayerMgr && dwPlayerInfo)
{
for(int i = 0; i < 560; i++)
{
DWORD Weapon = *(DWORD*)GetAddressFromOffset(dwWeaponMgr, (4*i));
if(Weapon)
{
*(float*)GetAddressFromOffset(Weapon, WeaponMgr->ChangeWeaponAnimRatio) = 9999;
*(float*)GetAddressFromOffset(Weapon, WeaponMgr->ReloadAnimRatio) = 999;
}
}
}
else
return;
}
bool cHacks::ReadyForHacks()
{
if(GetModuleHandleA("CShell.dll") != NULL && GetModuleHandleA("ClientFX.fxd") != NULL && GetModuleHandleA("crossfire.exe") != NULL)
return true;
return false;
}
DWORD cHacks::GetAddressFromOffset(DWORD Base, DWORD Offset)
{
if(Base)
return (Base + Offset);
else
return NULL;
}



