├── .gitignore ├── CAimbot.cpp ├── CAimbot.h ├── CBaseCombatWeapon.h ├── CBaseEntity.h ├── CDebugOverlay.h ├── CDraw.cpp ├── CDraw.h ├── CESP.cpp ├── CESP.h ├── CEngineClient.h ├── CEntityList.h ├── CGameEventManager.cpp ├── CGameEventManager.h ├── CGameMovement.h ├── CGlobalVars.h ├── CInput.h ├── CMath.cpp ├── CMath.h ├── CModelInfo.h ├── CNoSpread.cpp ├── CNoSpread.h ├── CPrediction.h ├── CSSBase.vcxproj ├── CSSBase.vcxproj.filters ├── CSSBase.vcxproj.user ├── CTrace.h ├── CVARS.cpp ├── CVARS.h ├── CValve.cpp ├── CValve.h ├── CWinsock.cpp ├── CWinsock.h ├── ClientClass.h ├── ConVar.h ├── DllMain.cpp ├── DllMain.h ├── HLClient.h ├── IGameEvent.h ├── IGameEventListener2.h ├── IGameEventManager.h ├── IMoveHelper.h ├── INTERWEBZ-Fixed by Shaxzy.sln ├── IPanel.h ├── ISurface.h ├── LICENSE ├── MD5.cpp ├── MD5.h ├── Netvars.cpp ├── README.md ├── ReflectiveDLLInjection.h ├── ReflectiveLoader.h ├── Surface.cpp ├── Surface.h ├── Utils.cpp ├── Utils.h ├── Vector.h ├── checksum_crc.cpp ├── checksum_crc.h ├── client.cpp ├── client.h ├── dt_common2.h ├── dt_recv2.h ├── menu.cpp ├── menu.h ├── mouse.cpp ├── mouse.h ├── netvars.h ├── platform.h ├── sdk.h ├── valve_off.h ├── valve_on.h ├── wchartypes.h └── xor.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /CAimbot.h: -------------------------------------------------------------------------------- 1 | //CSS only 2 | #define CHAR_TEX_CONCRETE 'C' 3 | #define CHAR_TEX_DIRT 'D' 4 | #define CHAR_TEX_GRATE 'G' 5 | #define CHAR_TEX_METAL 'M' 6 | #define CHAR_TEX_COMPUTER 'P' 7 | #define CHAR_TEX_TILE 'T' 8 | #define CHAR_TEX_VENT 'V' 9 | #define CHAR_TEX_WOOD 'W' 10 | #define CHAR_TEX_GLASS 'Y' 11 | 12 | typedef struct 13 | { 14 | int iBulletType;//CSS only 15 | int iPenetration;//CSS only 16 | int iDamage; 17 | float fMaxRange; 18 | float fRangeModifier; 19 | float fPenetrationPower; 20 | float fPenetrationDistance;//CSS only 21 | } WeaponInfo_t; 22 | 23 | class CAimbot 24 | { 25 | public: 26 | CAimbot() 27 | { 28 | for(int i = 0; i < 66; i++) 29 | { 30 | fIsSelected[i] = 0; 31 | fYawMod[i] = 0; 32 | fPitchMod[i] = 0; 33 | fWhiteList[i] = 0; 34 | fSpecialAimspot[i] = -1; 35 | } 36 | } 37 | 38 | void Main(ValveSDK::CInput::CUserCmd* pUserCmd, CBaseEntity* pLocal, ValveSDK::CBaseCombatWeapon *pWeapon); 39 | bool MultiPoints(CBaseEntity* pPlayer, Vector &vPos, int iHitBox); 40 | 41 | bool Main_Triggerbot(Vector vSource, Vector qCurAngle, Vector vForward, Vector vRight, Vector vUp, float fMaxDistance, int iLocalTeamNumber,ValveSDK::CBaseCombatWeapon *pWeapon, CBaseEntity *pLocal, int iSeed); 42 | bool Triggerbot(ValveSDK::CBaseCombatWeapon *pWeapon, CBaseEntity *pLocal, ValveSDK::CInput::CUserCmd* pUserCmd); 43 | void Main_RCS(ValveSDK::CInput::CUserCmd* pUserCmd, CBaseEntity* pLocal, ValveSDK::CBaseCombatWeapon *pWeapon); 44 | 45 | bool Main_Knifebot(CBaseEntity* pLocal, ValveSDK::CBaseCombatWeapon *pWeapon); 46 | 47 | bool IsVisible(Vector vStart, Vector vEnd, unsigned int nMask, ValveSDK::CTrace::ITraceFilter *pTraceFilter); 48 | 49 | void FixMovement(ValveSDK::CInput::CUserCmd* c, Vector &qOld, int iPositive = 1); 50 | 51 | void Reset() 52 | { 53 | iTarget = -1; 54 | fBestTarget = 99999.9f; 55 | vTarget.Init(0.0f,0.0f,0.0f); 56 | vFinal.Init(0.0f,0.0f,0.0f); 57 | } 58 | 59 | void ResetRCS() 60 | { 61 | iRCSTarget = -1; 62 | fBestRCSTarget = 99999.9f; 63 | vRCSTarget.Init(0.0f,0.0f,0.0f); 64 | vRCSFinal.Init(0.0f,0.0f,0.0f); 65 | } 66 | 67 | bool HasTarget() 68 | { 69 | return (iTarget != -1); 70 | } 71 | 72 | bool HasTargetRCS() 73 | { 74 | return (iRCSTarget != -1); 75 | } 76 | 77 | void ResetPlayerList(float &handle) 78 | { 79 | if(handle) 80 | { 81 | for(int i = 0; i < 66; i++) 82 | { 83 | fIsSelected[i] = 0; 84 | fYawMod[i] = 0; 85 | fPitchMod[i] = 0; 86 | fWhiteList[i] = 0; 87 | fSpecialAimspot[i] = -1; 88 | } 89 | 90 | handle = 0; 91 | } 92 | } 93 | 94 | ValveSDK::CTrace::CTraceFilterNoPlayer tfNoPlayers; 95 | 96 | int iTarget; 97 | int iRCSTarget; 98 | 99 | float fBestTarget; 100 | float fBestRCSTarget; 101 | 102 | Vector vPoints[55]; 103 | 104 | Vector vTarget; 105 | Vector vRCSTarget; 106 | 107 | Vector vFinal; 108 | Vector vRCSFinal; 109 | 110 | Vector vEyePos; 111 | 112 | WeaponInfo_t wiWeaponInfo; 113 | 114 | //playerlist specifics 115 | float fIsSelected[66]; 116 | float fYawMod[66]; 117 | float fPitchMod[66]; 118 | float fWhiteList[66]; 119 | float fSpecialAimspot[66]; 120 | }; 121 | 122 | extern CAimbot g_Aimbot; -------------------------------------------------------------------------------- /CBaseCombatWeapon.h: -------------------------------------------------------------------------------- 1 | enum 2 | { 3 | WEAPON_NULL, 4 | WEAPON_P228, 5 | WEAPON_GLOCK, 6 | WEAPON_SCOUT, 7 | WEAPON_HE_GRENADE, 8 | WEAPON_XM1014, 9 | WEAPON_C4, 10 | WEAPON_MAC10, 11 | WEAPON_AUG, 12 | WEAPON_SMOKE_GRENADE, 13 | WEAPON_ELITES, 14 | WEAPON_FIVESEVEN, 15 | WEAPON_UMP, 16 | WEAPON_SG550, 17 | WEAPON_GALIL, 18 | WEAPON_FAMAS, 19 | WEAPON_USP, 20 | WEAPON_AWP, 21 | WEAPON_MP5, 22 | WEAPON_M249, 23 | WEAPON_M3, 24 | WEAPON_M4A1, 25 | WEAPON_TMP, 26 | WEAPON_G3SG1, 27 | WEAPON_FLASHBANG, 28 | WEAPON_DEAGLE, 29 | WEAPON_SG552, 30 | WEAPON_AK47, 31 | WEAPON_KNIFE, 32 | WEAPON_P90 33 | }; 34 | 35 | namespace ValveSDK 36 | { 37 | class CBaseCombatWeapon 38 | { 39 | public: 40 | float GetNextPrimaryAttack() 41 | { 42 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BaseCombatWeapon*/XorStr<0x0C,20,0xCCB89A4B>("\x48\x59\x51\x4D\x71\x62\x77\x50\x7B\x78\x74\x76\x6C\x4E\x7F\x7A\x6C\x72\x70"+0xCCB89A4B).s, /*m_flNextPrimaryAttack*/XorStr<0x0D,22,0x423C055C>("\x60\x51\x69\x7C\x5F\x77\x6B\x60\x45\x64\x7E\x75\x78\x68\x62\x5D\x69\x6A\x7E\x43\x4A"+0x423C055C).s); 43 | return *(float*)((DWORD)this + iOffset); 44 | } 45 | 46 | bool HasAmmo() 47 | { 48 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BaseCombatWeapon*/XorStr<0x5E,20,0xBED67F8D>("\x1A\x0B\x3F\x23\x03\x10\x01\x26\x09\x0A\x0A\x08\x1E\x3C\x09\x0C\x1E\x00\x1E"+0xBED67F8D).s,/*m_iClip1*/XorStr<0x7B,9,0xEBD79649>("\x16\x23\x14\x3D\x13\xE9\xF1\xB3"+0xEBD79649).s); 49 | return ((*(PINT)((DWORD)this + iOffset)) > 0); 50 | } 51 | 52 | bool IsSilencerOn() 53 | { 54 | static int iOffsetPistol = g_NetworkedVariableManager.GetOffset(/*DT_WeaponUSP*/XorStr<0x88,13,0xD9DE2C14>("\xCC\xDD\xD5\xDC\xE9\xEC\xFE\xE0\xFE\xC4\xC1\xC3"+0xD9DE2C14).s,/*m_bSilencerOn*/XorStr<0xFD,14,0x2902C67C>("\x90\xA1\x9D\x53\x68\x6E\x66\x6A\x66\x63\x75\x47\x67"+0x2902C67C).s); 55 | static int iOffsetRifle = g_NetworkedVariableManager.GetOffset(/*DT_WeaponM4A1*/XorStr<0x80,14,0x78EF406B>("\xC4\xD5\xDD\xD4\xE1\xE4\xF6\xE8\xE6\xC4\xBE\xCA\xBD"+0x78EF406B).s,/*m_bSilencerOn*/XorStr<0xFD,14,0x2902C67C>("\x90\xA1\x9D\x53\x68\x6E\x66\x6A\x66\x63\x75\x47\x67"+0x2902C67C).s); 56 | 57 | int iWeaponID = GetWeaponID(); 58 | 59 | if(iWeaponID == WEAPON_USP) 60 | return (*(PBOOL)((DWORD)this + iOffsetPistol)); 61 | else if(iWeaponID == WEAPON_M4A1) 62 | return (*(PBOOL)((DWORD)this + iOffsetRifle)); 63 | 64 | return false; 65 | } 66 | 67 | float GetSpread() 68 | { 69 | typedef float(__thiscall *GetSpread_t)(PVOID); 70 | return ((GetSpread_t)(*(PDWORD)(*(PDWORD)(this) + GETSPREADOFFSET)))(this); 71 | } 72 | 73 | float GetCone() 74 | { 75 | typedef float(__thiscall *GetCone_t)(PVOID); 76 | return ((GetCone_t)(*(PDWORD)(*(PDWORD)(this) + GETCONEOFFSET)))(this); 77 | } 78 | 79 | void UpdateAccuracyPenalty() 80 | { 81 | typedef void(__thiscall *UpdateAccuracyPenalty_t)(PVOID); 82 | ((UpdateAccuracyPenalty_t)(*(PDWORD)(*(PDWORD)(this) + UPDATEACCURACYPENALTYOFFSET)))(this); 83 | } 84 | 85 | int GetWeaponID() 86 | { 87 | typedef int(__thiscall *GetWeaponID_t)(PVOID); 88 | return ((GetWeaponID_t)(*(PDWORD)(*(PDWORD)(this) + WEAPONIDOFFSET)))(this); 89 | } 90 | 91 | bool IsMiscWeapon() 92 | { 93 | int iWeaponID = GetWeaponID(); 94 | 95 | return (iWeaponID == WEAPON_KNIFE || iWeaponID == WEAPON_C4 96 | || iWeaponID == WEAPON_HE_GRENADE || iWeaponID == WEAPON_SMOKE_GRENADE 97 | || iWeaponID == WEAPON_FLASHBANG); 98 | } 99 | }; 100 | } -------------------------------------------------------------------------------- /CBaseEntity.h: -------------------------------------------------------------------------------- 1 | /* 2 | CBaseEntity rebuild 3 | 22.08.2014 4 | */ 5 | 6 | class CBaseEntity{ 7 | public: 8 | virtual void init(){}; 9 | 10 | const Vector& GetAbsOrigin() 11 | { 12 | typedef const Vector& ( __thiscall *GetAbsOrg_t )(PVOID); 13 | return ((GetAbsOrg_t)(*(PDWORD)(*(PDWORD)( this ) + 0x24 )))(this); 14 | } 15 | 16 | void GetRenderBounds(Vector &vMins, Vector &vMaxs) 17 | { 18 | PVOID pEnt = (PVOID)this; 19 | 20 | _asm 21 | { 22 | PUSH vMaxs 23 | PUSH vMins 24 | MOV ECX, pEnt 25 | MOV EAX, DWORD PTR DS:[ECX+0x4] 26 | MOV EDX, DWORD PTR DS:[EAX+0x50] 27 | LEA ESI, DWORD PTR DS:[ECX+0x4] 28 | MOV ECX, ESI 29 | CALL EDX 30 | } 31 | } 32 | 33 | Vector GetEyeAngles() 34 | { 35 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_angEyeAngles[0]*/XorStr<0x7E,18,0x0D7A3609>("\x13\x20\xE1\xEF\xE5\xC6\xFD\xE0\xC7\xE9\xEF\xE5\xEF\xF8\xD7\xBD\xD3"+0x0D7A3609).s); 36 | return *(Vector*)((DWORD)this + iOffset); 37 | } 38 | 39 | color32 GetModelColor(); 40 | 41 | bool IsSpawnProtectedPlayer() 42 | { 43 | return (this->GetModelColor().a < 255); 44 | } 45 | 46 | ValveSDK::CBaseCombatWeapon* GetActiveBaseCombatWeapon(); 47 | 48 | int GetIndex() 49 | { 50 | int iEntIndex; 51 | 52 | PVOID pEnt = (PVOID)this; 53 | 54 | __asm 55 | { 56 | MOV ECX, pEnt 57 | MOV EAX, DWORD PTR DS:[ECX+0x8] 58 | MOV EDX, DWORD PTR DS:[EAX+0x24] 59 | LEA ESI, DWORD PTR DS:[ECX+0x8] 60 | MOV ECX, ESI 61 | CALL EDX 62 | MOV iEntIndex, EAX 63 | } 64 | 65 | return iEntIndex; 66 | } 67 | 68 | void AddEFlags(DWORD dwFlags) 69 | { 70 | PINT piEFlags = (PINT)((DWORD)this + 0x170); 71 | *piEFlags |= dwFlags; 72 | } 73 | 74 | PVOID GetCollisionProperty() 75 | { 76 | return (PVOID)((DWORD)this + 0x198); 77 | } 78 | 79 | bool IsDormant() 80 | { 81 | bool bRet; 82 | 83 | PVOID pEnt = (PVOID)this; 84 | 85 | __asm 86 | { 87 | MOV ECX, pEnt 88 | MOV EAX, DWORD PTR DS:[ECX+0x8] 89 | MOV EDX, DWORD PTR DS:[EAX+0x20] 90 | LEA ESI, DWORD PTR DS:[ECX+0x8] 91 | MOV ECX, ESI 92 | CALL EDX 93 | MOV bRet, AL 94 | } 95 | 96 | return bRet; 97 | } 98 | 99 | bool IsPlayer() 100 | { 101 | typedef bool ( __thiscall *IsPlayer_t )(PVOID); 102 | return ((IsPlayer_t)(*(PDWORD)(*(PDWORD)( this ) + 0x200 )))(this); 103 | } 104 | 105 | model_t* GetModel() 106 | { 107 | model_t *mRet; 108 | 109 | PVOID pEnt = (PVOID)this; 110 | 111 | _asm 112 | { 113 | MOV ECX, pEnt 114 | MOV EAX, DWORD PTR DS:[ECX+0x4] 115 | MOV EDX, DWORD PTR DS:[EAX+0x24] 116 | LEA ESI, DWORD PTR DS:[ECX+0x4] 117 | MOV ECX, ESI 118 | CALL EDX 119 | MOV mRet, EAX 120 | } 121 | 122 | return mRet; 123 | } 124 | 125 | int GetHealth() 126 | { 127 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BasePlayer*/XorStr<0xC2,14,0xCFD8B52B>("\x86\x97\x9B\x87\xA7\xB4\xAD\x99\xA6\xAA\xB5\xA8\xBC"+0xCFD8B52B).s, /*m_iHealth*/XorStr<0x7A,10,0x7B6EFF44>("\x17\x24\x15\x35\x1B\x1E\xEC\xF5\xEA"+0x7B6EFF44).s); 128 | return *(int*)((DWORD)this + iOffset); 129 | } 130 | 131 | char GetLifeState() 132 | { 133 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BasePlayer*/XorStr<0xC2,14,0xCFD8B52B>("\x86\x97\x9B\x87\xA7\xB4\xAD\x99\xA6\xAA\xB5\xA8\xBC"+0xCFD8B52B).s, /*m_LifeState*/XorStr<0x8E,12,0x5618CCB6>("\xE3\xD0\xDC\xF8\xF4\xF6\xC7\xE1\xF7\xE3\xFD"+0x5618CCB6).s); 134 | return *(char*)((DWORD)this + iOffset); 135 | } 136 | 137 | int GetTeamNum() 138 | { 139 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BasePlayer*/XorStr<0xC2,14,0xCFD8B52B>("\x86\x97\x9B\x87\xA7\xB4\xAD\x99\xA6\xAA\xB5\xA8\xBC"+0xCFD8B52B).s, /*m_iTeamNum*/XorStr<0xBC,11,0x9EF53877>("\xD1\xE2\xD7\xEB\xA5\xA0\xAF\x8D\xB1\xA8"+0x9EF53877).s); 140 | return *(int*)((DWORD)this + iOffset); 141 | } 142 | 143 | int GetFlags() 144 | { 145 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BasePlayer*/XorStr<0xC2,14,0xCFD8B52B>("\x86\x97\x9B\x87\xA7\xB4\xAD\x99\xA6\xAA\xB5\xA8\xBC"+0xCFD8B52B).s, /*m_fFlags*/XorStr<0xC3,9,0x8951F943>("\xAE\x9B\xA3\x80\xAB\xA9\xAE\xB9"+0x8951F943).s); 146 | return *(int*)((DWORD)this + iOffset); 147 | } 148 | 149 | float GetFallVelocity() 150 | { 151 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_flFallVelocity*/XorStr<0xC4,17,0x8454FEF5>("\xA9\x9A\xA0\xAB\x8E\xA8\xA6\xA7\x9A\xA8\xA2\xA0\xB3\xB8\xA6\xAA"+0x8454FEF5).s); 152 | return *(float*)((DWORD)this + iOffset); 153 | } 154 | 155 | Vector GetBaseVelocity() 156 | { 157 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0x34,12,0x959D9DAB>("\x70\x61\x69\x74\x6B\x69\x56\x5A\x45\x58\x4C"+0x959D9DAB).s,/*m_vecBaseVelocity*/XorStr<0x44,18,0xF97A7797>("\x29\x1A\x30\x22\x2B\x0B\x2B\x38\x29\x1B\x2B\x23\x3F\x32\x3B\x27\x2D"+0xF97A7797).s); 158 | return *(Vector*)((DWORD)this + iOffset); 159 | } 160 | 161 | Vector GetNetworkedOrigin() 162 | { 163 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BasePlayer*/XorStr<0xC2,14,0xCFD8B52B>("\x86\x97\x9B\x87\xA7\xB4\xAD\x99\xA6\xAA\xB5\xA8\xBC"+0xCFD8B52B).s, /*m_vecOrigin*/XorStr<0x1D,12,0x2333782C>("\x70\x41\x69\x45\x42\x6D\x51\x4D\x42\x4F\x49"+0x2333782C).s); 164 | return *(Vector*)((DWORD)this + iOffset); 165 | } 166 | 167 | Vector GetVecViewOffset() 168 | { 169 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_BasePlayer*/XorStr<0xC2,14,0xCFD8B52B>("\x86\x97\x9B\x87\xA7\xB4\xAD\x99\xA6\xAA\xB5\xA8\xBC"+0xCFD8B52B).s, /*m_vecViewOffset[0]*/XorStr<0xF0,19,0xB93B59BD>("\x9D\xAE\x84\x96\x97\xA3\x9F\x92\x8F\xB6\x9C\x9D\x8F\x98\x8A\xA4\x30\x5C"+0xB93B59BD).s); 170 | return *(Vector*)((DWORD)this + iOffset); 171 | } 172 | 173 | Vector GetEyePosition() 174 | { 175 | return GetNetworkedOrigin() + GetVecViewOffset(); 176 | } 177 | 178 | Vector GetPunchAngle() 179 | { 180 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0x34,12,0x959D9DAB>("\x70\x61\x69\x74\x6B\x69\x56\x5A\x45\x58\x4C"+0x959D9DAB).s, /*m_vecPunchAngle*/XorStr<0xFC,16,0xFF541491>("\x91\xA2\x88\x9A\x63\x51\x77\x6D\x67\x6D\x47\x69\x6F\x65\x6F"+0xFF541491).s); 181 | return *(Vector*)((DWORD)this + iOffset); 182 | } 183 | 184 | Vector GetVelocity() 185 | { 186 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s,/*m_vecVelocity[0]*/XorStr<0x60,17,0x44C61C52>("\x0D\x3E\x14\x06\x07\x33\x03\x0B\x07\x0A\x03\x1F\x15\x36\x5E\x32"+0x44C61C52).s); 187 | return *(Vector*)((DWORD)this + iOffset); 188 | } 189 | 190 | int GetTickBase() 191 | { 192 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0x34,12,0x959D9DAB>("\x70\x61\x69\x74\x6B\x69\x56\x5A\x45\x58\x4C"+0x959D9DAB).s, /*m_nTickBase*/XorStr<0x5E,12,0xDB7AF0A6>("\x33\x00\x0E\x35\x0B\x00\x0F\x27\x07\x14\x0D"+0xDB7AF0A6).s); 193 | return *(int*)((DWORD)this + iOffset); 194 | } 195 | 196 | bool isValidPlayer() 197 | { 198 | //kolonote: 199 | //there are no dormant player ents in csgo...there are some other ents tho like grenades 200 | return (GetLifeState() == LIFE_ALIVE && !IsDormant()); 201 | } 202 | 203 | UCHAR GetMoveType() 204 | { 205 | return *(UCHAR*)((DWORD)this + 0x174); 206 | } 207 | 208 | bool SetupBones(matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime) 209 | { 210 | bool bRet; 211 | 212 | PVOID pAnimating = (PVOID)this; 213 | 214 | __asm 215 | { 216 | PUSH currentTime 217 | PUSH boneMask 218 | PUSH nMaxBones 219 | PUSH pBoneToWorldOut 220 | MOV ECX, DWORD PTR DS:[pAnimating] 221 | ADD ECX, 4 222 | MOV EDX, DWORD PTR DS:[pAnimating] 223 | MOV EAX, DWORD PTR DS:[EDX+4] 224 | MOV EDX, DWORD PTR DS:[EAX+0x40] 225 | CALL EDX 226 | MOV bRet, AL 227 | } 228 | 229 | return bRet; 230 | } 231 | 232 | //later usage 233 | bool IsUsingAntiAim() 234 | { 235 | Vector qAngles = GetEyeAngles(); 236 | 237 | return (qAngles.x >= 68.0f && qAngles.x <= 90.0f); 238 | } 239 | }; -------------------------------------------------------------------------------- /CDebugOverlay.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CDebugOverlay 4 | { 5 | public: 6 | bool ScreenPosition(const Vector& vIn, Vector& vOut) 7 | { 8 | typedef bool(__thiscall* OriginalFn)(PVOID, const Vector&, Vector&); 9 | return getvfunc(this, 10)(this, vIn, vOut); 10 | } 11 | }; 12 | } -------------------------------------------------------------------------------- /CDraw.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/CDraw.cpp -------------------------------------------------------------------------------- /CDraw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CDraw 4 | { 5 | public: 6 | VOID InitFonts(); 7 | INT getWidht(unsigned long font, const char* input); 8 | std::wstring stringToWide(const std::string& text); 9 | VOID DrawString(unsigned long font,int x, int y, int r, int g, int b, const wchar_t *pszText); 10 | VOID DrawStringA(unsigned long font, bool center, int x, int y, int r, int g, int b, int a, const char *input, ...); 11 | VOID FillRGBA(int x, int y, int w, int h, int r, int g, int b, int a); 12 | VOID DrawHeader(INT x, INT y, INT w, INT r, INT g, INT b, INT HealthBarWidth); 13 | VOID DrawHealthBox(int x, int y, int r, int g, int b, int a, int CurHealth, int MaxHealth); 14 | VOID boxESP(int x, int y, int radius, int R, int G, int B); 15 | VOID drawCrosshair(int x, int y, int r, int g, int b); 16 | VOID DrawBox(int x, int y, int w, int h, int lw, int r, int g, int b, int a); 17 | VOID DrawBoxHealth(int x, int y, int w, int h, int lw, int r, int g, int b, int a, int targetId, int damageDealt, int animTimer, int index); 18 | VOID DrawOutlinedRect(int x0, int y0, int x1, int y1, int R, int G, int B); 19 | 20 | unsigned long m_ESPFont, m_WatermarkFont, m_MenuFont, m_ListItemFont; 21 | private: 22 | }; -------------------------------------------------------------------------------- /CESP.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/CESP.cpp -------------------------------------------------------------------------------- /CESP.h: -------------------------------------------------------------------------------- 1 | class CESP 2 | { 3 | public: 4 | void DrawHeader(int x, int y, int w, int r, int g, int b, int HealthBarWidth); 5 | void DrawRadar(void); 6 | void DrawChickenESP(void); 7 | void draw(void); 8 | }; -------------------------------------------------------------------------------- /CEngineClient.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CEngineClient 4 | { 5 | public: 6 | typedef struct 7 | { 8 | char name[32]; 9 | int userID; 10 | char guid[33]; 11 | __int32 friendsID; 12 | char friendsName[32]; 13 | bool fakeplayer; 14 | bool ishltv; 15 | CRC32_t customFiles[4]; 16 | unsigned char filesDownloaded; 17 | char Pad[200]; 18 | } player_info_t; 19 | 20 | void GetScreenSize(int& width, int& height) 21 | { 22 | typedef void(__thiscall* OriginalFn)(PVOID, int&, int&); 23 | return getvfunc(this, 5)(this, width, height); 24 | } 25 | 26 | bool GetPlayerInfo(int iIndex, player_info_t *pInfo) 27 | { 28 | typedef bool(__thiscall* OriginalFn)(PVOID, int, player_info_t*); 29 | return getvfunc(this, 8)(this, iIndex, pInfo); 30 | } 31 | 32 | int GetLocalPlayer(VOID) 33 | { 34 | typedef int(__thiscall* OriginalFn)(PVOID); 35 | return getvfunc(this, 12)(this); 36 | } 37 | 38 | const matrix3x4& WorldToScreenMatrix(void) 39 | { 40 | typedef const matrix3x4& (__thiscall* OriginalFn)(PVOID); 41 | return getvfunc(this, 36)(this); 42 | } 43 | 44 | void ExecuteClientCmd(char const* szCommand) 45 | { 46 | typedef void(__thiscall* OriginalFn)(PVOID, char const* szCommand); 47 | getvfunc(this, 102)(this, szCommand); 48 | } 49 | 50 | void GetViewAngles(Vector& vAngles) 51 | { 52 | typedef void(__thiscall* OriginalFn)(PVOID, Vector&); 53 | return getvfunc< OriginalFn >(this, 19)(this, vAngles); 54 | } 55 | 56 | void SetViewAngles(Vector& vAngles) 57 | { 58 | typedef void(__thiscall* oSetViewAngles)(PVOID, Vector&); 59 | return getvfunc< oSetViewAngles >(this, 20)(this, vAngles); 60 | } 61 | 62 | bool IsConnected() 63 | { 64 | typedef bool(__thiscall* oGetScreenSize)(PVOID); 65 | return getvfunc< oGetScreenSize >(this, 27)(this); 66 | } 67 | 68 | bool IsInGame() 69 | { 70 | typedef bool(__thiscall* oLocal)(PVOID); 71 | return getvfunc< oLocal >(this, 26)(this); 72 | } 73 | 74 | int GetMaxClients() 75 | { 76 | typedef bool(__thiscall* oGetMaxClients)(PVOID); 77 | return getvfunc< oGetMaxClients >(this, 21)(this); 78 | } 79 | }; 80 | } -------------------------------------------------------------------------------- /CEntityList.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CEntityList 4 | { 5 | public: 6 | CBaseEntity* GetClientEntity(int entnum) 7 | { 8 | typedef CBaseEntity* (__thiscall* OriginalFn)(PVOID, int); 9 | return getvfunc(this, 3)(this, entnum); 10 | } 11 | CBaseEntity* GetClientEntityFromHandle(int hEnt) 12 | { 13 | typedef CBaseEntity* (__thiscall* OriginalFn)(PVOID, int); 14 | return getvfunc(this, 4)(this, hEnt); 15 | } 16 | int GetHighestEntityIndex(void) 17 | { 18 | typedef int(__thiscall* OriginalFn)(PVOID); 19 | return getvfunc(this, 6)(this); 20 | } 21 | }; 22 | } -------------------------------------------------------------------------------- /CGameEventManager.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | cGameEventManager gGameEventManager; 4 | std::vectorg_healthInfo; 5 | 6 | int getZahlAnStelle(const int zahl, const int stelle) 7 | { 8 | int retValue = int(zahl / pow(10.0, int(log10(double(zahl)) - (stelle - 1)))) % 10; 9 | if (retValue < 0) 10 | retValue = 0; 11 | else if (zahl < 10) 12 | retValue = 1; 13 | return retValue; 14 | } 15 | 16 | void cGameEventManager::FireGameEvent(ValveSDK::IGameEvent *event) 17 | { 18 | const char* szEventName = event->GetName(); 19 | 20 | static std::string sXor = /*player_hurt*/XorStr<0x7D,12,0x427069F4>("\x0D\x12\x1E\xF9\xE4\xF0\xDC\xEC\xF0\xF4\xF3"+0x427069F4).s; 21 | static std::string sXor2 = /*player_death*/XorStr<0x72,13,0x2C0196D0>("\x02\x1F\x15\x0C\x13\x05\x27\x1D\x1F\x1A\x08\x15"+0x2C0196D0).s; 22 | static std::string sXor3 = /*round_start*/XorStr<0x76,12,0xE9B186D0>("\x04\x18\x0D\x17\x1E\x24\x0F\x09\x1F\x0D\xF4"+0xE9B186D0).s; 23 | static std::string sXor4 = /*attacker*/XorStr<0x3B,9,0x53678E3F>("\x5A\x48\x49\x5F\x5C\x2B\x24\x30"+0x53678E3F).s; 24 | static std::string sXor5 = /*userid*/XorStr<0x76,7,0x9CB96FC6>("\x03\x04\x1D\x0B\x13\x1F"+0x9CB96FC6).s; 25 | static std::string sXor6 = /*health*/XorStr<0xB5,7,0x0F3F2A4E>("\xDD\xD3\xD6\xD4\xCD\xD2"+0x0F3F2A4E).s; 26 | static std::string sXor7 = /*dmg_health*/XorStr<0x2B,11,0xC337D88F>("\x4F\x41\x4A\x71\x47\x55\x50\x5E\x47\x5C"+0xC337D88F).s; 27 | static std::string sXor8 = /*I did %i damage to %s [%i -> %i] OldFirstDigit: %i NewFirstDigit: %i*/XorStr<0x9E,69,0xC7A6549B>("\xD7\xBF\xC4\xC8\xC6\x83\x81\xCC\x86\xC3\xC9\xC4\xCB\xCC\xC9\x8D\xDA\xC0\x90\x94\xC1\x93\xEF\x90\xDF\x97\x95\x87\x9A\x9E\xD5\xE0\x9E\xF0\xAC\xA5\x84\xAA\xB6\xB6\xB2\x83\xA1\xAE\xA3\xBF\xF6\xED\xEB\xA6\xF0\x9F\xB7\xA4\x92\xBC\xA4\xA4\xAC\x9D\xB3\xBC\xB5\xA9\xE4\xFF\xC5\x88"+0xC7A6549B).s; 28 | 29 | /* 30 | short userid user ID who was hurt 31 | short attacker user ID who attacked 32 | byte health remaining health points 33 | byte armor remaining armor points 34 | string weapon weapon name attacker used, if not the world 35 | short dmg_health damage done to health 36 | byte dmg_armor damage done to armor 37 | byte hitgroup hitgroup that was damaged 38 | */ 39 | 40 | if (strcmp(szEventName, sXor.data()) == 0) 41 | { 42 | char szString[200]; 43 | 44 | if (event->GetInt(sXor4.data(), 0) - 1 == g_Valve.pEngine->GetLocalPlayer()) 45 | { 46 | ValveSDK::CEngineClient::player_info_t info; 47 | if (!g_Valve.pEngine->GetPlayerInfo(event->GetInt(sXor5.data(), 0) - 1, &info)) 48 | return; 49 | 50 | // complicated part XDDDD 51 | int oldHealth = event->GetInt(sXor6.data(), 100) + event->GetInt(sXor7.data(), 100); 52 | int newHealth = event->GetInt(sXor6.data(), 100); 53 | 54 | int oldFirstDigit = getZahlAnStelle(oldHealth, 1); 55 | int newFirstDigit = getZahlAnStelle(newHealth, 1); 56 | 57 | //if ( oldFirstDigit == 1 && oldHealth == 100 && oldHealth != newHealth ) // take care of 100 hp XDD 58 | // 10 healthbars, jeweils 10 hp 59 | //if (newHealth < 91 && oldFirstDigit != newFirstDigit) 60 | //{ 61 | // von 100 auf 90 -> healthbar nummer 10 removen 62 | // von 90 auf 80 -> healthbar nummer 9 removen 63 | // von 70 auf 50 -> healthbar nummer 7 und 8 removen 64 | // etc.. 65 | 66 | int healthbarRemovedNum = 0; 67 | if (newHealth < oldHealth) 68 | { 69 | //int numberOfRemovedHealthbars = getZahlAnStelle(oldHealth - newHealth, 1); 70 | } 71 | // i removed da fuckin healthbar XDDD 72 | 73 | bool foundInList = false; 74 | int i = 0; 75 | for (i = 0; i < g_healthInfo.size(); i++) 76 | { 77 | if (g_healthInfo[i].targetId == event->GetInt(sXor5.data(), 0)) 78 | { 79 | g_healthInfo[i].damage += event->GetInt(sXor7.data(), 100); 80 | g_healthInfo[i].animTimer = GetTickCount(); 81 | foundInList = true; 82 | break; 83 | } 84 | } 85 | 86 | if (!foundInList) 87 | { 88 | healthInfo_t pHealthDummy; 89 | pHealthDummy.damage = event->GetInt(sXor7.data(), 100); 90 | pHealthDummy.targetId = event->GetInt(sXor5.data(), 0); 91 | pHealthDummy.animTimer = GetTickCount(); 92 | g_healthInfo.push_back(pHealthDummy); 93 | } 94 | /* 95 | pHealthDummy.damage = event->GetInt("dmg_health", 100); 96 | pHealthDummy.targetId = event->GetInt("userid", 0); 97 | pHealthDummy.animTimer = GetTickCount(); 98 | g_healthInfo.push_back(pHealthDummy); 99 | */ 100 | //} 101 | // complicated part XDDDD 102 | 103 | #ifdef DEBUGMODE 104 | sprintf(szString, sXor8.data(), event->GetInt(sXor7.data(), 100), info.name, oldHealth, newHealth, oldFirstDigit, newFirstDigit); 105 | Base::Debug::LOG(szString); 106 | #endif 107 | } 108 | } 109 | 110 | /* 111 | short userid user ID who died 112 | short attacker user ID who killed 113 | short assister user ID who assisted in the kill 114 | bool headshot singals a headshot 115 | */ 116 | 117 | if (strcmp(szEventName, sXor2.data()) == 0) 118 | { 119 | for (int i = 0; i < g_healthInfo.size(); i++) 120 | { 121 | if (g_healthInfo[i].targetId == event->GetInt(sXor5.data(), 0)) 122 | g_healthInfo[i].animTimer = 0, g_healthInfo[i].damage = 0, g_healthInfo[i].targetId = 0; 123 | } 124 | } 125 | 126 | if (strcmp(szEventName, sXor3.data()) == 0) 127 | { 128 | g_healthInfo.clear(); 129 | } 130 | 131 | } 132 | 133 | void cGameEventManager::RegisterSelf() 134 | { 135 | static std::string sXor = /*player_hurt*/XorStr<0x7D,12,0x427069F4>("\x0D\x12\x1E\xF9\xE4\xF0\xDC\xEC\xF0\xF4\xF3"+0x427069F4).s; 136 | static std::string sXor2 = /*player_death*/XorStr<0x72,13,0x2C0196D0>("\x02\x1F\x15\x0C\x13\x05\x27\x1D\x1F\x1A\x08\x15"+0x2C0196D0).s; 137 | static std::string sXor3 = /*round_start*/XorStr<0x76,12,0xE9B186D0>("\x04\x18\x0D\x17\x1E\x24\x0F\x09\x1F\x0D\xF4"+0xE9B186D0).s; 138 | 139 | g_Valve.pGameEventManager->AddListener(this, sXor.data(), false); 140 | g_Valve.pGameEventManager->AddListener(this, sXor2.data(), false); 141 | g_Valve.pGameEventManager->AddListener(this, sXor3.data(), false); 142 | } 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /CGameEventManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _CGAMEEVENTMANAGER_H_ 2 | #define _CGAMEEVENTMANAGER_H_ 3 | 4 | class cGameEventManager : public ValveSDK::IGameEventListener2 5 | { 6 | public: 7 | void FireGameEvent(ValveSDK::IGameEvent *event); 8 | void RegisterSelf(); 9 | 10 | }; 11 | 12 | extern cGameEventManager gGameEventManager; 13 | 14 | 15 | #endif -------------------------------------------------------------------------------- /CGameMovement.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CGameMovement 4 | { 5 | public: 6 | void ProcessMovement(CBaseEntity *pPlayer, PVOID moveData) 7 | { 8 | typedef void(__thiscall* OriginalFn)(PVOID, CBaseEntity *pPlayer, PVOID moveData); 9 | getvfunc(this, 1)(this, pPlayer, moveData); 10 | } 11 | }; 12 | } -------------------------------------------------------------------------------- /CGlobalVars.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CGlobalVars 4 | { 5 | public: 6 | float realtime; 7 | int framecount; 8 | float absoluteframetime; 9 | //float fNew; 10 | float curtime; 11 | float frametime; 12 | int maxclients; 13 | int tickcount; 14 | float interval_per_tick; 15 | float interpolation_amount; 16 | int simTicksThisFrame; 17 | int network_protocol; 18 | PVOID pSaveData; 19 | bool m_bClient; 20 | int nTimestampNetworkingBase; 21 | int nTimestampRandomizeWindow; 22 | }; 23 | } -------------------------------------------------------------------------------- /CInput.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | enum 4 | { 5 | JOYSTICK_MAX_BUTTON_COUNT = 32, 6 | JOYSTICK_POV_BUTTON_COUNT = 4, 7 | JOYSTICK_AXIS_BUTTON_COUNT = 12, 8 | }; 9 | 10 | #define JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_BUTTON + ((_joystick) * JOYSTICK_MAX_BUTTON_COUNT) + (_button) ) 11 | #define JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_POV_BUTTON + ((_joystick) * JOYSTICK_POV_BUTTON_COUNT) + (_button) ) 12 | #define JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_AXIS_BUTTON + ((_joystick) * JOYSTICK_AXIS_BUTTON_COUNT) + (_button) ) 13 | 14 | #define JOYSTICK_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) ) 15 | #define JOYSTICK_POV_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) ) 16 | #define JOYSTICK_AXIS_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) ) 17 | 18 | enum ButtonCode_t 19 | { 20 | BUTTON_CODE_INVALID = -1, 21 | BUTTON_CODE_NONE = 0, 22 | 23 | KEY_FIRST = 0, 24 | 25 | KEY_NONE = KEY_FIRST, 26 | KEY_0, 27 | KEY_1, 28 | KEY_2, 29 | KEY_3, 30 | KEY_4, 31 | KEY_5, 32 | KEY_6, 33 | KEY_7, 34 | KEY_8, 35 | KEY_9, 36 | KEY_A, 37 | KEY_B, 38 | KEY_C, 39 | KEY_D, 40 | KEY_E, 41 | KEY_F, 42 | KEY_G, 43 | KEY_H, 44 | KEY_I, 45 | KEY_J, 46 | KEY_K, 47 | KEY_L, 48 | KEY_M, 49 | KEY_N, 50 | KEY_O, 51 | KEY_P, 52 | KEY_Q, 53 | KEY_R, 54 | KEY_S, 55 | KEY_T, 56 | KEY_U, 57 | KEY_V, 58 | KEY_W, 59 | KEY_X, 60 | KEY_Y, 61 | KEY_Z, 62 | KEY_PAD_0, 63 | KEY_PAD_1, 64 | KEY_PAD_2, 65 | KEY_PAD_3, 66 | KEY_PAD_4, 67 | KEY_PAD_5, 68 | KEY_PAD_6, 69 | KEY_PAD_7, 70 | KEY_PAD_8, 71 | KEY_PAD_9, 72 | KEY_PAD_DIVIDE, 73 | KEY_PAD_MULTIPLY, 74 | KEY_PAD_MINUS, 75 | KEY_PAD_PLUS, 76 | KEY_PAD_ENTER, 77 | KEY_PAD_DECIMAL, 78 | KEY_LBRACKET, 79 | KEY_RBRACKET, 80 | KEY_SEMICOLON, 81 | KEY_APOSTROPHE, 82 | KEY_BACKQUOTE, 83 | KEY_COMMA, 84 | KEY_PERIOD, 85 | KEY_SLASH, 86 | KEY_BACKSLASH, 87 | KEY_MINUS, 88 | KEY_EQUAL, 89 | KEY_ENTER, 90 | KEY_SPACE, 91 | KEY_BACKSPACE, 92 | KEY_TAB, 93 | KEY_CAPSLOCK, 94 | KEY_NUMLOCK, 95 | KEY_ESCAPE, 96 | KEY_SCROLLLOCK, 97 | KEY_INSERT, 98 | KEY_DELETE, 99 | KEY_HOME, 100 | KEY_END, 101 | KEY_PAGEUP, 102 | KEY_PAGEDOWN, 103 | KEY_BREAK, 104 | KEY_LSHIFT, 105 | KEY_RSHIFT, 106 | KEY_LALT, 107 | KEY_RALT, 108 | KEY_LCONTROL, 109 | KEY_RCONTROL, 110 | KEY_LWIN, 111 | KEY_RWIN, 112 | KEY_APP, 113 | KEY_UP, 114 | KEY_LEFT, 115 | KEY_DOWN, 116 | KEY_RIGHT, 117 | KEY_F1, 118 | KEY_F2, 119 | KEY_F3, 120 | KEY_F4, 121 | KEY_F5, 122 | KEY_F6, 123 | KEY_F7, 124 | KEY_F8, 125 | KEY_F9, 126 | KEY_F10, 127 | KEY_F11, 128 | KEY_F12, 129 | KEY_CAPSLOCKTOGGLE, 130 | KEY_NUMLOCKTOGGLE, 131 | KEY_SCROLLLOCKTOGGLE, 132 | 133 | KEY_LAST = KEY_SCROLLLOCKTOGGLE, 134 | KEY_COUNT = KEY_LAST - KEY_FIRST + 1, 135 | 136 | // Mouse 137 | MOUSE_FIRST = KEY_LAST + 1, 138 | 139 | MOUSE_LEFT = MOUSE_FIRST, 140 | MOUSE_RIGHT, 141 | MOUSE_MIDDLE, 142 | MOUSE_4, 143 | MOUSE_5, 144 | MOUSE_WHEEL_UP, // A fake button which is 'pressed' and 'released' when the wheel is moved up 145 | MOUSE_WHEEL_DOWN, // A fake button which is 'pressed' and 'released' when the wheel is moved down 146 | 147 | MOUSE_LAST = MOUSE_WHEEL_DOWN, 148 | MOUSE_COUNT = MOUSE_LAST - MOUSE_FIRST + 1, 149 | 150 | // Joystick 151 | JOYSTICK_FIRST = MOUSE_LAST + 1, 152 | 153 | JOYSTICK_FIRST_BUTTON = JOYSTICK_FIRST, 154 | JOYSTICK_LAST_BUTTON = JOYSTICK_BUTTON_INTERNAL( 0, JOYSTICK_MAX_BUTTON_COUNT-1 ), 155 | JOYSTICK_FIRST_POV_BUTTON, 156 | JOYSTICK_LAST_POV_BUTTON = JOYSTICK_POV_BUTTON_INTERNAL( 0, JOYSTICK_POV_BUTTON_COUNT-1 ), 157 | JOYSTICK_FIRST_AXIS_BUTTON, 158 | JOYSTICK_LAST_AXIS_BUTTON = JOYSTICK_AXIS_BUTTON_INTERNAL( 0, JOYSTICK_AXIS_BUTTON_COUNT-1 ), 159 | 160 | JOYSTICK_LAST = JOYSTICK_LAST_AXIS_BUTTON, 161 | 162 | BUTTON_CODE_LAST, 163 | BUTTON_CODE_COUNT = BUTTON_CODE_LAST - KEY_FIRST + 1, 164 | 165 | // Helpers for XBox 360 166 | KEY_XBUTTON_UP = JOYSTICK_FIRST_POV_BUTTON, // POV buttons 167 | KEY_XBUTTON_RIGHT, 168 | KEY_XBUTTON_DOWN, 169 | KEY_XBUTTON_LEFT, 170 | 171 | KEY_XBUTTON_A = JOYSTICK_FIRST_BUTTON, // Buttons 172 | KEY_XBUTTON_B, 173 | KEY_XBUTTON_X, 174 | KEY_XBUTTON_Y, 175 | KEY_XBUTTON_LEFT_SHOULDER, 176 | KEY_XBUTTON_RIGHT_SHOULDER, 177 | KEY_XBUTTON_BACK, 178 | KEY_XBUTTON_START, 179 | KEY_XBUTTON_STICK1, 180 | KEY_XBUTTON_STICK2, 181 | 182 | KEY_XSTICK1_RIGHT = JOYSTICK_FIRST_AXIS_BUTTON, // XAXIS POSITIVE 183 | KEY_XSTICK1_LEFT, // XAXIS NEGATIVE 184 | KEY_XSTICK1_DOWN, // YAXIS POSITIVE 185 | KEY_XSTICK1_UP, // YAXIS NEGATIVE 186 | KEY_XBUTTON_LTRIGGER, // ZAXIS POSITIVE 187 | KEY_XBUTTON_RTRIGGER, // ZAXIS NEGATIVE 188 | KEY_XSTICK2_RIGHT, // UAXIS POSITIVE 189 | KEY_XSTICK2_LEFT, // UAXIS NEGATIVE 190 | KEY_XSTICK2_DOWN, // VAXIS POSITIVE 191 | KEY_XSTICK2_UP, // VAXIS NEGATIVE 192 | }; 193 | 194 | //INPUTw 195 | class CInput 196 | { 197 | public: 198 | class CUserCmd 199 | { 200 | public: 201 | CRC32_t GetChecksum(void) const 202 | { 203 | CRC32_t crc; 204 | CRC32_Init(&crc); 205 | CRC32_ProcessBuffer(&crc, &command_number, sizeof(command_number)); 206 | CRC32_ProcessBuffer(&crc, &tick_count, sizeof(tick_count)); 207 | CRC32_ProcessBuffer(&crc, &viewangles, sizeof(viewangles)); 208 | CRC32_ProcessBuffer(&crc, &forwardmove, sizeof(forwardmove)); 209 | CRC32_ProcessBuffer(&crc, &sidemove, sizeof(sidemove)); 210 | CRC32_ProcessBuffer(&crc, &upmove, sizeof(upmove)); 211 | CRC32_ProcessBuffer(&crc, &buttons, sizeof(buttons)); 212 | CRC32_ProcessBuffer(&crc, &impulse, sizeof(impulse)); 213 | CRC32_ProcessBuffer(&crc, &weaponselect, sizeof(weaponselect)); 214 | CRC32_ProcessBuffer(&crc, &weaponsubtype, sizeof(weaponsubtype)); 215 | CRC32_ProcessBuffer(&crc, &random_seed, sizeof(random_seed)); 216 | CRC32_ProcessBuffer(&crc, &mousedx, sizeof(mousedx)); 217 | CRC32_ProcessBuffer(&crc, &mousedy, sizeof(mousedy)); 218 | CRC32_Final(&crc); 219 | return crc; 220 | } 221 | BYTE u1[4]; 222 | int command_number; 223 | int tick_count; 224 | Vector viewangles; 225 | float forwardmove; 226 | float sidemove; 227 | float upmove; 228 | int buttons; 229 | BYTE impulse; 230 | int weaponselect; 231 | int weaponsubtype; 232 | int random_seed; 233 | short mousedx; 234 | short mousedy; 235 | bool hasbeenpredicted; 236 | }; 237 | 238 | class CVerifiedUserCmd 239 | { 240 | public: 241 | CUserCmd m_cmd; 242 | unsigned long m_crc; 243 | }; 244 | 245 | CUserCmd* GetUserCmd(int seq) 246 | { 247 | typedef CUserCmd* (__thiscall* OriginalFn)(PVOID, int); 248 | return getvfunc(this, 8)(this, seq); 249 | } 250 | }; 251 | } -------------------------------------------------------------------------------- /CMath.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | 4 | 5 | VOID CMath::sinCos(float radians, PFLOAT sine, PFLOAT cosine) 6 | { 7 | __asm 8 | { 9 | fld dword ptr[radians] 10 | fsincos 11 | mov edx, dword ptr[cosine] 12 | mov eax, dword ptr[sine] 13 | fstp dword ptr[edx] 14 | fstp dword ptr[eax] 15 | } 16 | } 17 | 18 | VOID CMath::angleVectors(PFLOAT angles, PFLOAT f, PFLOAT r, PFLOAT u) 19 | { 20 | float sp, sy, sr, cp, cy, cr; 21 | 22 | sinCos(DEG2RAD(angles[0]), &sp, &cp); 23 | sinCos(DEG2RAD(angles[1]), &sy, &cy); 24 | sinCos(DEG2RAD(angles[2]), &sr, &cr); 25 | 26 | f[0] = cp * cy; 27 | f[1] = cp * sy; 28 | f[2] = -sp; 29 | 30 | r[0] = -1.0f * sr * sp * cy + -1.0f * cr * -sy; 31 | r[1] = -1.0f * sr * sp * sy + -1.0f * cr * cy; 32 | r[2] = -1.0f * sr * cp; 33 | 34 | u[0] = cr * sp * cy + -sr * -sy; 35 | u[1] = cr * sp * sy + -sr * cy; 36 | u[2] = cr * cp; 37 | } 38 | 39 | float CMath::sseSqrt(float x) 40 | { 41 | float root = 0.0f; 42 | 43 | __asm 44 | { 45 | sqrtss xmm0, x 46 | movss root, xmm0 47 | } 48 | 49 | return root; 50 | } 51 | 52 | void CMath::vectorAngles(float* forward, float* angles) 53 | { 54 | if (forward[1] == 0.0f && forward[0] == 0.0f) 55 | { 56 | angles[0] = (forward[2] > 0.0f) ? 270.0f : 90.0f; 57 | angles[1] = 0.0f; 58 | } 59 | else 60 | { 61 | float len2d = sseSqrt(square(forward[0]) + square(forward[1])); 62 | 63 | angles[0] = RAD2DEG(atan2f(-forward[2], len2d)); 64 | angles[1] = RAD2DEG(atan2f(forward[1], forward[0])); 65 | 66 | if (angles[0] < 0.0f) angles[0] += 360.0f; 67 | if (angles[1] < 0.0f) angles[1] += 360.0f; 68 | } 69 | 70 | angles[2] = 0.0f; 71 | } 72 | 73 | float CMath::AngleNormalize(float angle) 74 | { 75 | while (angle < -180) angle += 360; 76 | while (angle > 180) angle -= 360; 77 | 78 | return angle; 79 | } 80 | 81 | float CMath::DotProduct(const float *v1, const float *v2) 82 | { 83 | return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; 84 | } 85 | 86 | VOID CMath::VectorTransform(const Vector in1, const matrix3x4_t& in2, Vector& out) 87 | { 88 | float buf[3]; 89 | buf[0] = in1.x; 90 | buf[1] = in1.y; 91 | buf[2] = in1.z; 92 | 93 | out[0] = DotProduct(buf, in2[0]) + in2[0][3]; 94 | out[1] = DotProduct(buf, in2[1]) + in2[1][3]; 95 | out[2] = DotProduct(buf, in2[2]) + in2[2][3]; 96 | } 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /CMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PI 3.14159265358979323846f 4 | #define DEG2RAD( x ) ( ( float )( x ) * ( float )( ( float )( PI ) / 180.0f ) ) 5 | #define RAD2DEG( x ) ( ( float )( x ) * ( float )( 180.0f / ( float )( PI ) ) ) 6 | #define square( x ) ( x * x ) 7 | 8 | struct matrix3x4_t 9 | { 10 | matrix3x4_t() {} 11 | matrix3x4_t( 12 | float m00, float m01, float m02, float m03, 13 | float m10, float m11, float m12, float m13, 14 | float m20, float m21, float m22, float m23) 15 | { 16 | m_flMatVal[0][0] = m00; m_flMatVal[0][1] = m01; m_flMatVal[0][2] = m02; m_flMatVal[0][3] = m03; 17 | m_flMatVal[1][0] = m10; m_flMatVal[1][1] = m11; m_flMatVal[1][2] = m12; m_flMatVal[1][3] = m13; 18 | m_flMatVal[2][0] = m20; m_flMatVal[2][1] = m21; m_flMatVal[2][2] = m22; m_flMatVal[2][3] = m23; 19 | } 20 | void Init(const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin) 21 | { 22 | m_flMatVal[0][0] = xAxis.x; m_flMatVal[0][1] = yAxis.x; m_flMatVal[0][2] = zAxis.x; m_flMatVal[0][3] = vecOrigin.x; 23 | m_flMatVal[1][0] = xAxis.y; m_flMatVal[1][1] = yAxis.y; m_flMatVal[1][2] = zAxis.y; m_flMatVal[1][3] = vecOrigin.y; 24 | m_flMatVal[2][0] = xAxis.z; m_flMatVal[2][1] = yAxis.z; m_flMatVal[2][2] = zAxis.z; m_flMatVal[2][3] = vecOrigin.z; 25 | } 26 | 27 | matrix3x4_t(const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin) 28 | { 29 | Init(xAxis, yAxis, zAxis, vecOrigin); 30 | } 31 | float *operator[](int i) 32 | { 33 | return m_flMatVal[i]; 34 | } 35 | const float *operator[](int i) const 36 | { 37 | return m_flMatVal[i]; 38 | } 39 | float *Base() 40 | { 41 | return &m_flMatVal[0][0]; 42 | } 43 | const float *Base() const 44 | { 45 | return &m_flMatVal[0][0]; 46 | } 47 | 48 | float m_flMatVal[3][4]; 49 | }; 50 | 51 | class CMath 52 | { 53 | public: 54 | VOID sinCos(float radians, PFLOAT sine, PFLOAT cosine); 55 | VOID angleVectors(PFLOAT angles, PFLOAT f, PFLOAT r, PFLOAT u); 56 | float sseSqrt(float x); 57 | VOID vectorAngles(float* forward, float* angles); 58 | float AngleNormalize(float angle); 59 | float DotProduct(const float *v1, const float *v2); 60 | VOID VectorTransform(const Vector in1, const matrix3x4_t& in2, Vector& out); 61 | 62 | }; 63 | 64 | -------------------------------------------------------------------------------- /CModelInfo.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CModelInfo 4 | { 5 | public: 6 | const char* GetModelName(const model_t* pModel) 7 | { 8 | typedef const char* (__thiscall* OriginalFn)(PVOID, const model_t*); 9 | return getvfunc(this, 3)(this, pModel); 10 | } 11 | 12 | studiohdr_t* GetStudiomodel(const model_t *pModel) 13 | { 14 | typedef studiohdr_t* (__thiscall* OriginalFn)(PVOID, const model_t*); 15 | return getvfunc< OriginalFn >(this, 28)(this, pModel); 16 | } 17 | 18 | void GetModelMaterials(const model_t *pModel, int count, IMaterial** ppMaterial) 19 | { 20 | typedef void (__thiscall* OriginalFn)(PVOID, const model_t*, int, IMaterial**); 21 | getvfunc< OriginalFn >(this, 16)(this, pModel, count, ppMaterial); 22 | } 23 | }; 24 | } -------------------------------------------------------------------------------- /CNoSpread.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | CMath g_Math; 4 | 5 | void sinCos(float radians, PFLOAT sine, PFLOAT cosine) 6 | { 7 | __asm 8 | { 9 | fld dword ptr[radians] 10 | fsincos 11 | mov edx, dword ptr[cosine] 12 | mov eax, dword ptr[sine] 13 | fstp dword ptr[edx] 14 | fstp dword ptr[eax] 15 | } 16 | } 17 | 18 | #define DEG2RAD( x ) ( ( float )( x ) * ( float )( ( float )( PI ) / 180.0f ) ) 19 | #define RAD2DEG( x ) ( ( float )( x ) * ( float )( 180.0f / ( float )( PI ) ) ) 20 | #define square( x ) ( x * x ) 21 | 22 | void CNoSpread::angleVectors(Vector angles, Vector &f, Vector &r, Vector &u) 23 | { 24 | float sp, sy, sr, cp, cy, cr; 25 | 26 | sinCos(DEG2RAD(angles[0]), &sp, &cp); 27 | sinCos(DEG2RAD(angles[1]), &sy, &cy); 28 | sinCos(DEG2RAD(angles[2]), &sr, &cr); 29 | 30 | f[0] = cp * cy; 31 | f[1] = cp * sy; 32 | f[2] = -sp; 33 | 34 | r[0] = -1.0f * sr * sp * cy + -1.0f * cr * -sy; 35 | r[1] = -1.0f * sr * sp * sy + -1.0f * cr * cy; 36 | r[2] = -1.0f * sr * cp; 37 | 38 | u[0] = cr * sp * cy + -sr * -sy; 39 | u[1] = cr * sp * sy + -sr * cy; 40 | u[2] = cr * cp; 41 | } 42 | 43 | void CNoSpread::angleVectors(Vector angles, Vector &f) 44 | { 45 | float sp, sy, sr, cp, cy, cr; 46 | 47 | sinCos(DEG2RAD(angles[0]), &sp, &cp); 48 | sinCos(DEG2RAD(angles[1]), &sy, &cy); 49 | sinCos(DEG2RAD(angles[2]), &sr, &cr); 50 | 51 | f[0] = cp * cy; 52 | f[1] = cp * sy; 53 | f[2] = -sp; 54 | } 55 | 56 | float sseSqrt(float x) 57 | { 58 | float root = 0.0f; 59 | 60 | __asm 61 | { 62 | sqrtss xmm0, x 63 | movss root, xmm0 64 | } 65 | 66 | return root; 67 | } 68 | 69 | void CNoSpread::vectorAngles(Vector forward, Vector &angles) 70 | { 71 | if (forward[1] == 0.0f && forward[0] == 0.0f) 72 | { 73 | angles[0] = (forward[2] > 0.0f) ? 270.0f : 90.0f; 74 | angles[1] = 0.0f; 75 | } 76 | else 77 | { 78 | float len2d = sseSqrt(square(forward[0]) + square(forward[1])); 79 | 80 | angles[0] = RAD2DEG(atan2f(-forward[2], len2d)); 81 | angles[1] = RAD2DEG(atan2f(forward[1], forward[0])); 82 | 83 | if (angles[0] < 0.0f) angles[0] += 360.0f; 84 | if (angles[1] < 0.0f) angles[1] += 360.0f; 85 | } 86 | 87 | angles[2] = 0.0f; 88 | } 89 | 90 | void VectorAngles(const Vector &forward, const Vector &pseudoup, Vector &angles) 91 | { 92 | Vector left; 93 | 94 | left = CrossProduct( pseudoup, forward ); 95 | left.NormalizeInPlace(); 96 | 97 | float xyDist = sseSqrt( forward[0] * forward[0] + forward[1] * forward[1] ); 98 | 99 | if ( xyDist > 0.001f ) 100 | { 101 | angles[1] = RAD2DEG( atan2f( forward[1], forward[0] ) ); 102 | angles[0] = RAD2DEG( atan2f( -forward[2], xyDist ) ); 103 | 104 | float up_z = (left[1] * forward[0]) - (left[0] * forward[1]); 105 | 106 | angles[2] = RAD2DEG( atan2f( left[2], up_z ) ); 107 | } 108 | else 109 | { 110 | angles[1] = RAD2DEG( atan2f( -left[0], left[1] ) ); 111 | angles[0] = RAD2DEG( atan2f( -forward[2], xyDist ) ); 112 | angles[2] = 0; 113 | } 114 | } 115 | 116 | float CNoSpread::AngleNormalize(float angle) 117 | { 118 | while (angle < -180) angle += 360; 119 | while (angle > 180) angle -= 360; 120 | 121 | return angle; 122 | } 123 | 124 | void CNoSpread::RandomSeed(int iSeed) 125 | { 126 | typedef void(__cdecl* RandomSeed_t)(int); 127 | static RandomSeed_t pRandomSeed = (RandomSeed_t)(GetProcAddress(GetModuleHandle(/*vstdlib*/XorStr<0x54,8,0xFE0933A5>("\x22\x26\x22\x33\x34\x30\x38"+0xFE0933A5).s), /*RandomSeed*/XorStr<0xFB,11,0x36C577CD>("\xA9\x9D\x93\x9A\x90\x6D\x52\x67\x66\x60"+0x36C577CD).s)); 128 | pRandomSeed(iSeed); 129 | } 130 | 131 | float CNoSpread::RandomFloat(float fMin, float fMax) 132 | { 133 | typedef float(__cdecl* RandomFloat_t)(float, float); 134 | static RandomFloat_t pRandomFloat = (RandomFloat_t)(GetProcAddress(GetModuleHandle(/*vstdlib*/XorStr<0x54,8,0xFE0933A5>("\x22\x26\x22\x33\x34\x30\x38"+0xFE0933A5).s), /*RandomFloat*/XorStr<0x79,12,0x49861C66>("\x2B\x1B\x15\x18\x12\x13\x39\xEC\xEE\xE3\xF7"+0x49861C66).s)); 135 | return pRandomFloat(fMin, fMax); 136 | } 137 | 138 | void CNoSpread::GetRollSpreadFix(ValveSDK::CBaseCombatWeapon *m_pWeapon, UINT seed, Vector& pflInAngles) 139 | { 140 | pflInAngles.x = AngleNormalize(pflInAngles.x); 141 | pflInAngles.y = AngleNormalize(pflInAngles.y); 142 | 143 | RandomSeed((seed & 0xFF) + 1); 144 | float flA = RandomFloat(0.0f, 6.283185f); 145 | float flB = RandomFloat(0.0f, m_pWeapon->GetSpread()); 146 | float flC = RandomFloat(0.0f, 6.283185f); 147 | float flD = RandomFloat(0.0f, m_pWeapon->GetCone()); 148 | 149 | Vector vForward,vRight,vUp,vDir; 150 | Vector vView,vSpread, flIdentity[3]; 151 | float flRoll, flCross; 152 | 153 | vSpread.x = (cos(flA) * flB) + (cos(flC) * flD); 154 | vSpread.y = (sin(flA) * flB) + (sin(flC) * flD); 155 | 156 | Vector qViewAngles = pflInAngles; 157 | 158 | vSpread[0] = -vSpread[0]; 159 | vSpread[1] = -vSpread[1]; 160 | 161 | angleVectors( qViewAngles, vForward, vRight, vUp ); 162 | 163 | vDir[0] = vForward[0] + ( vRight[0] * vSpread[0] ) + ( vUp[0] * vSpread[1] ); 164 | vDir[1] = vForward[1] + ( vRight[1] * vSpread[0] ) + ( vUp[1] * vSpread[1] ); 165 | vDir[2] = vForward[2] + ( vRight[2] * vSpread[0] ) + ( vUp[2] * vSpread[1] ); 166 | 167 | vDir.NormalizeInPlace(); 168 | 169 | flIdentity[2][0] = 1.0f; 170 | flIdentity[2][1] = -vSpread[0]; 171 | flIdentity[2][2] = vSpread[1]; 172 | 173 | flIdentity[2].NormalizeInPlace(); 174 | 175 | flIdentity[0][0] = 0.0f; 176 | flIdentity[0][1] = -vSpread[0]; 177 | flIdentity[0][2] = ( 1.0f / vSpread[1] ) + ( 1.0f / flIdentity[2][2] ) + vSpread[1]; 178 | 179 | if( vSpread[0] > 0.0f && vSpread[1] < 0.0f ) 180 | { 181 | if( flIdentity[0][1] < 0.0f ) 182 | flIdentity[0][1] = -flIdentity[0][1]; 183 | } 184 | else if( vSpread[0] < 0.0f && vSpread[1] < 0.0f ) 185 | { 186 | if( flIdentity[0][1] > 0.0f ) 187 | flIdentity[0][1] = -flIdentity[0][1]; 188 | } 189 | 190 | if( flIdentity[0][2] < 0.0f ) 191 | flIdentity[0][2] = -flIdentity[0][2]; 192 | 193 | flIdentity[0].NormalizeInPlace(); 194 | 195 | flIdentity[1] = CrossProduct( flIdentity[0], flIdentity[2] ); 196 | flIdentity[1].NormalizeInPlace(); 197 | 198 | flCross = ( flIdentity[1][1] * flIdentity[2][0] ) - ( flIdentity[1][0] * flIdentity[2][1] ); 199 | 200 | if( qViewAngles[0] > 84.0f || qViewAngles[0] < -84.0f ) 201 | flRoll = RAD2DEG( atan2f( flIdentity[1][2], sseSqrt( flCross ) ) ); 202 | else 203 | flRoll = RAD2DEG( atan2f( flIdentity[1][2], flCross ) ); 204 | 205 | if( flRoll < 0.0f ) 206 | flRoll += 360.0f; 207 | 208 | VectorAngles( vDir, vUp, pflInAngles ); 209 | pflInAngles[2] += flRoll; 210 | 211 | pflInAngles.x = AngleNormalize(pflInAngles.x); 212 | pflInAngles.y = AngleNormalize(pflInAngles.y); 213 | } 214 | 215 | void CNoSpread::GetSpreadFix(ValveSDK::CBaseCombatWeapon *m_pWeapon, UINT seed, Vector& pflInAngles) 216 | { 217 | pflInAngles.x = AngleNormalize(pflInAngles.x); 218 | pflInAngles.y = AngleNormalize(pflInAngles.y); 219 | 220 | RandomSeed((seed & 0xFF) + 1); 221 | float flA = RandomFloat(0.0f, 6.283185f); 222 | float flB = RandomFloat(0.0f, m_pWeapon->GetSpread()); 223 | float flC = RandomFloat(0.0f, 6.283185f); 224 | float flD = RandomFloat(0.0f, m_pWeapon->GetCone()); 225 | 226 | Vector vForward,vRight,vUp,vDir; 227 | Vector vView,vSpread; 228 | 229 | vSpread.x = (cos(flA) * flB) + (cos(flC) * flD); 230 | vSpread.y = (sin(flA) * flB) + (sin(flC) * flD); 231 | 232 | Vector qAng = pflInAngles; 233 | 234 | Vector qDifference; 235 | Vector EstimatedViewAngles; 236 | 237 | float fDiff = 0.0f; 238 | float fDiffOld = 180.0f; 239 | 240 | for ( ;; ) 241 | { 242 | angleVectors(pflInAngles,vForward,vRight,vUp); 243 | 244 | vDir.x = vForward.x + vSpread.x * vRight.x + vSpread.y * vUp.x; 245 | vDir.y = vForward.y + vSpread.x * vRight.y + vSpread.y * vUp.y; 246 | vDir.z = vForward.z + vSpread.x * vRight.z + vSpread.y * vUp.z; 247 | 248 | vView.x = 8192.0f * vDir.x; 249 | vView.y = 8192.0f * vDir.y; 250 | vView.z = 8192.0f * vDir.z; 251 | 252 | vectorAngles(vView,EstimatedViewAngles); 253 | 254 | EstimatedViewAngles.x = AngleNormalize(EstimatedViewAngles.x); 255 | EstimatedViewAngles.y = AngleNormalize(EstimatedViewAngles.y); 256 | 257 | qDifference = qAng - EstimatedViewAngles; 258 | 259 | qDifference.x = AngleNormalize(qDifference.x); 260 | qDifference.y = AngleNormalize(qDifference.y); 261 | 262 | fDiff = sqrt((qDifference.x * qDifference.x) + (qDifference.y * qDifference.y)); 263 | 264 | if((fDiff <= 0.001f) || (fDiff >= fDiffOld)) 265 | break; 266 | 267 | fDiffOld = fDiff; 268 | 269 | pflInAngles += qDifference; 270 | 271 | pflInAngles.x = AngleNormalize(pflInAngles.x); 272 | pflInAngles.y = AngleNormalize(pflInAngles.y); 273 | } 274 | } 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | -------------------------------------------------------------------------------- /CNoSpread.h: -------------------------------------------------------------------------------- 1 | class CNoSpread 2 | { 3 | public: 4 | void GetSpreadFix(ValveSDK::CBaseCombatWeapon *m_pWeapon, UINT seed, Vector& pflInAngles); 5 | void GetRollSpreadFix(ValveSDK::CBaseCombatWeapon *m_pWeapon, UINT seed, Vector& pflInAngles); 6 | 7 | void angleVectors(Vector angles, Vector &f, Vector &r, Vector &u); 8 | void angleVectors(Vector angles, Vector &f); 9 | void vectorAngles(Vector forward, Vector &angles); 10 | float AngleNormalize(float angle); 11 | void RandomSeed(int iSeed); 12 | float RandomFloat(float fMin, float fMax); 13 | }; 14 | extern CNoSpread g_NoSpread; -------------------------------------------------------------------------------- /CPrediction.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class CPrediction 4 | { 5 | public: 6 | void SetupMove(CBaseEntity *player, ValveSDK::CInput::CUserCmd *ucmd, PVOID movehelper, PVOID moveData) 7 | { 8 | typedef void(__thiscall* OriginalFn)(PVOID, CBaseEntity*, ValveSDK::CInput::CUserCmd*, PVOID, PVOID); 9 | getvfunc(this, 18)(this, player, ucmd, movehelper, moveData); 10 | } 11 | 12 | void FinishMove(CBaseEntity *player, ValveSDK::CInput::CUserCmd *ucmd, PVOID moveData) 13 | { 14 | typedef void(__thiscall* OriginalFn)(PVOID, CBaseEntity*, ValveSDK::CInput::CUserCmd*, PVOID); 15 | getvfunc(this, 19)(this, player, ucmd, moveData); 16 | } 17 | }; 18 | } -------------------------------------------------------------------------------- /CSSBase.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {B47833C2-CC00-4490-A751-A16553374E0E} 24 | Win32Proj 25 | 10.0.16299.0 26 | INTERWEBZ CSS (fixed by Shaxzy) 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v141 33 | 34 | 35 | DynamicLibrary 36 | false 37 | v141 38 | 39 | 40 | Application 41 | true 42 | v141 43 | 44 | 45 | Application 46 | false 47 | v141 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | true 69 | css 70 | 71 | 72 | true 73 | $(LibraryPath) 74 | css 75 | .. 76 | 77 | 78 | 79 | WIN32;_DEBUG;_WINDOWS;_USRDLL;CSSBASE_EXPORTS;%(PreprocessorDefinitions) 80 | MultiThreadedDebugDLL 81 | Level3 82 | ProgramDatabase 83 | Disabled 84 | 85 | 86 | MachineX86 87 | true 88 | Windows 89 | 90 | 91 | 92 | 93 | WIN32;NDEBUG;_WINDOWS;_USRDLL;CSSBASE_EXPORTS;%(PreprocessorDefinitions) 94 | MultiThreadedDLL 95 | Level3 96 | ProgramDatabase 97 | 98 | 99 | MachineX86 100 | true 101 | Windows 102 | true 103 | true 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /CSSBase.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Header Files 88 | 89 | 90 | Header Files 91 | 92 | 93 | Header Files 94 | 95 | 96 | Header Files 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | Header Files 118 | 119 | 120 | Header Files 121 | 122 | 123 | Header Files 124 | 125 | 126 | Header Files 127 | 128 | 129 | Header Files 130 | 131 | 132 | Header Files 133 | 134 | 135 | Header Files 136 | 137 | 138 | Header Files 139 | 140 | 141 | Header Files 142 | 143 | 144 | Header Files 145 | 146 | 147 | Header Files 148 | 149 | 150 | Header Files 151 | 152 | 153 | Header Files 154 | 155 | 156 | Header Files 157 | 158 | 159 | Header Files 160 | 161 | 162 | Header Files 163 | 164 | 165 | Header Files 166 | 167 | 168 | Header Files 169 | 170 | 171 | Header Files 172 | 173 | 174 | Header Files 175 | 176 | 177 | Header Files 178 | 179 | 180 | Header Files 181 | 182 | 183 | Header Files 184 | 185 | 186 | Header Files 187 | 188 | 189 | Header Files 190 | 191 | 192 | Header Files 193 | 194 | 195 | Header Files 196 | 197 | 198 | Header Files 199 | 200 | 201 | Header Files 202 | 203 | 204 | Header Files 205 | 206 | 207 | Header Files 208 | 209 | 210 | Header Files 211 | 212 | 213 | Header Files 214 | 215 | 216 | Header Files 217 | 218 | 219 | Header Files 220 | 221 | 222 | -------------------------------------------------------------------------------- /CSSBase.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /CTrace.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | struct surfacephysicsparams_t 4 | { 5 | // vphysics physical properties 6 | float friction; 7 | float elasticity; // collision elasticity - used to compute coefficient of restitution 8 | float density; // physical density (in kg / m^3) 9 | float thickness; // material thickness if not solid (sheet materials) in inches 10 | float dampening; 11 | }; 12 | 13 | struct surfaceaudioparams_t 14 | { 15 | // sounds / audio data 16 | float reflectivity; // like elasticity, but how much sound should be reflected by this surface 17 | float hardnessFactor; // like elasticity, but only affects impact sound choices 18 | float roughnessFactor; // like friction, but only affects scrape sound choices 19 | 20 | // audio thresholds 21 | float roughThreshold; // surface roughness > this causes "rough" scrapes, < this causes "smooth" scrapes 22 | float hardThreshold; // surface hardness > this causes "hard" impacts, < this causes "soft" impacts 23 | float hardVelocityThreshold; // collision velocity > this causes "hard" impacts, < this causes "soft" impacts 24 | // NOTE: Hard impacts must meet both hardnessFactor AND velocity thresholds 25 | }; 26 | 27 | struct surfacesoundnames_t 28 | { 29 | unsigned short stepleft; 30 | unsigned short stepright; 31 | 32 | unsigned short impactSoft; 33 | unsigned short impactHard; 34 | 35 | unsigned short scrapeSmooth; 36 | unsigned short scrapeRough; 37 | 38 | unsigned short bulletImpact; 39 | unsigned short rolling; 40 | 41 | unsigned short breakSound; 42 | unsigned short strainSound; 43 | }; 44 | 45 | struct surfacesoundhandles_t 46 | { 47 | short stepleft; 48 | short stepright; 49 | 50 | short impactSoft; 51 | short impactHard; 52 | 53 | short scrapeSmooth; 54 | short scrapeRough; 55 | 56 | short bulletImpact; 57 | short rolling; 58 | 59 | short breakSound; 60 | short strainSound; 61 | }; 62 | 63 | struct surfacegameprops_t 64 | { 65 | // game movement data 66 | float maxSpeedFactor; // Modulates player max speed when walking on this surface 67 | float jumpFactor; // Indicates how much higher the player should jump when on the surface 68 | // Game-specific data 69 | unsigned short material; 70 | 71 | // Indicates whether or not the player is on a ladder. 72 | unsigned char climbable; 73 | unsigned char pad; 74 | }; 75 | 76 | struct surfacedata_t 77 | { 78 | surfacephysicsparams_t physics; // physics parameters 79 | surfaceaudioparams_t audio; // audio parameters 80 | surfacesoundnames_t sounds; // names of linked sounds 81 | surfacegameprops_t game; // Game data / properties 82 | 83 | surfacesoundhandles_t soundhandles; 84 | }; 85 | 86 | class IPhysicsSurfaceProps 87 | { 88 | public: 89 | surfacedata_t *GetSurfaceData(int surfaceDataIndex) 90 | { 91 | typedef surfacedata_t*(__thiscall* OriginalFn)(PVOID, int); 92 | return getvfunc(this, 5)(this, surfaceDataIndex); 93 | } 94 | }; 95 | 96 | class CTrace 97 | { 98 | public: 99 | enum TraceType_t 100 | { 101 | TRACE_EVERYTHING = 0, 102 | TRACE_WORLD_ONLY, // NOTE: This does *not* test static props!!! 103 | TRACE_ENTITIES_ONLY, // NOTE: This version will *not* test static props 104 | TRACE_EVERYTHING_FILTER_PROPS, // NOTE: This version will pass the IHandleEntity for props through the filter, unlike all other filters 105 | }; 106 | 107 | struct cplane_t 108 | { 109 | Vector normal; 110 | float dist; 111 | BYTE type; 112 | BYTE signBits; 113 | BYTE pad[2]; 114 | }; 115 | 116 | struct csurface_t 117 | { 118 | const char* name; 119 | short surfaceProps; 120 | unsigned short flags; 121 | }; 122 | 123 | struct Ray_t 124 | { 125 | VectorAligned m_Start; // starting point, centered within the extents 126 | VectorAligned m_Delta; // direction + length of the ray 127 | VectorAligned m_StartOffset; // Add this to m_Start to get the actual ray start 128 | VectorAligned m_Extents; // Describes an axis aligned box extruded along a ray 129 | bool m_IsRay; // are the extents zero? 130 | bool m_IsSwept; // is delta != 0? 131 | 132 | void Init( Vector const& start, Vector const& end ) 133 | { 134 | VectorSubtract( end, start, m_Delta ); 135 | 136 | m_IsSwept = (m_Delta.LengthSqr() != 0); 137 | 138 | VectorClear( m_Extents ); 139 | m_IsRay = true; 140 | 141 | // Offset m_Start to be in the center of the box... 142 | VectorClear( m_StartOffset ); 143 | VectorCopy( start, m_Start ); 144 | } 145 | 146 | void Init( Vector const& start, Vector const& end, Vector const& mins, Vector const& maxs ) 147 | { 148 | VectorSubtract( end, start, m_Delta ); 149 | 150 | m_IsSwept = (m_Delta.LengthSqr() != 0); 151 | 152 | VectorSubtract( maxs, mins, m_Extents ); 153 | m_Extents *= 0.5f; 154 | m_IsRay = (m_Extents.LengthSqr() < 1e-6); 155 | 156 | // Offset m_Start to be in the center of the box... 157 | VectorAdd( mins, maxs, m_StartOffset ); 158 | m_StartOffset *= 0.5f; 159 | VectorAdd( start, m_StartOffset, m_Start ); 160 | m_StartOffset *= -1.0f; 161 | } 162 | 163 | // compute inverse delta 164 | Vector InvDelta() const 165 | { 166 | Vector vecInvDelta; 167 | for ( int iAxis = 0; iAxis < 3; ++iAxis ) 168 | { 169 | if ( m_Delta[iAxis] != 0.0f ) 170 | { 171 | vecInvDelta[iAxis] = 1.0f / m_Delta[iAxis]; 172 | } 173 | else 174 | { 175 | vecInvDelta[iAxis] = FLT_MAX; 176 | } 177 | } 178 | return vecInvDelta; 179 | } 180 | 181 | private: 182 | }; 183 | 184 | struct trace_t 185 | { 186 | Vector start; 187 | Vector endpos; 188 | cplane_t plane; 189 | float fraction; 190 | int contents; 191 | WORD dispFlags; 192 | bool allSolid; 193 | bool startSolid; 194 | float fractionLeftSolid; 195 | csurface_t surface; 196 | int hitgroup; 197 | short physicsBone; 198 | CBaseEntity* m_pEnt; 199 | int hitbox; 200 | }; 201 | 202 | class IHandleEntity 203 | { 204 | public: 205 | virtual ~IHandleEntity() {} 206 | virtual void Func01() = 0; 207 | virtual void Func02() = 0; 208 | }; 209 | 210 | class ITraceFilter 211 | { 212 | public: 213 | virtual bool ShouldHitEntity( IHandleEntity *pEntity, int contentsMask ) = 0; 214 | virtual TraceType_t GetTraceType() const = 0; 215 | }; 216 | 217 | class CTraceFilter : public ITraceFilter 218 | { 219 | public: 220 | virtual TraceType_t GetTraceType() const 221 | { 222 | return TRACE_EVERYTHING; 223 | } 224 | }; 225 | 226 | class CSimpleTraceFilter : public ITraceFilter 227 | { 228 | public: 229 | CSimpleTraceFilter(PVOID pEnt) 230 | { 231 | m_pPassEnt = pEnt; 232 | } 233 | 234 | virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) 235 | { 236 | return pHandleEntity != m_pPassEnt; 237 | } 238 | 239 | virtual TraceType_t GetTraceType() const 240 | { 241 | return TRACE_EVERYTHING; 242 | } 243 | 244 | PVOID m_pPassEnt; 245 | }; 246 | 247 | class CTraceFilterSkipTwoEnts : public ITraceFilter 248 | { 249 | public: 250 | CTraceFilterSkipTwoEnts(PVOID pEnt,PVOID pEnt2) 251 | { 252 | m_pPassEnt = pEnt; 253 | m_pPassEnt2 = pEnt2; 254 | } 255 | 256 | virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ) 257 | { 258 | return (pHandleEntity != m_pPassEnt && pHandleEntity != m_pPassEnt2); 259 | } 260 | 261 | virtual TraceType_t GetTraceType() const 262 | { 263 | return TRACE_EVERYTHING; 264 | } 265 | 266 | PVOID m_pPassEnt; 267 | PVOID m_pPassEnt2; 268 | }; 269 | 270 | class IClientUnknown : public IHandleEntity 271 | { 272 | public: 273 | virtual PVOID GetCollideable() = 0; 274 | virtual PVOID GetClientNetworkable() = 0; 275 | virtual PVOID GetClientRenderable() = 0; 276 | virtual PVOID GetIClientEntity() = 0; 277 | virtual CBaseEntity *GetBaseEntity() = 0; 278 | virtual PVOID GetClientThinkable() = 0; 279 | virtual void *class1(void) = 0; 280 | virtual void *class2(void) = 0; 281 | }; 282 | 283 | class CTraceFilterNoPlayer : public CTraceFilter 284 | { 285 | public: 286 | CTraceFilterNoPlayer() {} 287 | virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask ) 288 | { 289 | IClientUnknown *pUnk = (IClientUnknown*)pServerEntity; 290 | CBaseEntity *pEnt = pUnk->GetBaseEntity(); 291 | return !pEnt->IsPlayer(); 292 | } 293 | }; 294 | 295 | int GetPointContents( const Vector &vecAbsPosition, IHandleEntity** ppEntity = NULL ) 296 | { 297 | typedef int(__thiscall* OriginalFn)(PVOID, const Vector &, IHandleEntity**); 298 | return getvfunc(this, 0)(this, vecAbsPosition, ppEntity); 299 | } 300 | 301 | void TraceRay(const Ray_t &ray, unsigned int flMask, ITraceFilter *pTraceFilter, trace_t *ptrace) 302 | { 303 | typedef void(__thiscall* OriginalFn)(PVOID, const Ray_t &, unsigned int, ITraceFilter *, trace_t *); 304 | getvfunc(this, 4)(this, ray, flMask, pTraceFilter, ptrace); 305 | } 306 | }; 307 | } -------------------------------------------------------------------------------- /CVARS.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | cCVARS g_CVARS; 4 | 5 | std::string CvarNames[MAX_CVARS]; 6 | 7 | void cCVARS::Init(HMODULE hinstDLL) 8 | { 9 | //GetModuleFileName(hinstDLL,g_CVARS.szIniFilePath,2048); 10 | 11 | for(int i = strlen(g_CVARS.szIniFilePath); i > 0; i--) 12 | { 13 | if(g_CVARS.szIniFilePath[i] == '\\') 14 | { 15 | g_CVARS.szIniFilePath[i+1] = 0; 16 | break;//break loop so we dont delete everything 17 | } 18 | } 19 | 20 | for(int i = 0; i < MAX_CVARS; i++) 21 | { 22 | char szName[10]; 23 | sprintf(szName,/*[var%i]*/XorStr<0xC0,8,0x685B0EEB>("\x9B\xB7\xA3\xB1\xE1\xAC\x9B"+0x685B0EEB).s,i); 24 | CvarNames[i] = szName; 25 | } 26 | } 27 | 28 | //example: 29 | //szPublicHtmlURL - should be for example "yoursite.com" (without http:// and www.) 30 | //szURLPath - should be for example "kolo.php" (so this would mean yoursite.com/kolo.php) 31 | //szURLPath - you can also assign it with something like "hehe/kolo.php" (this would result in a url of yoursite.com/hehe/kolo.php) 32 | //return value - a byte array of any kind of data received from the url (binary data, text,...) 33 | __forceinline void Winsock_StreamOnlineDataToMemory(char *szPublicHtmlURL, char *szURLPath, std::string &out) 34 | { 35 | g_Winsock.InitWinsock(); 36 | g_Winsock.Connect(szPublicHtmlURL); 37 | g_Winsock.SendHttpGet(szURLPath,out); 38 | g_Winsock.Disconnect(); 39 | g_Winsock.CleanUp(); 40 | } 41 | 42 | //kolonote: 43 | //ok time to use my skillz ehi ehi 44 | //note that this is pretty slow soooo 45 | float FindVarValue(const char *szTextArray, const char *pszVarName) 46 | { 47 | int iLen = strlen(pszVarName) - 1; 48 | 49 | for(int i = 0; i < strlen(szTextArray); i++) 50 | { 51 | //first character matches but we gotta check if whole word matches 52 | if(szTextArray[i] == pszVarName[0]) 53 | { 54 | bool bSkipThis = false; 55 | 56 | for(int i2 = 0; i2 <= iLen; i2++) 57 | { 58 | //we already checked for first character in the array 59 | if(i2 == 0) 60 | continue; 61 | 62 | if(szTextArray[i+i2] != pszVarName[i2]) 63 | { 64 | bSkipThis = true; 65 | break;//ok not our string lets skip this one 66 | } 67 | } 68 | 69 | //something didnt match so lets skip to this one 70 | if(bSkipThis) 71 | continue; 72 | 73 | //everything matches meaning we can retrieve the value now 74 | std::string sOwn = &szTextArray[i+iLen+1];//move 1 more spot as thats where the space is 75 | 76 | return atof(sOwn.data()); 77 | } 78 | } 79 | 80 | return 0.0f; 81 | } 82 | 83 | void cCVARS::HandleConfig(const char *pszConfigName, int iType) 84 | { 85 | //kolonote: 86 | //to save shit were gonna generate a config file 87 | std::string sSavedConfig; 88 | //our file loaded from server 89 | std::string sLoadResponse; 90 | 91 | HW_PROFILE_INFO hwProfileInfo; 92 | 93 | //REMEMBER: TEMPORARY 94 | //this is utter shit but i didnt find a quicker way for unique identification and i need it to store configs for different users on server 95 | GetCurrentHwProfile(&hwProfileInfo); 96 | 97 | for(int varindex = 0;varindex < MAX_CVARS; varindex++) 98 | { 99 | bool bLastInLoop = (varindex == (MAX_CVARS-1)); 100 | bool bFirstInLoop = (varindex == 0); 101 | 102 | if(iType == LoadConfig && bFirstInLoop) 103 | { 104 | std::string sPath = /*confighandle.php*/XorStr<0x5B,17,0x34079F60>("\x38\x33\x33\x38\x36\x07\x09\x03\x0D\x00\x09\x03\x49\x18\x01\x1A"+0x34079F60).s; 105 | } 106 | 107 | if(iType == SaveConfig) 108 | { 109 | #ifdef DEBUGMODE 110 | if(bFirstInLoop) 111 | { 112 | Base::Debug::LOG(""); 113 | Base::Debug::LOG("Settings Saved!"); 114 | Base::Debug::LOG(""); 115 | } 116 | 117 | char szLog[256]; 118 | sprintf(szLog,"%s = %f",CvarNames[varindex].data(),g_CVARS.CvarList[varindex]); 119 | Base::Debug::LOG(szLog); 120 | #endif 121 | char szBitcho[256]; 122 | sprintf(szBitcho,/*%s%f*/XorStr<0x46,5,0x504F1CD1>("\x63\x34\x6D\x2F"+0x504F1CD1).s,CvarNames[varindex].data(),g_CVARS.CvarList[varindex]); 123 | sSavedConfig += szBitcho; 124 | 125 | if(bLastInLoop) 126 | { 127 | std::string sPath = /*confighandle.php*/XorStr<0x3A,17,0xE30B48FD>("\x59\x54\x52\x5B\x57\x58\x28\x20\x2C\x27\x28\x20\x68\x37\x20\x39"+0xE30B48FD).s; 128 | 129 | 130 | std::string sOut; 131 | 132 | } 133 | 134 | #ifdef DEBUGMODE 135 | if(bLastInLoop) 136 | Base::Debug::LOG(""); 137 | #endif 138 | } 139 | else if(iType == LoadConfig) 140 | { 141 | #ifdef DEBUGMODE 142 | if(bFirstInLoop) 143 | { 144 | Base::Debug::LOG(""); 145 | Base::Debug::LOG("Settings Loaded!"); 146 | Base::Debug::LOG(""); 147 | } 148 | #endif 149 | 150 | g_CVARS.CvarList[varindex] = FindVarValue(sLoadResponse.data(),CvarNames[varindex].data()); 151 | 152 | #ifdef DEBUGMODE 153 | char szLog[256]; 154 | sprintf(szLog,"%s = %f",CvarNames[varindex].data(),g_CVARS.CvarList[varindex]); 155 | Base::Debug::LOG(szLog); 156 | 157 | if(bLastInLoop) 158 | Base::Debug::LOG(""); 159 | #endif 160 | } 161 | } 162 | } 163 | 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /CVARS.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define MAX_CVARS 118 4 | 5 | enum 6 | { 7 | NameESP, HealthESP, NoRecoil, NoSpread, EnableAim, EnableESP, Bunnyhop, Autopistol, AimOnFire, 8 | Autoshoot, SilentAim, AimTeam, AimFOV, PSilent, FakelagAmount, Triggerbot, PTrigger, TriggerBurst, 9 | TriggerHead, TriggerAll, NoVisRecoil, RCS, RCSFOV, RCSSmooth, RCSSpot, SCS, AimSpot, 10 | RCSAimTeam, TriggerSeed, AimHeight, Hitscans, Autowall, HitscanAutowall, Chams, BrightChams, 11 | ESPEnemyOnly, ChamsEnemyOnly, Glow, GlowEnemyOnly, AimKey, TriggerKey, SmoothAim, AimTime, 12 | TargetSelection, AntiDM, IgnoreLegsAndArms, Knifebot, BackstabOnly, AntiAimX, AntiAimY, 13 | Strafebot, XQZ, NoHands, AsusAmount, NoSky, HeadESP, BoxESP, Chams_T_Vis, RESERVED0, 14 | RESERVED1, Chams_T_InVis, RESERVED3, RESERVED4, Chams_CT_Vis, RESERVED6, 15 | RESERVED7, Chams_CT_InVis, RESERVED9, RESERVED10, Glow_T_Vis, RESERVED12, 16 | RESERVED35, Glow_T_InVis, RESERVED24, RESERVED23, Glow_CT_Vis, RESERVED13, 17 | RESERVED34, Glow_CT_InVis, RESERVED25, RESERVED22, Esp_T_Vis, RESERVED14, 18 | RESERVED33, RESERVED30, Esp_T_InVis, RESERVED26, RESERVED21, RESERVED18, Esp_CT_Vis, RESERVED15, 19 | RESERVED32, RESERVED31, Esp_CT_InVis, RESERVED27, RESERVED20, RESERVED19, ModelAlpha, VisChecks, 20 | SmartAim, SMACBot, HelmetESP, BombESP, BombDetonation, GrenadeESP, EntESP, WeaponESP, FlashedESP, 21 | DefuseESP, Radar, RadarX, RadarY, RadarHeight, RadarWorld, RadarVisuals, RadarRange, NoSmoke, 22 | NoFlash, TriggerWall 23 | }; 24 | 25 | enum 26 | { 27 | SaveConfig, 28 | LoadConfig 29 | }; 30 | 31 | class cCVARS 32 | { 33 | public: 34 | void SetDefaultConfig() 35 | { 36 | CvarList[NameESP] = 1; 37 | CvarList[HealthESP] = 1; 38 | CvarList[ESPEnemyOnly] = 1; 39 | CvarList[Bunnyhop] = 1; 40 | CvarList[Autopistol] = 1; 41 | CvarList[EnableESP] = 1; 42 | CvarList[BoxESP] = 1; 43 | //CvarList[RCS] = 1; 44 | CvarList[RCSSpot] = 11; 45 | CvarList[RCSFOV] = 4; 46 | CvarList[RCSSmooth] = 7; 47 | CvarList[RadarRange] = 31; 48 | //CvarList[XQZ] = 1; 49 | CvarList[NoVisRecoil] = 1; 50 | CvarList[Triggerbot] = 0; 51 | CvarList[PTrigger] = 0; 52 | CvarList[TriggerSeed] = 0; 53 | CvarList[TriggerHead] = 1; 54 | //CvarList[Chams] = 2; 55 | CvarList[ChamsEnemyOnly] = 1; 56 | CvarList[AimSpot] = 12; 57 | CvarList[EnableAim] = 1; 58 | CvarList[NoSpread] = 1; 59 | //CvarList[NoRecoil] = 1; 60 | //CvarList[Autowall] = 1; 61 | //CvarList[PSilent] = 1; 62 | //CvarList[Chams] = 2; 63 | //CvarList[Glow] = 1; 64 | //CvarList[AntiAimX] = 2; 65 | //CvarList[AntiAimY] = 1; 66 | CvarList[BoxESP] = 1; 67 | CvarList[AsusAmount] = 255; 68 | CvarList[NoSky] = 1; 69 | CvarList[NoHands] = 1; 70 | CvarList[Autoshoot] = 1; 71 | CvarList[Knifebot] = 1; 72 | CvarList[AimFOV] = 360.0f; 73 | CvarList[ModelAlpha] = 255; 74 | CvarList[GlowEnemyOnly] = 1; 75 | CvarList[AntiDM] = 0; 76 | CvarList[AimKey] = 1;//lbutton todo: virtual key binder inside inkeyevent (when menu is done) 77 | CvarList[TriggerKey] = 69;//e 78 | CvarList[RadarVisuals] = 1; 79 | 80 | CvarList[Chams_T_InVis] = 255; 81 | CvarList[Chams_CT_InVis + 2] = 255; 82 | 83 | CvarList[Chams_T_Vis] = 255; 84 | CvarList[Chams_T_Vis + 1] = 255; 85 | CvarList[Chams_CT_Vis + 1] = 255; 86 | 87 | CvarList[Esp_T_InVis] = 255; 88 | CvarList[Esp_T_InVis + 1] = 255; 89 | CvarList[Esp_CT_InVis + 1] = 255; 90 | 91 | CvarList[Esp_T_Vis] = 255; 92 | CvarList[Esp_CT_Vis + 2] = 255; 93 | CvarList[Esp_T_InVis + 3] = CvarList[Esp_T_Vis + 3] = CvarList[Esp_CT_InVis + 3] = CvarList[Esp_CT_Vis + 3] = 255; 94 | 95 | CvarList[Glow_T_InVis] = 255; 96 | CvarList[Glow_CT_InVis + 2] = 255; 97 | 98 | CvarList[Glow_T_Vis] = 255; 99 | CvarList[Glow_T_Vis + 1] = 255; 100 | CvarList[Glow_CT_Vis + 1] = 255; 101 | } 102 | 103 | void HandleConfig(const char *pszConfigName, int iType); 104 | 105 | void Init(HMODULE hinstDLL); 106 | 107 | float CvarList[MAX_CVARS]; 108 | 109 | private: 110 | 111 | char szIniFilePath[2048]; 112 | }; 113 | 114 | extern cCVARS g_CVARS; -------------------------------------------------------------------------------- /CValve.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | color32 CBaseEntity::GetModelColor() 4 | { 5 | static int iOffset = g_NetworkedVariableManager.GetOffset("DT_CSPlayer", "m_clrRender"); 6 | return *(color32*)((DWORD)this + iOffset); 7 | } 8 | 9 | ValveSDK::CBaseCombatWeapon* CBaseEntity::GetActiveBaseCombatWeapon() 10 | { 11 | static int iOffset = g_NetworkedVariableManager.GetOffset("DT_CSPlayer","m_hActiveWeapon"); //m_hActiveWeapon 12 | ULONG pWeepEhandle = *(PULONG)((DWORD)this + iOffset); 13 | return (ValveSDK::CBaseCombatWeapon*)(g_Valve.pEntList->GetClientEntityFromHandle(pWeepEhandle)); 14 | } 15 | 16 | void* GetInterfacePtr(const char* interfaceName, const char* ptrName, CreateInterface_t pInterface) 17 | { 18 | char szDebugString[1024]; 19 | 20 | std::string sinterface = ""; 21 | std::string interfaceVersion = "0"; 22 | 23 | for (int i = 0; i <= 99; i++) 24 | { 25 | sinterface = interfaceName; 26 | sinterface += interfaceVersion; 27 | sinterface += std::to_string(i); 28 | 29 | void* funcPtr = pInterface(sinterface.c_str(), nullptr); 30 | 31 | if ((DWORD)funcPtr != 0x0) 32 | { 33 | sprintf_s(szDebugString, "%s: 0x%x (%s%s%i)", ptrName, (DWORD)funcPtr, interfaceName, interfaceVersion.c_str(), i); 34 | //cout << iblue << ptrName << igreen << ": 0x" << funcPtr << "(" << iyellow << interfaceName << interfaceVersion << i << igreen << ")" << white << endl; 35 | return funcPtr; 36 | } 37 | if (i >= 99 && interfaceVersion == "0") 38 | { 39 | interfaceVersion = "00"; 40 | i = 0; 41 | } 42 | else if (i >= 99 && interfaceVersion == "00") 43 | { 44 | sprintf_s(szDebugString, "%s: 0x%x (error)", ptrName, (DWORD)funcPtr); 45 | //cout << ired << ptrName << ": 0x" << funcPtr << " (ERROR)" << white << endl; 46 | } 47 | } 48 | return nullptr; 49 | } 50 | 51 | void* getInterface(void* factory, char* name) 52 | { 53 | CreateInterfaceFn fn = (CreateInterfaceFn)factory; 54 | 55 | void *ret = 0; 56 | for (int i = 0; i<100; i++) 57 | { 58 | char* fmt = (i < 10) ? "%s00%d" : "%s0%d"; 59 | 60 | std::string formatted = std::to_string(i); //utils::string::formatString(fmt, name, i); 61 | void *ptr = (fn)(formatted.c_str(), 0); 62 | if (ptr) 63 | { 64 | //Msg(formatted.c_str()); 65 | //Msg("\n"); 66 | 67 | ret = ptr; 68 | return ret; 69 | } 70 | 71 | } 72 | 73 | return ret; 74 | } 75 | 76 | #define INTERFACE(intrfc, cls, name, ptr, factory) intrfc = (ValveSDK::cls*)GetInterfacePtr(name, ptr, factory) 77 | 78 | VOID CValve::initSDK() 79 | { 80 | #ifdef DEBUGMODE 81 | Base::Debug::LOG("Initiate Thread"); 82 | char szDebugString[1024]; 83 | #endif 84 | 85 | //DWORD dwInitAddress = Base::Utils::PatternSearch("engine.dll",(PBYTE)"\x56\xE8\x00\x00\x00\x00\x83\x3D\x00\x00\x00\x00\x00","xx????xx?????",NULL,NULL); 86 | 87 | //CreateInterfaceFn AppSystemFactory = (CreateInterfaceFn)**(PDWORD*)(dwInitAddress + APPSYSTEMFACTORYOFFSET); 88 | 89 | //CreateInterfaceFn ClientFactory = (CreateInterfaceFn)**(PDWORD*)(dwInitAddress + CLIENTFACTORYOFFSET); 90 | 91 | //DWORD dwCLMoveAddress = Base::Utils::PatternSearch( /*engine.dll*/XorStr<0xA1,11,0xE75EB804>("\xC4\xCC\xC4\xCD\xCB\xC3\x89\xCC\xC5\xC6"+0xE75EB804).s,(PBYTE)"\x55\x8B\xEC\x83\xEC\x4C\x53\x56\x57\x8B\x3D",/*xxxxxxxxxxx*/XorStr<0xEF,12,0xC7505732>("\x97\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x80\x81"+0xC7505732).s,NULL,NULL); 92 | 93 | HMODULE module_engine = NULL; 94 | HMODULE module_client = NULL; 95 | HMODULE module_vstd = NULL; 96 | HMODULE module_vgui = NULL; 97 | HMODULE module_vguimat = NULL; 98 | HMODULE module_vphys = NULL; 99 | HMODULE module_mat = NULL; 100 | 101 | CreateInterfaceFn factory_engine = NULL; 102 | CreateInterfaceFn factory_client = NULL; 103 | CreateInterfaceFn factory_vstd = NULL; 104 | CreateInterfaceFn factory_vgui = NULL; 105 | CreateInterfaceFn factory_vguimat = NULL; 106 | CreateInterfaceFn factory_vphys = NULL; 107 | CreateInterfaceFn factory_mat = NULL; 108 | 109 | while (!module_engine || !module_client) 110 | { 111 | module_engine = GetModuleHandleA("engine.dll"); 112 | module_client = GetModuleHandleA("client.dll"); 113 | module_vstd = GetModuleHandleA("vstdlib.dll"); 114 | module_vgui = GetModuleHandleA("vgui2.dll"); 115 | module_vguimat = GetModuleHandleA("vguimatsurface.dll"); 116 | module_vphys = GetModuleHandleA("vphysics.dll"); 117 | module_mat = GetModuleHandleA("materialsystem.dll"); 118 | 119 | Sleep(100); 120 | } 121 | 122 | while (!factory_engine || !factory_client) 123 | { 124 | factory_engine = (CreateInterfaceFn)GetProcAddress(module_engine, "CreateInterface"); 125 | factory_client = (CreateInterfaceFn)GetProcAddress(module_client, "CreateInterface"); 126 | factory_vstd = (CreateInterfaceFn)GetProcAddress(module_vstd, "CreateInterface"); 127 | factory_vgui = (CreateInterfaceFn)GetProcAddress(module_vgui, "CreateInterface"); 128 | factory_vguimat = (CreateInterfaceFn)GetProcAddress(module_vguimat, "CreateInterface"); 129 | factory_vphys = (CreateInterfaceFn)GetProcAddress(module_vphys, "CreateInterface"); 130 | factory_mat = (CreateInterfaceFn)GetProcAddress(module_mat, "CreateInterface"); 131 | 132 | Sleep(10); 133 | } 134 | 135 | pClient = (ValveSDK::HLCLient*)GetInterfacePtr("VClient", "g_pClient", factory_client); 136 | #ifdef DEBUGMODE 137 | sprintf(szDebugString, "g_pClient: 0x%X", (DWORD)pClient); 138 | Base::Debug::LOG(szDebugString); 139 | #endif 140 | pEntList = (ValveSDK::CEntityList*)GetInterfacePtr("VClientEntityList", "g_pEntList", factory_client); 141 | #ifdef DEBUGMODE 142 | sprintf(szDebugString, "g_pEntList: 0x%X", (DWORD)pEntList); 143 | Base::Debug::LOG(szDebugString); 144 | #endif 145 | pPred = (ValveSDK::CPrediction*)GetInterfacePtr("VClientPrediction", "g_pPred", factory_client); 146 | #ifdef DEBUGMODE 147 | sprintf(szDebugString, "g_pPred: 0x%X", (DWORD)pPred); 148 | Base::Debug::LOG(szDebugString); 149 | #endif 150 | INTERFACE(pGameMovement, CGameMovement, "GameMovement", "g_pGameMovement", factory_client); 151 | #ifdef DEBUGMODE 152 | sprintf(szDebugString, "g_pGameMovement: 0x%X", (DWORD)pGameMovement); 153 | Base::Debug::LOG(szDebugString); 154 | #endif 155 | pEngine = (ValveSDK::CEngineClient*)GetInterfacePtr("VEngineClient", "g_pEngine", factory_engine); 156 | #ifdef DEBUGMODE 157 | sprintf(szDebugString, "g_pEngine: 0x%X", (DWORD)pEngine); 158 | Base::Debug::LOG(szDebugString); 159 | #endif 160 | INTERFACE(pModel, CModelInfo, "VModelInfoClient", "g_pModel", factory_engine); 161 | #ifdef DEBUGMODE 162 | sprintf(szDebugString, "g_pModel: 0x%X", (DWORD)pModel); 163 | Base::Debug::LOG(szDebugString); 164 | #endif 165 | INTERFACE(pDebugOverlay, CDebugOverlay, "VDebugOverlay", "g_pDebugOverlay", factory_engine); 166 | #ifdef DEBUGMODE 167 | sprintf(szDebugString, "g_pDebugOverlay: 0x%X", (DWORD)pDebugOverlay); 168 | Base::Debug::LOG(szDebugString); 169 | #endif 170 | INTERFACE(pSurface, ISurface, "VGUI_Surface", "g_pSurface", factory_vguimat); 171 | #ifdef DEBUGMODE 172 | sprintf(szDebugString, "g_pSurface: 0x%X", (DWORD)pSurface); 173 | Base::Debug::LOG(szDebugString); 174 | #endif 175 | INTERFACE(pPanel, IPanel, "VGUI_Panel", "g_pPanel", factory_vgui); 176 | #ifdef DEBUGMODE 177 | sprintf(szDebugString, "g_pPanel: 0x%X", (DWORD)pPanel); 178 | Base::Debug::LOG(szDebugString); 179 | #endif 180 | INTERFACE(pConVar, ICvar, "VEngineCvar", "g_pConVar", factory_vstd); 181 | #ifdef DEBUGMODE 182 | sprintf(szDebugString, "g_pConVar: 0x%X", (DWORD)pConVar); 183 | Base::Debug::LOG(szDebugString); 184 | #endif 185 | INTERFACE(pEngineTrace, CTrace, "EngineTraceClient", "g_pEngineTrace", factory_engine); 186 | #ifdef DEBUGMODE 187 | sprintf(szDebugString, "g_pEngineTrace: 0x%X", (DWORD)pEngineTrace); 188 | Base::Debug::LOG(szDebugString); 189 | #endif 190 | INTERFACE(pPhysics, IPhysicsSurfaceProps, "VPhysicsSurfaceProps", "g_pPhysics", factory_vphys); 191 | #ifdef DEBUGMODE 192 | sprintf(szDebugString, "g_pPhysics: 0x%X", (DWORD)pPhysics); 193 | Base::Debug::LOG(szDebugString); 194 | #endif 195 | INTERFACE(pModelRender, IVModelRender, "VEngineModel", "g_pModelRender", factory_engine); 196 | #ifdef DEBUGMODE 197 | sprintf(szDebugString, "g_pModelRender: 0x%X", (DWORD)pModelRender); 198 | Base::Debug::LOG(szDebugString); 199 | #endif 200 | INTERFACE(pRenderView, IVRenderView, "VEngineRenderView", "g_pRenderView", factory_engine); 201 | #ifdef DEBUGMODE 202 | sprintf(szDebugString, "g_pRenderView: 0x%X", (DWORD)pRenderView); 203 | Base::Debug::LOG(szDebugString); 204 | #endif 205 | INTERFACE(pMaterialSystem, IMaterialSystem, "VMaterialSystem", "g_pMaterialSystem", factory_mat); 206 | #ifdef DEBUGMODE 207 | sprintf(szDebugString, "g_pMaterialSystem: 0x%X", (DWORD)pMaterialSystem); 208 | Base::Debug::LOG(szDebugString); 209 | #endif 210 | pGameEventManager = (ValveSDK::IGameEventManager*)factory_engine(/*GAMEEVENTSMANAGER002*/XorStr<0x75,21,0xAAE7DB93>("\x32\x37\x3A\x3D\x3C\x2C\x3E\x32\x29\x2D\x32\xC1\xCF\xC3\xC4\xC1\xD7\xB6\xB7\xBA"+0xAAE7DB93).s,NULL); 211 | #ifdef DEBUGMODE 212 | sprintf(szDebugString, "g_pGameEventManager: 0x%X", (DWORD)pGameEventManager); 213 | Base::Debug::LOG(szDebugString); 214 | #endif 215 | pGlobalVars = *(ValveSDK::CGlobalVars**)(((*(PDWORD*)g_Valve.pClient)[0]) + GLOBALSOFFSET); 216 | pGlobalVars = (ValveSDK::CGlobalVars*)*(PDWORD)pGlobalVars; 217 | #ifdef DEBUGMODE 218 | sprintf(szDebugString, "g_pGlobalVars: 0x%X", (DWORD)pGlobalVars); 219 | Base::Debug::LOG(szDebugString); 220 | #endif 221 | 222 | m_bInitiated = true; 223 | } 224 | 225 | BOOL CValve::isInitiated() 226 | { 227 | return this->m_bInitiated; 228 | } 229 | 230 | bool CValve::WorldToScreen(const Vector &vOrigin, Vector &vScreen) 231 | { 232 | return (pDebugOverlay->ScreenPosition(vOrigin, vScreen) != 1); 233 | } 234 | 235 | 236 | 237 | 238 | 239 | -------------------------------------------------------------------------------- /CValve.h: -------------------------------------------------------------------------------- 1 | class CValve 2 | { 3 | public: 4 | VOID initSDK(); 5 | BOOL isInitiated(); 6 | bool WorldToScreen(const Vector &vOrigin, Vector &vScreen); 7 | 8 | ValveSDK::HLCLient* pClient; 9 | ValveSDK::CEngineClient* pEngine; 10 | ValveSDK::ISurface* pSurface; 11 | ValveSDK::IPanel* pPanel; 12 | ValveSDK::CEntityList* pEntList; 13 | ValveSDK::CInput* pInput; 14 | ValveSDK::CPrediction* pPred; 15 | ValveSDK::CGameMovement* pGameMovement; 16 | ValveSDK::CGlobalVars* pGlobalVars; 17 | ValveSDK::CModelInfo* pModel; 18 | ValveSDK::CDebugOverlay* pDebugOverlay; 19 | ValveSDK::CTrace* pEngineTrace; 20 | ValveSDK::ImoveHelper* pMoveHelper; 21 | ValveSDK::IGameEventManager* pGameEventManager; 22 | ValveSDK::IPhysicsSurfaceProps* pPhysics; 23 | ValveSDK::IVModelRender* pModelRender; 24 | ValveSDK::IVRenderView* pRenderView; 25 | ValveSDK::IMaterialSystem* pMaterialSystem; 26 | ValveSDK::ICvar* pConVar; 27 | 28 | private: 29 | BOOL m_bInitiated; 30 | 31 | }; 32 | 33 | class KeyValues 34 | { 35 | public: 36 | // By default, the KeyValues class uses a string table for the key names that is 37 | // limited to 4MB. The game will exit in error if this space is exhausted. In 38 | // general this is preferable for game code for performance and memory fragmentation 39 | // reasons. 40 | // 41 | // If this is not acceptable, you can use this call to switch to a table that can grow 42 | // arbitrarily. This call must be made before any KeyValues objects are allocated or it 43 | // will result in undefined behavior. If you use the growable string table, you cannot 44 | // share KeyValues pointers directly with any other module. You can serialize them across 45 | // module boundaries. These limitations are acceptable in the Steam backend code 46 | // this option was written for, but may not be in other situations. Make sure to 47 | // understand the implications before using this. 48 | static void SetUseGrowableStringTable( bool bUseGrowableTable ); 49 | 50 | KeyValues( const char *setName ) 51 | { 52 | Init(); 53 | SetName(setName); 54 | } 55 | 56 | // 57 | // AutoDelete class to automatically free the keyvalues. 58 | // Simply construct it with the keyvalues you allocated and it will free them when falls out of scope. 59 | // When you decide that keyvalues shouldn't be deleted call Assign(NULL) on it. 60 | // If you constructed AutoDelete(NULL) you can later assign the keyvalues to be deleted with Assign(pKeyValues). 61 | // You can also pass temporary KeyValues object as an argument to a function by wrapping it into KeyValues::AutoDelete 62 | // instance: call_my_function( KeyValues::AutoDelete( new KeyValues( "test" ) ) ) 63 | // 64 | class AutoDelete 65 | { 66 | public: 67 | explicit inline AutoDelete( KeyValues *pKeyValues ) : m_pKeyValues( pKeyValues ) {} 68 | explicit inline AutoDelete( const char *pchKVName ) : m_pKeyValues( new KeyValues( pchKVName ) ) {} 69 | inline ~AutoDelete( void ) { if( m_pKeyValues ) m_pKeyValues->deleteThis(); } 70 | inline void Assign( KeyValues *pKeyValues ) { m_pKeyValues = pKeyValues; } 71 | KeyValues *operator->() { return m_pKeyValues; } 72 | operator KeyValues *() { return m_pKeyValues; } 73 | private: 74 | AutoDelete( AutoDelete const &x ); // forbid 75 | AutoDelete & operator= ( AutoDelete const &x ); // forbid 76 | KeyValues *m_pKeyValues; 77 | }; 78 | 79 | // Section name 80 | const char *GetName() const; 81 | void SetName( const char *setName) 82 | { 83 | m_iKeyName = 2; 84 | } 85 | 86 | // gets the name as a unique int 87 | int GetNameSymbol() const { return m_iKeyName; } 88 | 89 | // File access. Set UsesEscapeSequences true, if resource file/buffer uses Escape Sequences (eg \n, \t) 90 | void UsesEscapeSequences(bool state); // default false 91 | void UsesConditionals(bool state); // default true 92 | 93 | // Read from a buffer... Note that the buffer must be null terminated 94 | 95 | // Read from a utlbuffer... 96 | 97 | // Find a keyValue, create it if it is not found. 98 | // Set bCreate to true to create the key if it doesn't already exist (which ensures a valid pointer will be returned) 99 | KeyValues *FindKey(const char *keyName, bool bCreate = false); 100 | KeyValues *FindKey(int keySymbol) const; 101 | KeyValues *CreateNewKey(); // creates a new key, with an autogenerated name. name is guaranteed to be an integer, of value 1 higher than the highest other integer key name 102 | void AddSubKey( KeyValues *pSubkey ); // Adds a subkey. Make sure the subkey isn't a child of some other keyvalues 103 | void RemoveSubKey(KeyValues *subKey); // removes a subkey from the list, DOES NOT DELETE IT 104 | 105 | // Key iteration. 106 | // 107 | // NOTE: GetFirstSubKey/GetNextKey will iterate keys AND values. Use the functions 108 | // below if you want to iterate over just the keys or just the values. 109 | // 110 | KeyValues *GetFirstSubKey() { return m_pSub; } // returns the first subkey in the list 111 | KeyValues *GetNextKey() { return m_pPeer; } // returns the next subkey 112 | void SetNextKey( KeyValues * pDat); 113 | KeyValues *FindLastSubKey(); // returns the LAST subkey in the list. This requires a linked list iteration to find the key. Returns NULL if we don't have any children 114 | 115 | // 116 | // These functions can be used to treat it like a true key/values tree instead of 117 | // confusing values with keys. 118 | // 119 | // So if you wanted to iterate all subkeys, then all values, it would look like this: 120 | // for ( KeyValues *pKey = pRoot->GetFirstTrueSubKey(); pKey; pKey = pKey->GetNextTrueSubKey() ) 121 | // { 122 | // Msg( "Key name: %s\n", pKey->GetName() ); 123 | // } 124 | // for ( KeyValues *pValue = pRoot->GetFirstValue(); pKey; pKey = pKey->GetNextValue() ) 125 | // { 126 | // Msg( "Int value: %d\n", pValue->GetInt() ); // Assuming pValue->GetDataType() == TYPE_INT... 127 | // } 128 | KeyValues* GetFirstTrueSubKey(); 129 | KeyValues* GetNextTrueSubKey(); 130 | 131 | KeyValues* GetFirstValue(); // When you get a value back, you can use GetX and pass in NULL to get the value. 132 | KeyValues* GetNextValue(); 133 | 134 | // Data access 135 | int GetInt( const char *keyName = NULL, int defaultValue = 0 ); 136 | float GetFloat( const char *keyName = NULL, float defaultValue = 0.0f ); 137 | const char *GetString( const char *keyName = NULL, const char *defaultValue = "" ); 138 | const wchar_t *GetWString( const char *keyName = NULL, const wchar_t *defaultValue = L"" ); 139 | void *GetPtr( const char *keyName = NULL, void *defaultValue = (void*)0 ); 140 | bool GetBool( const char *keyName = NULL, bool defaultValue = false ); 141 | bool IsEmpty(const char *keyName = NULL); 142 | 143 | // Data access 144 | int GetInt( int keySymbol, int defaultValue = 0 ); 145 | float GetFloat( int keySymbol, float defaultValue = 0.0f ); 146 | const char *GetString( int keySymbol, const char *defaultValue = "" ); 147 | const wchar_t *GetWString( int keySymbol, const wchar_t *defaultValue = L"" ); 148 | void *GetPtr( int keySymbol, void *defaultValue = (void*)0 ); 149 | bool IsEmpty( int keySymbol ); 150 | 151 | // Key writing 152 | void SetWString( const char *keyName, const wchar_t *value ); 153 | void SetString( const char *keyName, const char *value ); 154 | void SetInt( const char *keyName, int value ); 155 | void SetUint64( const char *keyName, UINT value ); 156 | void SetFloat( const char *keyName, float value ); 157 | void SetPtr( const char *keyName, void *value ); 158 | void SetBool( const char *keyName, bool value ) { SetInt( keyName, value ? 1 : 0 ); } 159 | 160 | // Memory allocation (optimized) 161 | //void *operator new( size_t iAllocSize ); 162 | //void *operator new( size_t iAllocSize, int nBlockUse, const char *pFileName, int nLine ); 163 | //void operator delete( void *pMem ); 164 | //void operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine ); 165 | 166 | KeyValues& operator=( KeyValues& src ); 167 | 168 | // Adds a chain... if we don't find stuff in this keyvalue, we'll look 169 | // in the one we're chained to. 170 | void ChainKeyValue( KeyValues* pChain ); 171 | 172 | // Allocate & create a new copy of the keys 173 | KeyValues *MakeCopy( void ) const; 174 | 175 | // Make a new copy of all subkeys, add them all to the passed-in keyvalues 176 | void CopySubkeys( KeyValues *pParent ) const; 177 | 178 | // Clear out all subkeys, and the current value 179 | void Clear( void ); 180 | 181 | // Data type 182 | enum types_t 183 | { 184 | TYPE_NONE = 0, 185 | TYPE_STRING, 186 | TYPE_INT, 187 | TYPE_FLOAT, 188 | TYPE_PTR, 189 | TYPE_WSTRING, 190 | TYPE_COLOR, 191 | TYPE_UINT64, 192 | TYPE_NUMTYPES, 193 | }; 194 | types_t GetDataType(const char *keyName = NULL); 195 | 196 | // Virtual deletion function - ensures that KeyValues object is deleted from correct heap 197 | void deleteThis(); 198 | 199 | void SetStringValue( char const *strValue ); 200 | 201 | // unpack a key values list into a structure 202 | void UnpackIntoStructure( struct KeyValuesUnpackStructure const *pUnpackTable, void *pDest, size_t DestSizeInBytes ); 203 | 204 | // Process conditional keys for widescreen support. 205 | bool ProcessResolutionKeys( const char *pResString ); 206 | 207 | // Dump keyvalues recursively into a dump context 208 | bool Dump( class IKeyValuesDumpContext *pDump, int nIndentLevel = 0 ); 209 | 210 | // Merge in another KeyValues, keeping "our" settings 211 | void RecursiveMergeKeyValues( KeyValues *baseKV ); 212 | 213 | public: 214 | KeyValues( KeyValues& ); // prevent copy constructor being used 215 | 216 | // prevent delete being called except through deleteThis() 217 | ~KeyValues(); 218 | 219 | KeyValues* CreateKey( const char *keyName ); 220 | 221 | /// Create a child key, given that we know which child is currently the last child. 222 | /// This avoids the O(N^2) behaviour when adding children in sequence to KV, 223 | /// when CreateKey() wil have to re-locate the end of the list each time. This happens, 224 | /// for example, every time we load any KV file whatsoever. 225 | KeyValues* CreateKeyUsingKnownLastChild( const char *keyName, KeyValues *pLastChild ); 226 | void AddSubkeyUsingKnownLastChild( KeyValues *pSubKey, KeyValues *pLastChild ); 227 | 228 | void RecursiveCopyKeyValues( KeyValues& src ); 229 | void RemoveEverything(); 230 | // void RecursiveSaveToFile( IBaseFileSystem *filesystem, CUtlBuffer &buffer, int indentLevel ); 231 | // void WriteConvertedString( CUtlBuffer &buffer, const char *pszString ); 232 | 233 | // NOTE: If both filesystem and pBuf are non-null, it'll save to both of them. 234 | // If filesystem is null, it'll ignore f. 235 | 236 | 237 | // For handling #include "filename" 238 | 239 | // For handling #base "filename" 240 | 241 | // NOTE: If both filesystem and pBuf are non-null, it'll save to both of them. 242 | // If filesystem is null, it'll ignore f. 243 | 244 | void Init() 245 | { 246 | m_iKeyName = -1; 247 | m_iDataType = TYPE_NONE; 248 | 249 | m_pSub = NULL; 250 | m_pPeer = NULL; 251 | m_pChain = NULL; 252 | 253 | m_sValue = NULL; 254 | m_wsValue = NULL; 255 | m_pValue = NULL; 256 | 257 | m_bHasEscapeSequences = false; 258 | 259 | // for future proof 260 | memset( unused, 0, sizeof(unused) ); 261 | } 262 | 263 | void FreeAllocatedValue(); 264 | void AllocateValueBlock(int size); 265 | 266 | int m_iKeyName; // keyname is a symbol defined in KeyValuesSystem 267 | 268 | // These are needed out of the union because the API returns string pointers 269 | char *m_sValue; 270 | wchar_t *m_wsValue; 271 | 272 | // we don't delete these 273 | union 274 | { 275 | int m_iValue; 276 | float m_flValue; 277 | void *m_pValue; 278 | unsigned char m_Color[4]; 279 | }; 280 | 281 | char m_iDataType; 282 | char m_bHasEscapeSequences; // true, if while parsing this KeyValue, Escape Sequences are used (default false) 283 | char m_bEvaluateConditionals; // true, if while parsing this KeyValue, conditionals blocks are evaluated (default true) 284 | char unused[1]; 285 | 286 | KeyValues *m_pPeer; // pointer to next key in list 287 | KeyValues *m_pSub; // pointer to Start of a new sub key list 288 | KeyValues *m_pChain;// Search here if it's not in our list 289 | 290 | private: 291 | // Statics to implement the optional growable string table 292 | // Function pointers that will determine which mode we are in 293 | static int (*s_pfGetSymbolForString)( const char *name, bool bCreate ); 294 | static const char *(*s_pfGetStringForSymbol)( int symbol ); 295 | 296 | public: 297 | // Functions that invoke the default behavior 298 | static int GetSymbolForStringClassic( const char *name, bool bCreate = true ); 299 | static const char *GetStringForSymbolClassic( int symbol ); 300 | 301 | // Functions that use the growable string table 302 | static int GetSymbolForStringGrowable( const char *name, bool bCreate = true ); 303 | static const char *GetStringForSymbolGrowable( int symbol ); 304 | 305 | // Functions to get external access to whichever of the above functions we're going to call. 306 | static int CallGetSymbolForString( const char *name, bool bCreate = true ) { return s_pfGetSymbolForString( name, bCreate ); } 307 | static const char *CallGetStringForSymbol( int symbol ) { return s_pfGetStringForSymbol( symbol ); } 308 | }; -------------------------------------------------------------------------------- /CWinsock.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | cWinsocky g_Winsock; 4 | 5 | cWinsocky::cWinsocky ( VOID ) 6 | { 7 | m_ConnectedSocket = INVALID_SOCKET; 8 | } 9 | 10 | VOID cWinsocky::InitWinsock ( VOID ) 11 | { 12 | WSADATA wsaData; 13 | 14 | if ( WSAStartup ( MAKEWORD ( 2, 2 ), &wsaData ) != 0 ) 15 | { 16 | #ifdef DEBUGMODE 17 | Base::Debug::LOG("WINSOCK ERROR: WSAStartup"); 18 | #endif 19 | } 20 | 21 | } 22 | 23 | VOID cWinsocky::Connect ( const char* pszServerUrl ) 24 | { 25 | m_pszConnectedUrl = pszServerUrl; 26 | 27 | addrinfo hints, *pAddrInfo; 28 | 29 | SecureZeroMemory ( &hints, sizeof ( hints ) ); 30 | 31 | hints.ai_family = AF_INET; 32 | hints.ai_socktype = SOCK_STREAM; 33 | hints.ai_protocol = IPPROTO_TCP; 34 | 35 | if ( getaddrinfo ( pszServerUrl, /*80*/XorStr<0x15,3,0x9AED279F>((const char*)"\x2D\x26"+0x9AED279F).s, &hints, &pAddrInfo ) != 0 ) 36 | { 37 | CleanUp( ); 38 | #ifdef DEBUGMODE 39 | Base::Debug::LOG("WINSOCK ERROR: getaddrinfo"); 40 | #endif 41 | } 42 | 43 | if ( ( m_ConnectedSocket = socket ( pAddrInfo->ai_family, pAddrInfo->ai_socktype, pAddrInfo->ai_protocol ) ) == INVALID_SOCKET ) 44 | { 45 | freeaddrinfo ( pAddrInfo ); 46 | CleanUp( ); 47 | #ifdef DEBUGMODE 48 | Base::Debug::LOG("WINSOCK ERROR: socket"); 49 | #endif 50 | } 51 | 52 | if ( connect ( m_ConnectedSocket, pAddrInfo->ai_addr, ( INT ) pAddrInfo->ai_addrlen ) != 0 ) 53 | { 54 | freeaddrinfo ( pAddrInfo ); 55 | Disconnect( ); 56 | CleanUp( ); 57 | #ifdef DEBUGMODE 58 | Base::Debug::LOG("WINSOCK ERROR: connect"); 59 | #endif 60 | } 61 | 62 | freeaddrinfo ( pAddrInfo ); 63 | } 64 | 65 | VOID cWinsocky::SendHttpGet ( const char* pszFileUrl, std::string &sDestBuffer ) 66 | { 67 | std::string sMsg = /*GET /*/XorStr<0x57,6,0x59E137A6>("\x10\x1D\x0D\x7A\x74"+0x59E137A6).s; 68 | sMsg += pszFileUrl; 69 | sMsg += /* HTTP/1.0\r\nHost: */XorStr<0xBD,18,0x809D9B98>("\x9D\xF6\xEB\x94\x91\xED\xF2\xEA\xF5\xCB\xCD\x80\xA6\xB9\xBF\xF6\xED"+0x809D9B98).s; // 1.0 statt 1.1 wegen Chunked_transfer_encoding 70 | sMsg += m_pszConnectedUrl; 71 | sMsg += /*\r\n\r\n*/XorStr<0x79,5,0x2EE0F46F>("\x74\x70\x76\x76"+0x2EE0F46F).s; 72 | 73 | CHAR szRecvBuffer [ 512 ]; 74 | 75 | if ( send ( m_ConnectedSocket, sMsg.data(), strlen ( sMsg.data() ), 0 ) == SOCKET_ERROR ) 76 | { 77 | Disconnect( ); 78 | WSACleanup( ); 79 | #ifdef DEBUGMODE 80 | Base::Debug::LOG("WINSOCK ERROR: send"); 81 | #endif 82 | } 83 | 84 | INT iBytesReceived = 0; 85 | do 86 | { 87 | iBytesReceived = recv ( m_ConnectedSocket, szRecvBuffer, sizeof ( szRecvBuffer ), 0 ); 88 | 89 | sDestBuffer.append ( szRecvBuffer, iBytesReceived ); 90 | 91 | } while ( iBytesReceived > 0 ); 92 | 93 | // httpheader entfernen 94 | for ( size_t i = 0; i < sDestBuffer.size(); i++ ) 95 | { 96 | if ( sDestBuffer [ i ] == '\r' && sDestBuffer [ i + 1 ] == '\n' && sDestBuffer [ i + 2 ] == '\r' && sDestBuffer [ i + 3 ] == '\n' ) 97 | sDestBuffer.erase( 0, i + 4 ); 98 | } 99 | 100 | } 101 | 102 | VOID cWinsocky::Disconnect ( VOID ) 103 | { 104 | if ( m_ConnectedSocket != INVALID_SOCKET ) 105 | { 106 | closesocket ( m_ConnectedSocket ); 107 | m_ConnectedSocket = INVALID_SOCKET; 108 | } 109 | 110 | } 111 | 112 | VOID cWinsocky::CleanUp ( VOID ) 113 | { 114 | WSACleanup( ); 115 | } 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /CWinsock.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class cWinsocky 4 | { 5 | public: 6 | cWinsocky ( VOID ); 7 | 8 | VOID InitWinsock ( VOID ); 9 | VOID Connect ( const char* pszServerUrl ); 10 | VOID SendHttpGet ( const char* pszFileUrl, std::string &sDestBuffer ); 11 | 12 | VOID Disconnect ( VOID ); 13 | VOID CleanUp ( VOID ); 14 | private: 15 | SOCKET m_ConnectedSocket; 16 | const char* m_pszConnectedUrl; 17 | 18 | }; 19 | 20 | extern cWinsocky g_Winsock; -------------------------------------------------------------------------------- /ClientClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | Clientclass rebuild 3 | 22.08.2014 4 | */ 5 | namespace ValveSDK 6 | { 7 | class ClientClass 8 | { 9 | public: 10 | const char* GetName(void) 11 | { 12 | return *(char**)(this + 0x8); 13 | } 14 | RecvTable* GetTable() 15 | { 16 | return *(RecvTable**)(this + 0xC); 17 | } 18 | ClientClass* NextClass() 19 | { 20 | return *(ClientClass**)(this + 0x10); 21 | } 22 | int GetClassID(void) 23 | { 24 | return *(int*)(this + 0x14); 25 | } 26 | }; 27 | } -------------------------------------------------------------------------------- /ConVar.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class ConVar 4 | { 5 | public: 6 | int GetInt() 7 | { 8 | PVOID pThisPtr = (PVOID)this; 9 | 10 | int iRet; 11 | 12 | __asm 13 | { 14 | MOV ECX, pThisPtr 15 | MOV EDX, [ECX + 0x1C] 16 | MOV EDX, [EDX + 0x30] 17 | MOV iRet, EDX 18 | } 19 | 20 | return iRet; 21 | } 22 | 23 | void SetValue(int iValue) 24 | { 25 | PVOID pThisPtr = (PVOID)this; 26 | 27 | __asm 28 | { 29 | PUSH iValue 30 | MOV ECX, pThisPtr 31 | MOV EDX, [ECX + 0x18] 32 | ADD ECX, 0x18 33 | CALL [EDX] 34 | } 35 | } 36 | }; 37 | 38 | class IAppSystem 39 | { 40 | public: 41 | // Here's where the app systems get to learn about each other 42 | virtual void func00() = 0; 43 | virtual void func01() = 0; 44 | virtual void func02() = 0; 45 | virtual void func03() = 0; 46 | virtual void func04() = 0; 47 | }; 48 | 49 | class ICvar : public IAppSystem 50 | { 51 | public: 52 | virtual void funcy() = 0; 53 | virtual void funcy1() = 0; 54 | virtual void funcy2() = 0; 55 | virtual void funcy3() = 0; 56 | virtual void funcy4() = 0; 57 | virtual void funcy5() = 0; 58 | virtual void funcy6() = 0; 59 | virtual ConVar *FindVar(const char *var_name) = 0; 60 | virtual const ConVar *FindVar(const char *var_name) const = 0; 61 | }; 62 | } -------------------------------------------------------------------------------- /DllMain.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////// 2 | /* 3 | SOURCE Base by rifk kolo & gt3x 4 | CREDITS: floesen,outline,inurface 5 | Init - 22.08-2014 6 | */ 7 | /////////////////////////////// 8 | #include "DllMain.h" 9 | 10 | CValve g_Valve; 11 | CESP g_ESP; 12 | EXTERN_C IMAGE_DOS_HEADER __ImageBase; 13 | PaintTraverseFn oPaintTraverse; 14 | 15 | static HMODULE DllBaseAddress() // works with manually mapped dlls (will get us our HMODULE) 16 | { 17 | MEMORY_BASIC_INFORMATION info; 18 | size_t len = VirtualQueryEx(GetCurrentProcess(), (void*)DllBaseAddress, &info, sizeof(info)); 19 | Assert(len == sizeof(info)); 20 | return len ? (HMODULE)info.AllocationBase : NULL; 21 | } 22 | 23 | void __stdcall hkdPaintTraverse(unsigned int vguiPanel, bool forceRepaint, bool allowForce) 24 | { 25 | oPaintTraverse(vguiPanel, forceRepaint, allowForce); 26 | 27 | static bool bDidOnce = false; 28 | 29 | if (bDidOnce == false) 30 | { 31 | g_Draw.InitFonts(); 32 | 33 | #ifdef DEBUGMODE 34 | Base::Debug::LOG("Font initalized"); 35 | #endif 36 | bDidOnce = true; 37 | } 38 | 39 | const char* pszPanelName = g_Valve.pPanel->GetName(vguiPanel); 40 | 41 | static std::string sPanel = "FocusOverlayPanel"; 42 | 43 | if (!strstr(pszPanelName, sPanel.data())) 44 | return; 45 | 46 | //pointer address to convars never change so we only get it once 47 | static ValveSDK::ConVar *pMouseEnable = g_Valve.pConVar->FindVar(/*cl_mouseenable*/XorStr<0x77, 15, 0xA851ADE6>("\x14\x14\x26\x17\x14\x09\x0E\x1B\x1A\xEE\xE0\xE0\xEF\xE1" + 0xA851ADE6).s); 48 | 49 | static std::string sXor =/*INTERWEBZ CSS SHAXZY WAS HERE*/XorStr<0x8C, 14, 0x50D39DA3>("\xC5\xC3\xDA\xCA\xC2\xC6\xD7\xD1\xCE\xB5\xD5\xC4\xCB" + 0x50D39DA3).s; //SHAXZY WAS HERE 50 | 51 | g_Draw.DrawStringA(g_Draw.m_WatermarkFont, true, 250, 20, 255, 255, 255, 255, sXor.data()); 52 | 53 | if (GetAsyncKeyState(VK_INSERT) & 1) 54 | bMenu = !bMenu; 55 | 56 | if (g_CVARS.CvarList[EnableESP]) 57 | g_ESP.draw(); 58 | 59 | //make sure you got m_rawinput 1 ingame... 60 | if (bMenu) 61 | { 62 | g_Mouse.Update(pMouseEnable); 63 | 64 | int copy_x, copy_y; 65 | int copy_w, copy_h; 66 | 67 | g_Menu.GetMenuPos(copy_x, copy_y); 68 | g_Menu.GetMenuSize(copy_w, copy_h); 69 | 70 | g_Menu.DrawMenu(); 71 | 72 | g_Mouse.Drag(g_Mouse.bDragged[0], 73 | !g_Menu.IsHandlingItem(), 74 | g_Mouse.LeftClick(copy_x, copy_y, copy_w, copy_h), copy_x, copy_y, g_Mouse.iDiffX[0], g_Mouse.iDiffY[0]); 75 | 76 | g_Menu.SetMenuPos(copy_x, copy_y); 77 | 78 | if (g_Menu.IsHandlingItem()) 79 | g_Menu.RemoveMenuFlag(FL_DISABLEDRAG);//enable menu dragging 80 | 81 | //DRAW MENU HEREEEEEEEEEE 82 | //concept window by me (to show dragging for example) 83 | //---------------------------------------------------------------------------------------*/ 84 | /*static int winx = 100, winy = 100, winw = 100, winh = winw; 85 | //position (almost whole box) 86 | g_Mouse.Drag(g_Mouse.bDragged[0],//0 dragobject 87 | !(g_Mouse.bDragged[1] || g_Mouse.bDragged[2]), 88 | g_Mouse.LeftClick(winx,winy,winw-25,winh-25),winx,winy,g_Mouse.iDiffX[0],g_Mouse.iDiffY[0]); 89 | //resize (bottom and left side) 90 | g_Mouse.Drag(g_Mouse.bDragged[1],//next dragobject is 1 91 | !(g_Mouse.bDragged[0] || g_Mouse.bDragged[2]),//check all other drag objects being dragged or smth 92 | (g_Mouse.LeftClick(winx,winy+winh-25,winw,25) || g_Mouse.LeftClick(winx+winw-25,winy,25,winh)),//bottom and right side are the spots to resize we reserved 25 pixels for that 93 | winw,winh,g_Mouse.iDiffX[1],g_Mouse.iDiffY[1]);//same number dragobject we used for bDragged 94 | if(winh < 100) 95 | winh = 100; 96 | if(winw < 100) 97 | winw = 100; 98 | g_Draw.FillRGBA(winx,winy,winw,winh,200,70,70,255); 99 | //---------------------------------------------------------------------------------------*/ 100 | 101 | //this comes at end so we overdraw menu 102 | g_Mouse.DrawMouse(); 103 | } 104 | else if (g_Mouse.bReturn)//do this once as buymenu enables/disables mouse same way we do 105 | { 106 | pMouseEnable->SetValue(1); 107 | g_Mouse.bReturn = false; 108 | } 109 | 110 | /*if(bGetMaterials) 111 | { 112 | vecSkyMaterials.clear(); 113 | vecMapMaterials.clear(); 114 | for(ValveSDK::MaterialHandle_t h = 0; h < g_Valve.pMaterialSystem->GetNumMaterials(); h++) 115 | { 116 | ValveSDK::IMaterial *pFirstMaterial = g_Valve.pMaterialSystem->GetMaterial(h); 117 | if(!pFirstMaterial) 118 | continue; 119 | if(strstr(pFirstMaterial->GetTextureGroupName(),XorStr<0xA4,7,0xFAF2E307>("\xF7\xCE\xDF\xE5\xC7\xD1"+0xFAF2E307).s)) 120 | vecSkyMaterials.push_back(pFirstMaterial); 121 | else if(strstr(pFirstMaterial->GetTextureGroupName(),XorStr<0x8A,6,0x3FB546ED>("\xDD\xE4\xFE\xE1\xEA"+0x3FB546ED).s)) 122 | vecMapMaterials.push_back(pFirstMaterial); 123 | else if(strstr(pFirstMaterial->GetName(),XorStr<0x8D,8,0xFE3E79EF>("\xFB\xD1\xE7\xF1\xFF\xF6\xE0"+0xFE3E79EF).s)) 124 | pHands = pFirstMaterial; 125 | } 126 | bGetMaterials = false; 127 | } 128 | static float fOldStrength; 129 | if(g_CVARS.CvarList[Asus]) 130 | { 131 | if((!bAsus || g_CVARS.CvarList[AsusAmount] != fOldStrength) && !vecMapMaterials.empty()) 132 | { 133 | for(int iTex = 0; iTex < vecMapMaterials.size(); iTex++) 134 | { 135 | if(!vecMapMaterials[iTex]) 136 | continue; 137 | vecMapMaterials[iTex]->AlphaModulate((g_CVARS.CvarList[AsusAmount] * 0.1f)); 138 | if(iTex == (vecMapMaterials.size()-1)) 139 | { 140 | bAsus = true; 141 | fOldStrength = g_CVARS.CvarList[AsusAmount]; 142 | } 143 | } 144 | } 145 | } 146 | else 147 | { 148 | if(bAsus && !vecMapMaterials.empty()) 149 | { 150 | for(int iTex = 0; iTex < vecMapMaterials.size(); iTex++) 151 | { 152 | if(!vecMapMaterials[iTex]) 153 | continue; 154 | vecMapMaterials[iTex]->AlphaModulate(1.0f); 155 | if(iTex == (vecMapMaterials.size()-1)) 156 | bAsus = false; 157 | } 158 | } 159 | } 160 | if(g_CVARS.CvarList[NoSky]) 161 | { 162 | if(!bNosky && !vecSkyMaterials.empty()) 163 | { 164 | for(int iTex = 0; iTex < vecSkyMaterials.size(); iTex++) 165 | { 166 | if(!vecSkyMaterials[iTex]) 167 | continue; 168 | vecSkyMaterials[iTex]->ColorModulate(0.0f,0.0f,0.0f); 169 | if(iTex == (vecSkyMaterials.size()-1)) 170 | bNosky = true; 171 | } 172 | } 173 | } 174 | else 175 | { 176 | if(bNosky && !vecSkyMaterials.empty()) 177 | { 178 | for(int iTex = 0; iTex < vecSkyMaterials.size(); iTex++) 179 | { 180 | if(!vecSkyMaterials[iTex]) 181 | continue; 182 | vecSkyMaterials[iTex]->ColorModulate(1.0f,1.0f,1.0f); 183 | if(iTex == (vecSkyMaterials.size()-1)) 184 | bNosky = false; 185 | } 186 | } 187 | } 188 | //CSS only - we just use findmaterial 189 | static bool bHands; 190 | if(g_CVARS.CvarList[NoHands] && !bHands) 191 | { 192 | if(!pHands->GetMaterialVarFlag(ValveSDK::MATERIAL_VAR_NO_DRAW)) 193 | pHands->SetMaterialVarFlag(ValveSDK::MATERIAL_VAR_NO_DRAW,true); 194 | bHands = true; 195 | } 196 | else if(!g_CVARS.CvarList[NoHands] && bHands) 197 | { 198 | if(pHands->GetMaterialVarFlag(ValveSDK::MATERIAL_VAR_NO_DRAW)) 199 | pHands->SetMaterialVarFlag(ValveSDK::MATERIAL_VAR_NO_DRAW,false); 200 | bHands = false; 201 | }*/ 202 | } 203 | 204 | void InitDllThread(void* ptr) 205 | { 206 | #ifdef DEBUGMODE 207 | Base::Debug::AttachDebugConsole(); 208 | #endif 209 | 210 | g_Valve.initSDK(); 211 | 212 | g_NetworkedVariableManager.Init(); 213 | 214 | g_NetworkedVariableManager.HookProp(/*DT_CSPlayer*/XorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_angEyeAngles[0]*/XorStr<0x7E,18,0x0D7A3609>("\x13\x20\xE1\xEF\xE5\xC6\xFD\xE0\xC7\xE9\xEF\xE5\xEF\xF8\xD7\xBD\xD3"+0x0D7A3609).s,PitchEyeAngleProxy); 215 | g_NetworkedVariableManager.HookProp(/*DT_CSPlayer*/XorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_angEyeAngles[1]*/XorStr<0x1B,18,0x97DB0871>("\x76\x43\x7C\x70\x78\x65\x58\x47\x62\x4A\x42\x4A\x42\x5B\x72\x1B\x76"+0x97DB0871).s,YawEyeAngleProxy); 216 | 217 | #ifdef DEBUGMODE 218 | Base::Debug::LOG("Netvars initialized"); 219 | #endif 220 | 221 | Sleep(200); 222 | 223 | if (g_Valve.isInitiated()) 224 | { 225 | if (g_pPanelVMT.bInitialize((PDWORD*)g_Valve.pPanel)) 226 | oPaintTraverse = (PaintTraverseFn)g_pPanelVMT.dwHookMethod((DWORD)hkdPaintTraverse, 41); 227 | 228 | #ifdef DEBUGMODE 229 | Base::Debug::LOG("hooked PaintTraverse"); 230 | #endif 231 | 232 | g_pClientVMT.bInitialize((PDWORD*)g_Valve.pClient); 233 | dwOriginCreateMove = g_pClientVMT.dwGetMethodAddress(21); 234 | g_pClientVMT.dwHookMethod((DWORD)hkdCreateMove, 21); 235 | 236 | #ifdef DEBUGMODE 237 | Base::Debug::LOG("hooked CreateMove"); 238 | #endif 239 | g_Valve.pInput = (ValveSDK::CInput*)**(PDWORD*)(g_pClientVMT.dwGetMethodAddress(21) + INPUTOFFSET); 240 | 241 | #ifdef DEBUGMODE 242 | char szDebugString[1024]; 243 | sprintf(szDebugString, "g_pInput: 0x%08X ", (DWORD)g_Valve.pInput); 244 | Base::Debug::LOG(szDebugString); 245 | #endif 246 | g_pClientVMT.dwHookMethod((DWORD)hkdIN_KeyEvent, 20); 247 | 248 | #ifdef DEBUGMODE 249 | Base::Debug::LOG("hooked IN_KeyEvent"); 250 | #endif 251 | 252 | g_pClientVMT.dwHookMethod((DWORD)hkdFrameStageNotify, 35); 253 | 254 | #ifdef DEBUGMODE 255 | Base::Debug::LOG("hooked FrameStageNotify"); 256 | #endif 257 | 258 | } 259 | /* 260 | 261 | g_pClientVMT.bInitialize((PDWORD*)g_Valve.pClient); 262 | dwOriginCreateMove = g_pClientVMT.dwGetMethodAddress(21); 263 | g_pClientVMT.dwHookMethod((DWORD)hkdCreateMove, 21); 264 | 265 | g_Valve.pInput = (ValveSDK::CInput*)**(PDWORD*)(g_pClientVMT.dwGetMethodAddress(21) + INPUTOFFSET); 266 | 267 | #ifdef DEBUGMODE 268 | char szDebugString[1024]; 269 | sprintf(szDebugString, "g_pInput: 0x%08X ", (DWORD)g_Valve.pInput); 270 | Base::Debug::LOG(szDebugString); 271 | #endif 272 | 273 | g_pInputVMT.bInitialize((PDWORD*)g_Valve.pInput); 274 | g_pInputVMT.dwHookMethod((DWORD)hkdGetUserCmd, 8); 275 | 276 | #ifdef DEBUGMODE 277 | Base::Debug::LOG("hooked GetUserCmd..."); 278 | #endif 279 | 280 | #ifdef DEBUGMODE 281 | Base::Debug::LOG("hooked CreateMove..."); 282 | #endif 283 | 284 | g_pClientVMT.dwHookMethod((DWORD)hkdFrameStageNotify, 35); 285 | 286 | #ifdef DEBUGMODE 287 | Base::Debug::LOG("hooked FrameStageNotify"); 288 | #endif 289 | 290 | g_pClientVMT.dwHookMethod((DWORD)hkdIN_KeyEvent, 20); 291 | 292 | #ifdef DEBUGMODE 293 | Base::Debug::LOG("hooked IN_KeyEvent"); 294 | #endif 295 | 296 | g_pPredictionVMT.bInitialize((PDWORD*)g_Valve.pPred); 297 | g_pPredictionVMT.dwHookMethod((DWORD)hkdRunCommand, 17); 298 | 299 | #ifdef DEBUGMODE 300 | sprintf(szDebugString,"runcommand: 0x%X",g_pPredictionVMT.dwGetMethodAddress(17)); 301 | Base::Debug::LOG(szDebugString); 302 | #endif 303 | 304 | #ifdef DEBUGMODE 305 | Base::Debug::LOG("hooked RunCommand"); 306 | #endif 307 | 308 | g_pPredictionVMT.dwHookMethod((DWORD)hkdFinishMove, 19); 309 | 310 | #ifdef DEBUGMODE 311 | Base::Debug::LOG("hooked FinishMove"); 312 | #endif 313 | 314 | g_pModelRenderVMT.bInitialize((PDWORD*)g_Valve.pModelRender); 315 | g_pModelRenderVMT.dwHookMethod((DWORD)hkdDrawModelExecute,19); 316 | 317 | #ifdef DEBUGMODE 318 | Base::Debug::LOG("hooked DrawModelExecute"); 319 | #endif 320 | 321 | g_pPanelVMT.bInitialize((PDWORD*)g_Valve.pPanel); 322 | g_pPanelVMT.dwHookMethod((DWORD)hkdPaintTraverse, 41); 323 | 324 | #ifdef DEBUGMODE 325 | Base::Debug::LOG("hooked PaintTraverse"); 326 | #endif 327 | 328 | //g_NetworkedVariableManager.HookProp(/*DT_CSPlayerXorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_angEyeAngles[0]XorStr<0x7E,18,0x0D7A3609>("\x13\x20\xE1\xEF\xE5\xC6\xFD\xE0\xC7\xE9\xEF\xE5\xEF\xF8\xD7\xBD\xD3"+0x0D7A3609).s,PitchEyeAngleProxy); 329 | //g_NetworkedVariableManager.HookProp(/*DT_CSPlayerXorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_angEyeAngles[1]XorStr<0x1B,18,0x97DB0871>("\x76\x43\x7C\x70\x78\x65\x58\x47\x62\x4A\x42\x4A\x42\x5B\x72\x1B\x76"+0x97DB0871).s,YawEyeAngleProxy); 330 | 331 | //gGameEventManager.RegisterSelf(); 332 | 333 | /* 334 | char path[260]; 335 | HMODULE hm = NULL; 336 | 337 | if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | 338 | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, 339 | (LPCSTR)&DllBaseAddress, 340 | &hm)) 341 | { 342 | int ret = GetLastError(); 343 | fprintf(stderr, "GetModuleHandle returned %d\n", ret); 344 | } 345 | 346 | char strDLLPath1[MAX_PATH]; 347 | //::GetModuleFileNameA(hm, strDLLPath1, _MAX_PATH); 348 | //LoadConfig(strDLLPath1); 349 | */ 350 | } 351 | 352 | /*void unhookThread(LPARAM lpParam) 353 | { 354 | HMODULE hModule = (HMODULE)lpParam; 355 | while (true) 356 | { 357 | if (GetAsyncKeyState(VK_NUMPAD9) & 1) 358 | { 359 | Sleep(1000); 360 | 361 | g_pClientVMT.UnHook(); 362 | g_pPredictionVMT.UnHook(); 363 | g_pPanelVMT.UnHook(); 364 | 365 | Sleep(2000); 366 | 367 | FreeConsole(); 368 | SendMessage(FindWindow(0, "DebugMessages"), WM_CLOSE, NULL, NULL); 369 | 370 | FreeLibraryAndExitThread(hModule, 0); 371 | } 372 | } 373 | }*/ 374 | 375 | #include "ReflectiveLoader.h" 376 | #include "ReflectiveDLLInjection.h" 377 | 378 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved) 379 | { 380 | if(dwReason == DLL_PROCESS_ATTACH) 381 | { 382 | CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)InitDllThread, hinstDLL, NULL, NULL); 383 | 384 | g_CVARS.Init(hinstDLL); 385 | 386 | g_CVARS.SetDefaultConfig(); 387 | 388 | g_CVARS.CvarList[Triggerbot] = 0; 389 | 390 | /*HW_PROFILE_INFO hwProfileInfo; 391 | 392 | GetCurrentHwProfile(&hwProfileInfo); 393 | 394 | char szFile[2048]; 395 | sprintf(szFile,"%s\\hwid.txt",g_CVARS.szIniFilePath); 396 | 397 | std::ofstream fNew(szFile,std::ios::app); 398 | fNew.write(hwProfileInfo.szHwProfileGuid,strlen(hwProfileInfo.szHwProfileGuid)); 399 | fNew.close();*/ 400 | 401 | //HandleConfig("flick.ini",LoadConfig); 402 | } 403 | else if(dwReason == DLL_QUERY_HMODULE && lpReserved != NULL) 404 | *(HMODULE*)lpReserved = hinstDLL; 405 | 406 | return TRUE; 407 | } 408 | 409 | 410 | 411 | 412 | 413 | 414 | -------------------------------------------------------------------------------- /DllMain.h: -------------------------------------------------------------------------------- 1 | #define _CRT_SECURE_NO_WARNINGS 2 | 3 | #include 4 | #pragma comment(lib, "ws2_32.lib" ) 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "xor.h" 24 | #include "vector.h" 25 | #include "CMath.h" 26 | #include "checksum_crc.h" 27 | #include "sdk.h" 28 | #include "Utils.h" 29 | #include "CValve.h" 30 | #include "CDraw.h" 31 | #include "CWinsock.h" 32 | #include "mouse.h" 33 | #include "menu.h" 34 | 35 | //CSGO 36 | #include "Surface.h" 37 | #include "client.h" 38 | #include "CESP.h" 39 | #include "CNoSpread.h" 40 | #include "CGameEventManager.h" 41 | #include "CAimbot.h" 42 | #include "CVARS.h" 43 | 44 | typedef struct 45 | { 46 | int damage; 47 | int targetId; 48 | DWORD animTimer; 49 | } healthInfo_t; 50 | 51 | extern std::vectorg_healthInfo; 52 | 53 | #pragma warning( disable : 4409 ) 54 | #pragma warning( disable : 4244 ) 55 | #pragma warning( disable : 4018 ) 56 | #pragma warning( disable : 4101 ) 57 | 58 | //#define DEBUGMODE 59 | 60 | extern CValve g_Valve; 61 | extern CDraw g_Draw; 62 | extern CMath g_Math; 63 | 64 | typedef void(__stdcall* PaintTraverseFn)(unsigned int, bool, bool); 65 | extern PaintTraverseFn oPaintTraverse; -------------------------------------------------------------------------------- /HLClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | HLClient rebuild 3 | 22.08.2014 4 | */ 5 | namespace ValveSDK 6 | { 7 | class HLCLient 8 | { 9 | public: 10 | ClientClass* GetAllClasses(VOID) 11 | { 12 | typedef ClientClass* (__thiscall* OriginalFn)(PVOID); 13 | return getvfunc(this, 8)(this); 14 | } 15 | 16 | int GetScreenWidth(VOID) 17 | { 18 | typedef int (__thiscall* OriginalFn)(PVOID); 19 | return getvfunc(this, 56)(this); 20 | } 21 | 22 | int GetScreenHeight(VOID) 23 | { 24 | typedef int (__thiscall* OriginalFn)(PVOID); 25 | return getvfunc(this, 57)(this); 26 | } 27 | 28 | /*int IN_KeyEvent(int eventcode, ButtonCode_t keynum, const char *pszCurrentBinding) 29 | { 30 | typedef int(__thiscall* OriginalFn)(PVOID, int, ButtonCode_t, const char*); 31 | return getvfunc(this, 20)(this, eventcode, keynum, pszCurrentBinding); 32 | }*/ 33 | }; 34 | } -------------------------------------------------------------------------------- /IGameEvent.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class IGameEvent 4 | { 5 | public: 6 | const char* GetName() 7 | { 8 | typedef const char* (__thiscall* OriginalFn)(PVOID); 9 | return getvfunc(this, 1)(this); 10 | } 11 | 12 | int GetInt(const char *keyName, int defaultValue) 13 | { 14 | typedef int(__thiscall* OriginalFn)(PVOID, const char *, int); 15 | return getvfunc(this, 6)(this, keyName, defaultValue); 16 | } 17 | 18 | const char *GetString(const char *keyName, const char *defaultValue) 19 | { 20 | typedef const char* (__thiscall* OriginalFn)(PVOID, const char *, const char*); 21 | return getvfunc(this, 8)(this, keyName, defaultValue); 22 | } 23 | }; 24 | } -------------------------------------------------------------------------------- /IGameEventListener2.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class IGameEventListener2 4 | { 5 | public: 6 | virtual ~IGameEventListener2(void) {}; 7 | 8 | // FireEvent is called by EventManager if event just occured 9 | // KeyValue memory will be freed by manager if not needed anymore 10 | virtual void FireGameEvent(IGameEvent *event) = 0; 11 | }; 12 | 13 | } -------------------------------------------------------------------------------- /IGameEventManager.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class IGameEventManager 4 | { 5 | public: 6 | bool AddListener(IGameEventListener2 *listener, const char *name, bool bServerSide) 7 | { 8 | typedef bool(__thiscall* OriginalFn)(PVOID, IGameEventListener2*, const char*, bool); 9 | return getvfunc(this, 3)(this, listener, name, bServerSide); 10 | } 11 | 12 | bool FireEventClientSide(IGameEvent *event) 13 | { 14 | typedef bool(__thiscall* OriginalFn)(PVOID, IGameEvent*); 15 | return getvfunc(this, 8)(this, event); 16 | } 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /IMoveHelper.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class ImoveHelper 4 | { 5 | public: 6 | void SetHost(CBaseEntity *pPlayer) 7 | { 8 | typedef void(__thiscall* OriginalFn)(PVOID, CBaseEntity *pPlayer); 9 | getvfunc(this, 1)(this, pPlayer); 10 | } 11 | }; 12 | } -------------------------------------------------------------------------------- /INTERWEBZ-Fixed by Shaxzy.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2046 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interwebz", "CSSBase.vcxproj", "{B47833C2-CC00-4490-A751-A16553374E0E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B47833C2-CC00-4490-A751-A16553374E0E}.Debug|x64.ActiveCfg = Debug|x64 17 | {B47833C2-CC00-4490-A751-A16553374E0E}.Debug|x64.Build.0 = Debug|x64 18 | {B47833C2-CC00-4490-A751-A16553374E0E}.Debug|x86.ActiveCfg = Debug|Win32 19 | {B47833C2-CC00-4490-A751-A16553374E0E}.Debug|x86.Build.0 = Debug|Win32 20 | {B47833C2-CC00-4490-A751-A16553374E0E}.Release|x64.ActiveCfg = Release|x64 21 | {B47833C2-CC00-4490-A751-A16553374E0E}.Release|x64.Build.0 = Release|x64 22 | {B47833C2-CC00-4490-A751-A16553374E0E}.Release|x86.ActiveCfg = Release|Win32 23 | {B47833C2-CC00-4490-A751-A16553374E0E}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {8C633D82-0AF6-43BE-B86E-A2AE5EE7E9C1} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /IPanel.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | class IPanel 4 | { 5 | public: 6 | unsigned int GetPanel(int type) 7 | { 8 | typedef unsigned int(__thiscall *tGetPanel)(void*, int type); 9 | return getvfunc(this, 1)(this, type); 10 | } 11 | const char *GetName(unsigned int vguiPanel) 12 | { 13 | typedef const char* (__thiscall* OriginalFn)(PVOID, unsigned int); 14 | return getvfunc(this, 36)(this, vguiPanel); 15 | } 16 | }; 17 | } -------------------------------------------------------------------------------- /ISurface.h: -------------------------------------------------------------------------------- 1 | namespace ValveSDK 2 | { 3 | enum OverrideType_t 4 | { 5 | OVERRIDE_NORMAL = 0, 6 | OVERRIDE_BUILD_SHADOWS, 7 | OVERRIDE_DEPTH_WRITE, 8 | OVERRIDE_WHATEVER 9 | }; 10 | 11 | struct DrawModelState_t 12 | { 13 | studiohdr_t* m_pStudioHdr; 14 | PVOID m_pStudioHWData; 15 | PVOID m_pRenderable; 16 | const matrix3x4_t *m_pModelToWorld; 17 | int m_decals; 18 | int m_drawFlags; 19 | int m_lod; 20 | }; 21 | 22 | struct ModelRenderInfo_t 23 | { 24 | Vector origin; 25 | Vector angles; 26 | PVOID pRenderable; 27 | const model_t *pModel; 28 | const matrix3x4_t *pModelToWorld; 29 | const matrix3x4_t *pLightingOffset; 30 | const Vector *pLightingOrigin; 31 | int flags; 32 | int entity_index; 33 | int skin; 34 | int body; 35 | int hitboxset; 36 | unsigned short instance; 37 | 38 | ModelRenderInfo_t() 39 | { 40 | pModelToWorld = NULL; 41 | pLightingOffset = NULL; 42 | pLightingOrigin = NULL; 43 | } 44 | }; 45 | 46 | enum MaterialVarFlags_t 47 | { 48 | MATERIAL_VAR_DEBUG = (1 << 0), 49 | MATERIAL_VAR_NO_DEBUG_OVERRIDE = (1 << 1), 50 | MATERIAL_VAR_NO_DRAW = (1 << 2), 51 | MATERIAL_VAR_USE_IN_FILLRATE_MODE = (1 << 3), 52 | 53 | MATERIAL_VAR_VERTEXCOLOR = (1 << 4), 54 | MATERIAL_VAR_VERTEXALPHA = (1 << 5), 55 | MATERIAL_VAR_SELFILLUM = (1 << 6), 56 | MATERIAL_VAR_ADDITIVE = (1 << 7), 57 | MATERIAL_VAR_ALPHATEST = (1 << 8), 58 | MATERIAL_VAR_MULTIPASS = (1 << 9), 59 | MATERIAL_VAR_ZNEARER = (1 << 10), 60 | MATERIAL_VAR_MODEL = (1 << 11), 61 | MATERIAL_VAR_FLAT = (1 << 12), 62 | MATERIAL_VAR_NOCULL = (1 << 13), 63 | MATERIAL_VAR_NOFOG = (1 << 14), 64 | MATERIAL_VAR_IGNOREZ = (1 << 15), 65 | MATERIAL_VAR_DECAL = (1 << 16), 66 | MATERIAL_VAR_ENVMAPSPHERE = (1 << 17), 67 | MATERIAL_VAR_NOALPHAMOD = (1 << 18), 68 | MATERIAL_VAR_ENVMAPCAMERASPACE = (1 << 19), 69 | MATERIAL_VAR_BASEALPHAENVMAPMASK = (1 << 20), 70 | MATERIAL_VAR_TRANSLUCENT = (1 << 21), 71 | MATERIAL_VAR_NORMALMAPALPHAENVMAPMASK = (1 << 22), 72 | MATERIAL_VAR_NEEDS_SOFTWARE_SKINNING = (1 << 23), 73 | MATERIAL_VAR_OPAQUETEXTURE = (1 << 24), 74 | MATERIAL_VAR_ENVMAPMODE = (1 << 25), 75 | MATERIAL_VAR_SUPPRESS_DECALS = (1 << 26), 76 | MATERIAL_VAR_HALFLAMBERT = (1 << 27), 77 | MATERIAL_VAR_WIREFRAME = (1 << 28), 78 | MATERIAL_VAR_ALLOWALPHATOCOVERAGE = (1 << 29), 79 | 80 | // NOTE: Only add flags here that either should be read from 81 | // .vmts or can be set directly from client code. Other, internal 82 | // flags should to into the flag enum in IMaterialInternal.h 83 | }; 84 | 85 | class IMaterial 86 | { 87 | public: 88 | virtual const char *GetName() const = 0; 89 | virtual const char *GetTextureGroupName() const = 0; 90 | virtual int vfunc02() = 0; 91 | virtual int vfunc03() = 0; 92 | virtual int vfunc04() = 0; 93 | virtual int vfunc05() = 0; 94 | virtual int vfunc06() = 0; 95 | virtual int vfunc07() = 0; 96 | virtual int vfunc08() = 0; 97 | virtual int vfunc09() = 0; 98 | virtual int vfunc10() = 0; 99 | virtual int vfunc11() = 0; 100 | virtual void IncrementReferenceCount( void ) = 0; 101 | virtual void DecrementReferenceCount( void ) = 0; 102 | virtual int vfunc14() = 0; 103 | virtual int vfunc15() = 0; 104 | virtual int vfunc16() = 0; 105 | virtual int vfunc17() = 0; 106 | virtual int vfunc18() = 0; 107 | virtual int vfunc19() = 0; 108 | virtual int vfunc20() = 0; 109 | virtual int vfunc21() = 0; 110 | virtual int vfunc22() = 0; 111 | virtual int vfunc23() = 0; 112 | virtual int vfunc24() = 0; 113 | virtual int vfunc25() = 0; 114 | virtual int vfunc26() = 0; 115 | virtual void AlphaModulate(float alpha) = 0; 116 | virtual void ColorModulate(float r, float g, float b) = 0; 117 | virtual void SetMaterialVarFlag(MaterialVarFlags_t flag, bool on) = 0; 118 | virtual bool GetMaterialVarFlag(MaterialVarFlags_t flag) const = 0; 119 | virtual int vfunc31() = 0; 120 | virtual int vfunc32() = 0; 121 | virtual int vfunc33() = 0; 122 | virtual int vfunc34() = 0; 123 | virtual int vfunc35() = 0; 124 | virtual int vfunc36() = 0; 125 | virtual int vfunc37() = 0; 126 | virtual int vfunc38() = 0; 127 | virtual int vfunc39() = 0; 128 | virtual int vfunc40() = 0; 129 | virtual int vfunc41() = 0; 130 | virtual bool IsErrorMaterial() = 0; 131 | virtual int vfunc43() = 0; 132 | virtual float GetAlphaModulation() = 0; 133 | virtual void GetColorModulation(float *r, float *g, float *b) = 0; 134 | }; 135 | 136 | class Color 137 | { 138 | public: 139 | Color(int r,int g,int b,int a) 140 | { 141 | _color[0] = (unsigned char)r; 142 | _color[1] = (unsigned char)g; 143 | _color[2] = (unsigned char)b; 144 | _color[3] = (unsigned char)a; 145 | } 146 | 147 | unsigned char _color[4]; 148 | }; 149 | 150 | typedef unsigned short MaterialHandle_t; 151 | 152 | class IMaterialSystem 153 | { 154 | public: 155 | void UncacheMaterials() 156 | { 157 | typedef void(__thiscall* OriginalFn)(PVOID); 158 | getvfunc(this, 65)(this); 159 | } 160 | 161 | IMaterial *CreateMaterial(const char *pMaterialName, PVOID pVMTKeyValues) 162 | { 163 | typedef IMaterial*(__thiscall* OriginalFn)(PVOID,const char*,PVOID); 164 | return getvfunc(this, 70)(this,pMaterialName,pVMTKeyValues); 165 | } 166 | 167 | IMaterial *FindMaterial(char const* pMaterialName, const char *pTextureGroupName, bool complain = true, const char *pComplainPrefix = NULL) 168 | { 169 | typedef IMaterial*(__thiscall* OriginalFn)(PVOID,char const*,const char*,bool,const char*); 170 | return getvfunc(this, 71)(this,pMaterialName,pTextureGroupName,complain,pComplainPrefix); 171 | } 172 | 173 | bool IsMaterialLoaded(const char *pMaterialName) 174 | { 175 | typedef bool(__thiscall* OriginalFn)(PVOID,const char*); 176 | return getvfunc(this, 72)(this,pMaterialName); 177 | } 178 | 179 | MaterialHandle_t FirstMaterial() 180 | { 181 | typedef MaterialHandle_t(__thiscall* OriginalFn)(PVOID); 182 | return getvfunc(this, 73)(this); 183 | } 184 | 185 | MaterialHandle_t NextMaterial(MaterialHandle_t h) 186 | { 187 | typedef MaterialHandle_t(__thiscall* OriginalFn)(PVOID,MaterialHandle_t); 188 | return getvfunc(this, 74)(this,h); 189 | } 190 | 191 | MaterialHandle_t InvalidMaterial() 192 | { 193 | typedef MaterialHandle_t(__thiscall* OriginalFn)(PVOID); 194 | return getvfunc(this, 75)(this); 195 | } 196 | 197 | IMaterial *GetMaterial(MaterialHandle_t h) 198 | { 199 | typedef IMaterial*(__thiscall* OriginalFn)(PVOID,MaterialHandle_t); 200 | return getvfunc(this, 76)(this,h); 201 | } 202 | 203 | int GetNumMaterials() 204 | { 205 | typedef int(__thiscall* OriginalFn)(PVOID); 206 | return getvfunc(this, 77)(this); 207 | } 208 | }; 209 | 210 | class IVModelRender 211 | { 212 | public: 213 | virtual int vfunc00() = 0; 214 | virtual void ForcedMaterialOverride( IMaterial *newMaterial, OverrideType_t nOverrideType = OVERRIDE_NORMAL ) = 0; 215 | virtual bool vfunc02() = 0; 216 | virtual int vfunc03() = 0; 217 | virtual int vfunc04() = 0; 218 | virtual int vfunc05() = 0; 219 | virtual int vfunc06() = 0; 220 | virtual int vfunc07() = 0; 221 | virtual int vfunc08() = 0; 222 | virtual int vfunc09() = 0; 223 | virtual int vfunc10() = 0; 224 | virtual int vfunc11() = 0; 225 | virtual int vfunc12() = 0; 226 | virtual int vfunc13() = 0; 227 | virtual int vfunc14() = 0; 228 | virtual int vfunc15() = 0; 229 | virtual int vfunc16() = 0; 230 | virtual int vfunc17() = 0; 231 | virtual int vfunc18() = 0; 232 | virtual void DrawModelExecute(const DrawModelState_t &state, const ModelRenderInfo_t &pInfo, matrix3x4_t *pCustomBoneToWorld = NULL ) = 0; 233 | }; 234 | 235 | class IVRenderView 236 | { 237 | public: 238 | 239 | virtual void vfunc00() = 0; 240 | virtual void vfunc01() = 0; 241 | virtual void vfunc02() = 0; 242 | virtual void vfunc03() = 0; 243 | 244 | virtual void SetBlend( float blend ) = 0; 245 | virtual float GetBlend( void ) = 0; 246 | 247 | virtual void SetColorModulation( float const* blend ) = 0; 248 | virtual void GetColorModulation( float* blend ) = 0; 249 | }; 250 | 251 | class ISurface 252 | { 253 | public: 254 | void DrawSetColor(int r, int g, int b, int a) 255 | { 256 | typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int); 257 | getvfunc(this, 11)(this, r, g, b, a); 258 | } 259 | 260 | void DrawFilledRect(int x0, int y0, int x1, int y1) 261 | { 262 | typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int); 263 | getvfunc(this, 12)(this, x0, y0, x1, y1); 264 | } 265 | 266 | void DrawLine(int x0, int y0, int x1, int y1) 267 | { 268 | typedef void(__thiscall* OriginalFn)(PVOID, int, int, int, int); 269 | getvfunc(this, 15)(this, x0, y0, x1, y1); 270 | } 271 | 272 | void DrawSetTextFont(unsigned long font) 273 | { 274 | typedef void(__thiscall* OriginalFn)(PVOID, unsigned long); 275 | getvfunc(this, 17)(this, font); 276 | } 277 | 278 | void DrawSetTextColor(Color col) 279 | { 280 | typedef void(__thiscall* OriginalFn)(PVOID, Color); 281 | getvfunc(this, 18)(this, col); 282 | } 283 | 284 | void DrawSetTextPos(int x, int y) 285 | { 286 | typedef void(__thiscall* OriginalFn)(PVOID, int, int); 287 | getvfunc(this, 20)(this, x, y); 288 | } 289 | 290 | void DrawPrintText(const wchar_t *text, int textLen) 291 | { 292 | typedef void(__thiscall* OriginalFn)(PVOID, const wchar_t *, int, int); 293 | return getvfunc(this, 22)(this, text, textLen, 0); 294 | } 295 | 296 | unsigned long CreateFont() 297 | { 298 | typedef unsigned int(__thiscall* OriginalFn)(PVOID); 299 | return getvfunc(this, 66)(this); 300 | } 301 | 302 | void SetFontGlyphSet(unsigned long &font, const char *windowsFontName, int tall, int weight, int blur, int scanlines, int flags) 303 | { 304 | typedef void(__thiscall* OriginalFn)(PVOID, unsigned long, const char*, int, int, int, int, int, int, int); 305 | getvfunc(this, 67)(this, font, windowsFontName, tall, weight, blur, scanlines, flags, 0, 0); 306 | } 307 | 308 | void GetTextSize(unsigned long font, const wchar_t *text, int &wide, int &tall) 309 | { 310 | typedef void(__thiscall* OriginalFn)(void*, unsigned long font, const wchar_t *text, int &wide, int &tall); 311 | getvfunc(this, 75)(this, font, text, wide, tall); 312 | } 313 | }; 314 | } -------------------------------------------------------------------------------- /MD5.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | /* 4 | ================== 5 | MD5Init 6 | 7 | Start MD5 accumulation. Set bit count to 0 and buffer to mysterious initialization constants. 8 | ================== 9 | */ 10 | void MD5Init(MD5Context_t *ctx) 11 | { 12 | ctx->buf[0] = 0x67452301; 13 | ctx->buf[1] = 0xefcdab89; 14 | ctx->buf[2] = 0x98badcfe; 15 | ctx->buf[3] = 0x10325476; 16 | 17 | ctx->bits[0] = 0; 18 | ctx->bits[1] = 0; 19 | } 20 | 21 | /* 22 | =================== 23 | MD5Update 24 | 25 | Update context to reflect the concatenation of another buffer full of bytes. 26 | =================== 27 | */ 28 | void MD5Update(MD5Context_t *ctx, unsigned char const *buf, unsigned int len) 29 | { 30 | unsigned int t; 31 | 32 | /* Update bitcount */ 33 | 34 | t = ctx->bits[0]; 35 | if ((ctx->bits[0] = t + ((unsigned int) len << 3)) < t) 36 | ctx->bits[1]++; /* Carry from low to high */ 37 | ctx->bits[1] += len >> 29; 38 | 39 | t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ 40 | 41 | /* Handle any leading odd-sized chunks */ 42 | 43 | if (t) 44 | { 45 | unsigned char *p = (unsigned char *) ctx->in + t; 46 | 47 | t = 64 - t; 48 | if (len < t) 49 | { 50 | memcpy(p, buf, len); 51 | return; 52 | } 53 | memcpy(p, buf, t); 54 | //byteReverse(ctx->in, 16); 55 | MD5Transform(ctx->buf, (unsigned int *) ctx->in); 56 | buf += t; 57 | len -= t; 58 | } 59 | /* Process data in 64-byte chunks */ 60 | 61 | while (len >= 64) 62 | { 63 | memcpy(ctx->in, buf, 64); 64 | //byteReverse(ctx->in, 16); 65 | MD5Transform(ctx->buf, (unsigned int *) ctx->in); 66 | buf += 64; 67 | len -= 64; 68 | } 69 | 70 | /* Handle any remaining bytes of data. */ 71 | memcpy(ctx->in, buf, len); 72 | } 73 | 74 | /* 75 | =============== 76 | MD5Final 77 | 78 | 79 | Final wrapup - pad to 64-byte boundary with the bit pattern 80 | 1 0* (64-bit count of bits processed, MSB-first) 81 | =============== 82 | */ 83 | void MD5Final(unsigned char digest[16], MD5Context_t *ctx) 84 | { 85 | unsigned count; 86 | unsigned char *p; 87 | 88 | /* Compute number of bytes mod 64 */ 89 | count = (ctx->bits[0] >> 3) & 0x3F; 90 | 91 | /* Set the first char of padding to 0x80. This is safe since there is 92 | always at least one byte free */ 93 | p = ctx->in + count; 94 | *p++ = 0x80; 95 | 96 | /* Bytes of padding needed to make 64 bytes */ 97 | count = 64 - 1 - count; 98 | 99 | /* Pad out to 56 mod 64 */ 100 | if (count < 8) 101 | { 102 | /* Two lots of padding: Pad the first block to 64 bytes */ 103 | memset(p, 0, count); 104 | //byteReverse(ctx->in, 16); 105 | MD5Transform(ctx->buf, (unsigned int *) ctx->in); 106 | 107 | /* Now fill the next block with 56 bytes */ 108 | memset(ctx->in, 0, 56); 109 | } 110 | else 111 | { 112 | /* Pad block to 56 bytes */ 113 | memset(p, 0, count - 8); 114 | } 115 | //byteReverse(ctx->in, 14); 116 | 117 | /* Append length in bits and transform */ 118 | ((unsigned int *) ctx->in)[14] = ctx->bits[0]; 119 | ((unsigned int *) ctx->in)[15] = ctx->bits[1]; 120 | 121 | MD5Transform(ctx->buf, (unsigned int *) ctx->in); 122 | //byteReverse((unsigned char *) ctx->buf, 4); 123 | memcpy(digest, ctx->buf, 16); 124 | memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ 125 | } 126 | 127 | /* The four core functions - F1 is optimized somewhat */ 128 | /* #define F1(x, y, z) (x & y | ~x & z) */ 129 | #define F1(x, y, z) (z ^ (x & (y ^ z))) 130 | #define F2(x, y, z) F1(z, x, y) 131 | #define F3(x, y, z) (x ^ y ^ z) 132 | #define F4(x, y, z) (y ^ (x | ~z)) 133 | 134 | /* This is the central step in the MD5 algorithm. */ 135 | #define MD5STEP(f, w, x, y, z, data, s) \ 136 | ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) 137 | 138 | /* 139 | ================= 140 | MD5Transform 141 | 142 | The core of the MD5 algorithm, this alters an existing MD5 hash to 143 | reflect the addition of 16 longwords of new data. MD5Update blocks 144 | the data and converts bytes into longwords for this routine. 145 | ================= 146 | */ 147 | void MD5Transform(unsigned int buf[4], unsigned int const in[16]) 148 | { 149 | register unsigned int a, b, c, d; 150 | 151 | a = buf[0]; 152 | b = buf[1]; 153 | c = buf[2]; 154 | d = buf[3]; 155 | 156 | MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); 157 | MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); 158 | MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); 159 | MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); 160 | MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); 161 | MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); 162 | MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); 163 | MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); 164 | MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); 165 | MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); 166 | MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); 167 | MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); 168 | MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); 169 | MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); 170 | MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); 171 | MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); 172 | 173 | MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); 174 | MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); 175 | MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); 176 | MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); 177 | MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); 178 | MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); 179 | MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); 180 | MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); 181 | MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); 182 | MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); 183 | MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); 184 | MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); 185 | MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); 186 | MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); 187 | MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); 188 | MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); 189 | 190 | MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); 191 | MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); 192 | MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); 193 | MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); 194 | MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); 195 | MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); 196 | MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); 197 | MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); 198 | MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); 199 | MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); 200 | MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); 201 | MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); 202 | MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); 203 | MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); 204 | MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); 205 | MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); 206 | 207 | MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); 208 | MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); 209 | MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); 210 | MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); 211 | MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); 212 | MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); 213 | MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); 214 | MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); 215 | MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); 216 | MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); 217 | MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); 218 | MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); 219 | MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); 220 | MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); 221 | MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); 222 | MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); 223 | 224 | buf[0] += a; 225 | buf[1] += b; 226 | buf[2] += c; 227 | buf[3] += d; 228 | } 229 | 230 | unsigned int MD5_PseudoRandom(unsigned int nSeed) 231 | { 232 | MD5Context_t ctx; 233 | unsigned char digest[MD5_DIGEST_LENGTH]; // The MD5 Hash 234 | 235 | memset( &ctx, 0, sizeof( ctx ) ); 236 | 237 | MD5Init(&ctx); 238 | MD5Update(&ctx, (unsigned char*)&nSeed, sizeof(nSeed) ); 239 | MD5Final(digest, &ctx); 240 | 241 | return *(unsigned int*)(digest+6); // use 4 middle bytes for random value 242 | } 243 | 244 | 245 | -------------------------------------------------------------------------------- /MD5.h: -------------------------------------------------------------------------------- 1 | #define MD5_DIGEST_LENGTH 16 // 16 bytes == 128 bit digest 2 | 3 | // MD5 Hash 4 | typedef struct 5 | { 6 | unsigned int buf[4]; 7 | unsigned int bits[2]; 8 | unsigned char in[64]; 9 | } MD5Context_t; 10 | 11 | void MD5Init( MD5Context_t *context ); 12 | void MD5Update( MD5Context_t *context, unsigned char const *buf, unsigned int len ); 13 | void MD5Final( unsigned char digest[ MD5_DIGEST_LENGTH ], MD5Context_t *context ); 14 | void MD5Transform(unsigned int buf[4], unsigned int const in[16]); 15 | unsigned int MD5_PseudoRandom(unsigned int nSeed); 16 | -------------------------------------------------------------------------------- /Netvars.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | CNetworkedVariableManager g_NetworkedVariableManager; 3 | 4 | void CNetworkedVariableManager::Init(void) 5 | { 6 | m_tables.clear(); 7 | m_savedproxy.clear(); 8 | 9 | ValveSDK::ClientClass *clientClass = g_Valve.pClient->GetAllClasses(); //g_InterfaceManager->Client()->GetOriginalMethod( INDEX_GETALLCLASSES )( g_InterfaceManager->Client()->thisptr() ); 10 | 11 | if (!clientClass) 12 | { 13 | #ifdef DEBUGMODE 14 | Base::Debug::LOG("ClientClass was not found"); 15 | #endif 16 | return; 17 | } 18 | 19 | while (clientClass) 20 | { 21 | RecvTable *recvTable = clientClass->GetTable(); 22 | 23 | m_tables.push_back(recvTable); 24 | 25 | clientClass = clientClass->NextClass(); 26 | } 27 | } 28 | 29 | CNetworkedVariableManager::~CNetworkedVariableManager(void) 30 | { 31 | for(int i = 0; i < m_savedproxy.size(); i++) 32 | { 33 | RecvProp *recvProp = 0; 34 | GetProp(m_savedproxy[i].szTableName, m_savedproxy[i].szPropName, &recvProp); 35 | 36 | if (!recvProp) 37 | return; 38 | 39 | recvProp->m_ProxyFn = m_savedproxy[i].SavedProxy; 40 | } 41 | } 42 | 43 | // calls GetProp wrapper to get the absolute offset of the prop 44 | int CNetworkedVariableManager::GetOffset(const char *tableName, const char *propName) 45 | { 46 | int offset = GetProp(tableName, propName); 47 | 48 | if (!offset) 49 | { 50 | #ifdef DEBUGMODE 51 | printf("Failed to find offset for prop: %s from table: %s", propName, tableName); 52 | #endif 53 | return 0; 54 | } 55 | 56 | return offset; 57 | } 58 | 59 | 60 | // calls GetProp wrapper to get prop and sets the proxy of the prop 61 | bool CNetworkedVariableManager::HookProp(const char *tableName, const char *propName, RecvVarProxyFn function) 62 | { 63 | RecvProp *recvProp = 0; 64 | GetProp(tableName, propName, &recvProp); 65 | 66 | if (!recvProp) 67 | { 68 | #ifdef DEBUGMODE 69 | Base::Debug::LOG("HookProp failed"); 70 | #endif 71 | return false; 72 | } 73 | 74 | //kolonote: 75 | //make a list of hooked proxies, then when we eject dll we dont have to worry about proxies that point to a pointer where the pointee doesnt exist 76 | Oldproxy_t oldproxyinfo; 77 | 78 | strcpy(oldproxyinfo.szTableName,tableName); 79 | strcpy(oldproxyinfo.szPropName,propName); 80 | 81 | oldproxyinfo.SavedProxy = recvProp->m_ProxyFn; 82 | 83 | m_savedproxy.push_back(oldproxyinfo); 84 | 85 | //kolonote: 86 | //now we replace without worries 87 | recvProp->m_ProxyFn = function; 88 | 89 | return true; 90 | } 91 | 92 | 93 | // wrapper so we can use recursion without too much performance loss 94 | int CNetworkedVariableManager::GetProp(const char *tableName, const char *propName, RecvProp **prop) 95 | { 96 | RecvTable *recvTable = GetTable(tableName); 97 | 98 | if (!recvTable) 99 | { 100 | #ifdef DEBUGMODE 101 | printf("Failed to find table: %s", tableName); 102 | #endif 103 | return 0; 104 | } 105 | 106 | 107 | int offset = GetProp(recvTable, propName, prop); 108 | 109 | if (!offset) 110 | { 111 | #ifdef DEBUGMODE 112 | printf("Failed to find prop: %s from table: %s", propName, tableName); 113 | #endif 114 | return 0; 115 | } 116 | 117 | 118 | return offset; 119 | } 120 | 121 | 122 | // uses recursion to return a the relative offset to the given prop and sets the prop param 123 | int CNetworkedVariableManager::GetProp(RecvTable *recvTable, const char *propName, RecvProp **prop) 124 | { 125 | int extraOffset = 0; 126 | 127 | for (int i = 0; i < recvTable->m_nProps; ++i) 128 | { 129 | RecvProp *recvProp = &recvTable->m_pProps[i]; 130 | 131 | 132 | RecvTable *child = recvProp->m_pDataTable; 133 | 134 | if (child 135 | && (child->m_nProps > 0)) 136 | { 137 | int tmp = GetProp(child, propName, prop); 138 | 139 | if (tmp) 140 | { 141 | extraOffset += (recvProp->m_Offset + tmp); 142 | } 143 | } 144 | 145 | 146 | if (_stricmp(recvProp->m_pVarName, propName)) 147 | { 148 | continue; 149 | } 150 | 151 | 152 | if (prop) 153 | { 154 | *prop = recvProp; 155 | } 156 | 157 | return (recvProp->m_Offset + extraOffset); 158 | } 159 | 160 | return extraOffset; 161 | } 162 | 163 | 164 | RecvTable *CNetworkedVariableManager::GetTable(const char *tableName) 165 | { 166 | if (m_tables.empty()) 167 | { 168 | #ifdef DEBUGMODE 169 | printf("Failed to find table: %s (m_tables is empty)", tableName); 170 | #endif 171 | return 0; 172 | } 173 | 174 | 175 | for each (RecvTable *table in m_tables) 176 | { 177 | if (!table) 178 | { 179 | continue; 180 | } 181 | 182 | 183 | if (_stricmp(table->m_pNetTableName, tableName) == 0) 184 | { 185 | return table; 186 | } 187 | } 188 | 189 | return 0; 190 | } 191 | 192 | //kolonote: 193 | //this is a bit dirty as i wrote it in 2013 -.-'' 194 | static float fOldYaw[66]; 195 | void YawEyeAngleProxy(const CRecvProxyData *pData, void *pStruct, void *pOut) 196 | { 197 | static int iOffset = g_NetworkedVariableManager.GetOffset(/*DT_CSPlayer*/XorStr<0xAA,12,0x6F938DD5>("\xEE\xFF\xF3\xEE\xFD\xFF\xDC\xD0\xCB\xD6\xC6"+0x6F938DD5).s, /*m_angEyeAngles[0]*/XorStr<0x7E,18,0x0D7A3609>("\x13\x20\xE1\xEF\xE5\xC6\xFD\xE0\xC7\xE9\xEF\xE5\xEF\xF8\xD7\xBD\xD3"+0x0D7A3609).s); 198 | 199 | float yawenz = pData->m_Value.m_Float; 200 | 201 | CBaseEntity *pEnt = (CBaseEntity*)pStruct; 202 | 203 | int i = pEnt->GetIndex(); 204 | 205 | Vector *pEyeAngles = (Vector*)((DWORD)pEnt + iOffset); 206 | 207 | //I KNOW I HAVE TO NORMALIZE THE ANGLE BUT CBA ATM HEHE 208 | if(((pEyeAngles->x > 89.0f) && (pEyeAngles->x <= 180.087936f))) 209 | pEyeAngles->x = 89.0f; 210 | 211 | if((pEyeAngles->x < 271.0f) && (pEyeAngles->x > 180.087936f)) 212 | pEyeAngles->x = 271.0f; 213 | 214 | if ( yawenz > 180.0 ) 215 | yawenz -= 360.0; 216 | else if ( yawenz < -180.0 ) 217 | yawenz += 360.0; 218 | 219 | if ( fOldYaw[i] > 180.0 ) 220 | fOldYaw[i] -= 360.0; 221 | else if ( fOldYaw[i] < -180.0 ) 222 | fOldYaw[i] += 360.0; 223 | 224 | float fYawDiff = yawenz - fOldYaw[i]; 225 | 226 | if((abs(fYawDiff) > 178.0f && abs(fYawDiff) < 182.0f)) 227 | { 228 | yawenz += fYawDiff; 229 | 230 | if ( yawenz > 180.0 ) 231 | yawenz -= 360.0; 232 | else if ( yawenz < -180.0 ) 233 | yawenz += 360.0; 234 | 235 | fOldYaw[i] = yawenz - fYawDiff; 236 | } 237 | else 238 | { 239 | fOldYaw[i] = yawenz; 240 | } 241 | 242 | //yaw/pitch mod which ill implement later when playerlist done 243 | if(g_Aimbot.fIsSelected[i] != 0) 244 | { 245 | if(g_Aimbot.fPitchMod[i] == 1) 246 | pEyeAngles->x = 271.0f; 247 | else if(g_Aimbot.fPitchMod[i] == 2) 248 | pEyeAngles->x = 89.0f; 249 | else if(g_Aimbot.fPitchMod[i] == 3) 250 | pEyeAngles->x = 0.0f; 251 | 252 | yawenz -= g_Aimbot.fYawMod[i]; 253 | 254 | if ( yawenz > 180.0 ) 255 | yawenz -= 360.0; 256 | else if ( yawenz < -180.0 ) 257 | yawenz += 360.0; 258 | } 259 | 260 | *(PFLOAT)pOut = yawenz; 261 | } 262 | 263 | void PitchEyeAngleProxy(const CRecvProxyData *pData, void *pStruct, void *pOut) 264 | { 265 | float p = pData->m_Value.m_Float; 266 | 267 | *(PFLOAT)pOut = p; 268 | } 269 | 270 | 271 | 272 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Interwebz-css 2 | 3 | INTERWEBZ.CC fixed source for Counter-Strike: Source (steam) 4 | You'll need an .dll injector to use this. 5 | ![Alt text](https://steamuserimages-a.akamaihd.net/ugc/965355694141458866/E02D48EA455A0A8A977D4B732AEA6B7BF69E6EA8/ "Interwebz fixed by Shaxzy") 6 | -------------------------------------------------------------------------------- /ReflectiveDLLInjection.h: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #ifndef _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H 29 | #define _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H 30 | //===============================================================================================// 31 | #define WIN32_LEAN_AND_MEAN 32 | #include 33 | 34 | // we declare some common stuff in here... 35 | 36 | #define DLL_METASPLOIT_ATTACH 4 37 | #define DLL_METASPLOIT_DETACH 5 38 | #define DLL_QUERY_HMODULE 6 39 | 40 | #define DEREF( name )*(UINT_PTR *)(name) 41 | #define DEREF_64( name )*(DWORD64 *)(name) 42 | #define DEREF_32( name )*(DWORD *)(name) 43 | #define DEREF_16( name )*(WORD *)(name) 44 | #define DEREF_8( name )*(BYTE *)(name) 45 | 46 | typedef ULONG_PTR (WINAPI * REFLECTIVELOADER)( VOID ); 47 | typedef BOOL (WINAPI * DLLMAIN)( HINSTANCE, DWORD, LPVOID ); 48 | 49 | #define DLLEXPORT __declspec( dllexport ) 50 | 51 | //===============================================================================================// 52 | #endif 53 | //===============================================================================================// 54 | -------------------------------------------------------------------------------- /ReflectiveLoader.h: -------------------------------------------------------------------------------- 1 | //===============================================================================================// 2 | // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com) 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are permitted 6 | // provided that the following conditions are met: 7 | // 8 | // * Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // * Redistributions in binary form must reproduce the above copyright notice, this list of 12 | // conditions and the following disclaimer in the documentation and/or other materials provided 13 | // with the distribution. 14 | // 15 | // * Neither the name of Harmony Security nor the names of its contributors may be used to 16 | // endorse or promote products derived from this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 19 | // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | //===============================================================================================// 28 | #ifndef _REFLECTIVEDLLINJECTION_REFLECTIVELOADER_H 29 | #define _REFLECTIVEDLLINJECTION_REFLECTIVELOADER_H 30 | //===============================================================================================// 31 | #define WIN32_LEAN_AND_MEAN 32 | #include 33 | #include 34 | #include 35 | 36 | #include "ReflectiveDLLInjection.h" 37 | 38 | typedef HMODULE (WINAPI * LOADLIBRARYA)( LPCSTR ); 39 | typedef FARPROC (WINAPI * GETPROCADDRESS)( HMODULE, LPCSTR ); 40 | typedef LPVOID (WINAPI * VIRTUALALLOC)( LPVOID, SIZE_T, DWORD, DWORD ); 41 | typedef DWORD (NTAPI * NTFLUSHINSTRUCTIONCACHE)( HANDLE, PVOID, ULONG ); 42 | 43 | #define KERNEL32DLL_HASH 0x6A4ABC5B 44 | #define NTDLLDLL_HASH 0x3CFA685D 45 | 46 | #define LOADLIBRARYA_HASH 0xEC0E4E8E 47 | #define GETPROCADDRESS_HASH 0x7C0DFCAA 48 | #define VIRTUALALLOC_HASH 0x91AFCA54 49 | #define NTFLUSHINSTRUCTIONCACHE_HASH 0x534C0AB8 50 | 51 | #define IMAGE_REL_BASED_ARM_MOV32A 5 52 | #define IMAGE_REL_BASED_ARM_MOV32T 7 53 | 54 | #define ARM_MOV_MASK (DWORD)(0xFBF08000) 55 | #define ARM_MOV_MASK2 (DWORD)(0xFBF08F00) 56 | #define ARM_MOVW 0xF2400000 57 | #define ARM_MOVT 0xF2C00000 58 | 59 | #define HASH_KEY 13 60 | //===============================================================================================// 61 | #pragma intrinsic( _rotr ) 62 | 63 | __forceinline DWORD ror( DWORD d ) 64 | { 65 | return _rotr( d, HASH_KEY ); 66 | } 67 | 68 | __forceinline DWORD hash( char * c ) 69 | { 70 | register DWORD h = 0; 71 | do 72 | { 73 | h = ror( h ); 74 | h += *c; 75 | } while( *++c ); 76 | 77 | return h; 78 | } 79 | //===============================================================================================// 80 | typedef struct _UNICODE_STR 81 | { 82 | USHORT Length; 83 | USHORT MaximumLength; 84 | PWSTR pBuffer; 85 | } UNICODE_STR, *PUNICODE_STR; 86 | 87 | // WinDbg> dt -v ntdll!_LDR_DATA_TABLE_ENTRY 88 | //__declspec( align(8) ) 89 | typedef struct _LDR_DATA_TABLE_ENTRY 90 | { 91 | //LIST_ENTRY InLoadOrderLinks; // As we search from PPEB_LDR_DATA->InMemoryOrderModuleList we dont use the first entry. 92 | LIST_ENTRY InMemoryOrderModuleList; 93 | LIST_ENTRY InInitializationOrderModuleList; 94 | PVOID DllBase; 95 | PVOID EntryPoint; 96 | ULONG SizeOfImage; 97 | UNICODE_STR FullDllName; 98 | UNICODE_STR BaseDllName; 99 | ULONG Flags; 100 | SHORT LoadCount; 101 | SHORT TlsIndex; 102 | LIST_ENTRY HashTableEntry; 103 | ULONG TimeDateStamp; 104 | } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; 105 | 106 | // WinDbg> dt -v ntdll!_PEB_LDR_DATA 107 | typedef struct _PEB_LDR_DATA //, 7 elements, 0x28 bytes 108 | { 109 | DWORD dwLength; 110 | DWORD dwInitialized; 111 | LPVOID lpSsHandle; 112 | LIST_ENTRY InLoadOrderModuleList; 113 | LIST_ENTRY InMemoryOrderModuleList; 114 | LIST_ENTRY InInitializationOrderModuleList; 115 | LPVOID lpEntryInProgress; 116 | } PEB_LDR_DATA, * PPEB_LDR_DATA; 117 | 118 | // WinDbg> dt -v ntdll!_PEB_FREE_BLOCK 119 | typedef struct _PEB_FREE_BLOCK // 2 elements, 0x8 bytes 120 | { 121 | struct _PEB_FREE_BLOCK * pNext; 122 | DWORD dwSize; 123 | } PEB_FREE_BLOCK, * PPEB_FREE_BLOCK; 124 | 125 | // struct _PEB is defined in Winternl.h but it is incomplete 126 | // WinDbg> dt -v ntdll!_PEB 127 | typedef struct __PEB // 65 elements, 0x210 bytes 128 | { 129 | BYTE bInheritedAddressSpace; 130 | BYTE bReadImageFileExecOptions; 131 | BYTE bBeingDebugged; 132 | BYTE bSpareBool; 133 | LPVOID lpMutant; 134 | LPVOID lpImageBaseAddress; 135 | PPEB_LDR_DATA pLdr; 136 | LPVOID lpProcessParameters; 137 | LPVOID lpSubSystemData; 138 | LPVOID lpProcessHeap; 139 | PRTL_CRITICAL_SECTION pFastPebLock; 140 | LPVOID lpFastPebLockRoutine; 141 | LPVOID lpFastPebUnlockRoutine; 142 | DWORD dwEnvironmentUpdateCount; 143 | LPVOID lpKernelCallbackTable; 144 | DWORD dwSystemReserved; 145 | DWORD dwAtlThunkSListPtr32; 146 | PPEB_FREE_BLOCK pFreeList; 147 | DWORD dwTlsExpansionCounter; 148 | LPVOID lpTlsBitmap; 149 | DWORD dwTlsBitmapBits[2]; 150 | LPVOID lpReadOnlySharedMemoryBase; 151 | LPVOID lpReadOnlySharedMemoryHeap; 152 | LPVOID lpReadOnlyStaticServerData; 153 | LPVOID lpAnsiCodePageData; 154 | LPVOID lpOemCodePageData; 155 | LPVOID lpUnicodeCaseTableData; 156 | DWORD dwNumberOfProcessors; 157 | DWORD dwNtGlobalFlag; 158 | LARGE_INTEGER liCriticalSectionTimeout; 159 | DWORD dwHeapSegmentReserve; 160 | DWORD dwHeapSegmentCommit; 161 | DWORD dwHeapDeCommitTotalFreeThreshold; 162 | DWORD dwHeapDeCommitFreeBlockThreshold; 163 | DWORD dwNumberOfHeaps; 164 | DWORD dwMaximumNumberOfHeaps; 165 | LPVOID lpProcessHeaps; 166 | LPVOID lpGdiSharedHandleTable; 167 | LPVOID lpProcessStarterHelper; 168 | DWORD dwGdiDCAttributeList; 169 | LPVOID lpLoaderLock; 170 | DWORD dwOSMajorVersion; 171 | DWORD dwOSMinorVersion; 172 | WORD wOSBuildNumber; 173 | WORD wOSCSDVersion; 174 | DWORD dwOSPlatformId; 175 | DWORD dwImageSubsystem; 176 | DWORD dwImageSubsystemMajorVersion; 177 | DWORD dwImageSubsystemMinorVersion; 178 | DWORD dwImageProcessAffinityMask; 179 | DWORD dwGdiHandleBuffer[34]; 180 | LPVOID lpPostProcessInitRoutine; 181 | LPVOID lpTlsExpansionBitmap; 182 | DWORD dwTlsExpansionBitmapBits[32]; 183 | DWORD dwSessionId; 184 | ULARGE_INTEGER liAppCompatFlags; 185 | ULARGE_INTEGER liAppCompatFlagsUser; 186 | LPVOID lppShimData; 187 | LPVOID lpAppCompatInfo; 188 | UNICODE_STR usCSDVersion; 189 | LPVOID lpActivationContextData; 190 | LPVOID lpProcessAssemblyStorageMap; 191 | LPVOID lpSystemDefaultActivationContextData; 192 | LPVOID lpSystemAssemblyStorageMap; 193 | DWORD dwMinimumStackCommit; 194 | } _PEB, * _PPEB; 195 | 196 | typedef struct 197 | { 198 | WORD offset:12; 199 | WORD type:4; 200 | } IMAGE_RELOC, *PIMAGE_RELOC; 201 | //===============================================================================================// 202 | #endif 203 | //===============================================================================================// -------------------------------------------------------------------------------- /Surface.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | CDraw g_Draw; 4 | 5 | bool bMenu = true; 6 | 7 | std::vector vecMapMaterials; 8 | std::vector vecOldMapMaterials; 9 | std::vector vecSkyMaterials; 10 | ValveSDK::IMaterial *pHands = NULL; 11 | 12 | bool bGetMaterials = true; 13 | 14 | bool LoadFromBuff(KeyValues *pThis, const char *pszFirst, const char *pszSecond, PVOID pSomething = 0, PVOID pAnother = 0) 15 | { 16 | typedef bool(__thiscall *LoadFromBuffer_t)(KeyValues*,const char*,const char*,PVOID,PVOID); 17 | 18 | static DWORD dwAddress = NULL; 19 | 20 | if(dwAddress == NULL) 21 | { 22 | dwAddress = Base::Utils::PatternSearch(/*client.dll*/XorStr<0xA1,11,0x8F27B968>("\xC2\xCE\xCA\xC1\xCB\xD2\x89\xCC\xC5\xC6"+0x8F27B968).s,(PBYTE)"\x55\x8B\xEC\x83\xEC\x38\x53\x8B\x5D\x0C",/*xxxxxxxxxx*/XorStr<0x4A,11,0x4007B1F8>("\x32\x33\x34\x35\x36\x37\x28\x29\x2A\x2B"+0x4007B1F8).s,NULL,NULL); 23 | #ifdef DEBUGMODE 24 | char szLog[256]; 25 | sprintf(szLog,"LoadFromBuffer: 0x%x",dwAddress); 26 | Base::Debug::LOG(szLog); 27 | #endif 28 | } 29 | 30 | static LoadFromBuffer_t callLoadBuff = (LoadFromBuffer_t)(dwAddress); 31 | 32 | return callLoadBuff(pThis,pszFirst,pszSecond,pSomething,pAnother); 33 | } 34 | 35 | void ChamModel( float r, float g, float b, ValveSDK::IMaterial *pMat) 36 | { 37 | float fColor[4] = { r/255, g/255, b/255, 1.0f }; 38 | 39 | static float fGetColor[4]; 40 | 41 | g_Valve.pRenderView->GetColorModulation(fGetColor); 42 | 43 | if(fGetColor[0] != fColor[0] || fGetColor[1] != fColor[1] || fGetColor[2] != fColor[2]) 44 | g_Valve.pRenderView->SetColorModulation( fColor ); 45 | 46 | if(pMat) 47 | g_Valve.pModelRender->ForcedMaterialOverride(pMat); 48 | } 49 | 50 | void FullCham( ValveSDK::IMaterial *pMat, const ValveSDK::ModelRenderInfo_t &pInfo, int r, int g, int b, int r2, int g2, int b2, bool bDeadIgnorez) 51 | { 52 | CBaseEntity *pBaseEnt = g_Valve.pEntList->GetClientEntity(pInfo.entity_index); 53 | 54 | if(!pBaseEnt) 55 | { 56 | g_Valve.pModelRender->ForcedMaterialOverride(NULL); 57 | return; 58 | } 59 | 60 | if(pBaseEnt->GetHealth() >= 1)//regular lifestate checking didnt work -.-'''' 61 | { 62 | int iTeamNum = pBaseEnt->GetTeamNum(); 63 | 64 | CBaseEntity *pLocal = g_Valve.pEntList->GetClientEntity(g_Valve.pEngine->GetLocalPlayer()); 65 | 66 | int iMyTeamNum = pLocal->GetTeamNum(); 67 | 68 | if(g_CVARS.CvarList[ChamsEnemyOnly] && iTeamNum == iMyTeamNum) 69 | return; 70 | 71 | if( iTeamNum == 3 ) 72 | ChamModel(r, g, b, pMat); 73 | else if( iTeamNum == 2 ) 74 | ChamModel(r2, g2, b2, pMat); 75 | else 76 | g_Valve.pModelRender->ForcedMaterialOverride(NULL); 77 | } 78 | else if(!bDeadIgnorez) 79 | ChamModel(255, 255, 255, pMat);//if deed then they white hehe 80 | } 81 | 82 | //kolonote: 83 | //macro c&p from my REAAAAALY old source (tbh kiro didnt make this first as i made it already in 2010 hah ownd - yes i did give him my code why ? hehe) 84 | #define MAT( _TYPE_ ) "\"" + _TYPE_ + "\"\n{\n\t\"$basetexture\" \"vgui/white_additive\"\n\t\"$ignorez\" \"0\"\n\t\"$nofog\" \"1\"\n\t\"$halflambert\" \"1\"\n}" 85 | #define MAT_IGNOREZ( _TYPE_ ) "\"" + _TYPE_ + "\"\n{\n\t\"$basetexture\" \"vgui/white_additive\"\n\t\"$ignorez\" \"1\"\n\t\"$nofog\" \"1\"\n\t\"$halflambert\" \"1\"\n}" 86 | 87 | void GenerateRandomString(char *s, const int len) 88 | { 89 | static const char alphanum[] = 90 | "0123456789" 91 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 92 | "abcdefghijklmnopqrstuvwxyz"; 93 | 94 | for (int i = 0; i < len; i++) 95 | { 96 | s[i] = alphanum[rand() % (sizeof(alphanum) - 1)]; 97 | } 98 | 99 | s[len] = 0; 100 | } 101 | 102 | ValveSDK::IMaterial *CreateMaterial(BOOL bFullbright, BOOL bIgnorez) 103 | { 104 | char szBuff[2048]; 105 | 106 | std::string type = (bFullbright ? /*UnlitGeneric*/XorStr<0xAF,13,0x932BA6F1>("\xFA\xDE\xDD\xDB\xC7\xF3\xD0\xD8\xD2\xCA\xD0\xD9"+0x932BA6F1).s : /*VertexLitGeneric*/XorStr<0xFD,17,0x1247276C>("\xAB\x9B\x8D\x74\x64\x7A\x4F\x6D\x71\x41\x62\x66\x6C\x78\x62\x6F"+0x1247276C).s); 107 | std::string tmp( (bIgnorez ? MAT_IGNOREZ(type) : MAT(type)) ); 108 | sprintf( szBuff, tmp.c_str() ); 109 | 110 | KeyValues *pKeyValues = new KeyValues(type.c_str()); 111 | 112 | //generate some random file name for the .vmt (residing only in memory) 113 | char szMaterialName[128]; 114 | GenerateRandomString(szMaterialName,17); 115 | strcat(szMaterialName,/*.vmt*/XorStr<0x26,5,0x8CB78199>("\x08\x51\x45\x5D"+0x8CB78199).s); 116 | 117 | LoadFromBuff(pKeyValues,szMaterialName,szBuff); 118 | 119 | ValveSDK::IMaterial *pNew = g_Valve.pMaterialSystem->CreateMaterial(szMaterialName,(PVOID)pKeyValues); 120 | 121 | if(pNew) 122 | pNew->IncrementReferenceCount(); 123 | 124 | #ifdef DEBUGMODE 125 | char szNewMaterial[1024]; 126 | sprintf(szNewMaterial,"Created new Valve Material Type[%s] Fullbright[%i] Ignorez[%i]",szMaterialName,bFullbright,bIgnorez); 127 | Base::Debug::LOG(szNewMaterial); 128 | #endif 129 | 130 | return pNew; 131 | } 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /Surface.h: -------------------------------------------------------------------------------- 1 | extern void FullCham( ValveSDK::IMaterial *pMat, const ValveSDK::ModelRenderInfo_t &pInfo, int r, int g, int b, int r2, int g2, int b2, bool bDeadIgnorez = false); 2 | extern ValveSDK::IMaterial *CreateMaterial(BOOL bFullbright, BOOL bIgnorez); 3 | extern void GenerateRandomString(char *s, const int len); 4 | extern void ChamModel( float r, float g, float b, ValveSDK::IMaterial *pMat); 5 | 6 | extern bool bMenu; 7 | extern bool bGetMaterials; -------------------------------------------------------------------------------- /Utils.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | namespace Base 3 | { 4 | namespace Utils 5 | { 6 | ULONG PatternSearch(std::string sModuleName, PBYTE pbPattern, std::string sMask, 7 | ULONG uCodeBase, ULONG uSizeOfCode) 8 | { 9 | BOOL bPatternDidMatch = FALSE; 10 | HMODULE hModule = GetModuleHandle(sModuleName.c_str()); 11 | 12 | if (!hModule) 13 | return 0x0; 14 | 15 | PIMAGE_DOS_HEADER pDsHeader = PIMAGE_DOS_HEADER(hModule); 16 | PIMAGE_NT_HEADERS pPeHeader = PIMAGE_NT_HEADERS(LONG(hModule) + pDsHeader->e_lfanew); 17 | PIMAGE_OPTIONAL_HEADER pOptionalHeader = &pPeHeader->OptionalHeader; 18 | 19 | if (uCodeBase == 0x0) 20 | uCodeBase = (ULONG)hModule + pOptionalHeader->BaseOfCode; 21 | 22 | if (uSizeOfCode == 0x0) 23 | uSizeOfCode = pOptionalHeader->SizeOfCode; 24 | 25 | ULONG uArraySize = sMask.length(); 26 | 27 | if (!uCodeBase || !uSizeOfCode || !uArraySize) 28 | return 0x0; 29 | 30 | for (size_t i = uCodeBase; i <= uCodeBase + uSizeOfCode; i++) 31 | { 32 | for (size_t t = 0; t < uArraySize; t++) 33 | { 34 | if (*((PBYTE)i + t) == pbPattern[t] || sMask.c_str()[t] == '?') 35 | bPatternDidMatch = TRUE; 36 | 37 | else 38 | { 39 | bPatternDidMatch = FALSE; 40 | break; 41 | } 42 | } 43 | 44 | if (bPatternDidMatch) 45 | return i; 46 | } 47 | 48 | return 0x0; 49 | } 50 | 51 | HMODULE GetModuleHandleSafe(const char* pszModuleName) 52 | { 53 | HMODULE hmModuleHandle = NULL; 54 | 55 | do 56 | { 57 | hmModuleHandle = GetModuleHandle(pszModuleName); 58 | Sleep(1); 59 | } while (hmModuleHandle == NULL); 60 | 61 | return hmModuleHandle; 62 | } 63 | 64 | } 65 | 66 | #ifdef DEBUGMODE 67 | namespace Debug 68 | { 69 | bool AttachDebugConsole(void) 70 | { 71 | FILE* g_pConStream; 72 | 73 | if (!AttachConsole(ATTACH_PARENT_PROCESS)) 74 | { 75 | if (!AllocConsole()) 76 | return false; 77 | } 78 | 79 | // if (!SetConsoleTitle("DebugMessages")) 80 | //return false; 81 | 82 | errno_t err = freopen_s(&g_pConStream, "CONOUT$", "w", stdout); 83 | 84 | if (err != 0) 85 | return false; 86 | 87 | return true; 88 | } 89 | void LOG(const char* output) 90 | { 91 | printf(output); 92 | printf("\n"); 93 | } 94 | } 95 | #endif 96 | } 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Utils.h: -------------------------------------------------------------------------------- 1 | namespace Base 2 | { 3 | namespace Utils 4 | { 5 | class CVMTHookManager 6 | { 7 | public: 8 | CVMTHookManager(void) 9 | { 10 | memset(this, 0, sizeof(CVMTHookManager)); 11 | } 12 | 13 | CVMTHookManager(PDWORD* ppdwClassBase) 14 | { 15 | bInitialize(ppdwClassBase); 16 | } 17 | 18 | ~CVMTHookManager(void) 19 | { 20 | UnHook(); 21 | } 22 | 23 | bool bInitialize(PDWORD* ppdwClassBase) 24 | { 25 | m_ppdwClassBase = ppdwClassBase; 26 | m_pdwOldVMT = *ppdwClassBase; 27 | m_dwVMTSize = dwGetVMTCount(*ppdwClassBase); 28 | m_pdwNewVMT = new DWORD[m_dwVMTSize]; 29 | memcpy(m_pdwNewVMT, m_pdwOldVMT, sizeof(DWORD)* m_dwVMTSize); 30 | *ppdwClassBase = m_pdwNewVMT; 31 | return true; 32 | } 33 | 34 | bool bInitialize(PDWORD** pppdwClassBase) 35 | { 36 | return bInitialize(*pppdwClassBase); 37 | } 38 | 39 | void UnHook(void) 40 | { 41 | if (m_ppdwClassBase) 42 | { 43 | *m_ppdwClassBase = m_pdwOldVMT; 44 | } 45 | } 46 | 47 | void ReHook(void) 48 | { 49 | if (m_ppdwClassBase) 50 | { 51 | *m_ppdwClassBase = m_pdwNewVMT; 52 | } 53 | } 54 | 55 | int iGetFuncCount(void) 56 | { 57 | return (int)m_dwVMTSize; 58 | } 59 | 60 | DWORD dwGetMethodAddress(int Index) 61 | { 62 | if (Index >= 0 && Index <= (int)m_dwVMTSize && m_pdwOldVMT != NULL) 63 | { 64 | return m_pdwOldVMT[Index]; 65 | } 66 | return NULL; 67 | } 68 | 69 | PDWORD pdwGetOldVMT(void) 70 | { 71 | return m_pdwOldVMT; 72 | } 73 | 74 | DWORD dwHookMethod(DWORD dwNewFunc, unsigned int iIndex) 75 | { 76 | if (m_pdwNewVMT && m_pdwOldVMT && iIndex <= m_dwVMTSize && iIndex >= 0) 77 | { 78 | m_pdwNewVMT[iIndex] = dwNewFunc; 79 | return m_pdwOldVMT[iIndex]; 80 | } 81 | return NULL; 82 | } 83 | 84 | private: 85 | DWORD dwGetVMTCount(PDWORD pdwVMT) 86 | { 87 | DWORD dwIndex = 0; 88 | 89 | for (dwIndex = 0; pdwVMT[dwIndex]; dwIndex++) 90 | { 91 | if (IsBadCodePtr((FARPROC)pdwVMT[dwIndex])) 92 | { 93 | break; 94 | } 95 | } 96 | return dwIndex; 97 | } 98 | PDWORD* m_ppdwClassBase; 99 | PDWORD m_pdwNewVMT, m_pdwOldVMT; 100 | DWORD m_dwVMTSize; 101 | }; 102 | 103 | extern ULONG PatternSearch(std::string ModuleName, PBYTE Pattern, std::string Mask, 104 | ULONG uCodeBase, ULONG uSizeOfCode); 105 | extern HMODULE GetModuleHandleSafe(const char* pszModuleName); 106 | } 107 | 108 | namespace Debug 109 | { 110 | extern bool AttachDebugConsole(void); 111 | extern void LOG(const char* output); 112 | } 113 | } 114 | 115 | 116 | -------------------------------------------------------------------------------- /Vector.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/Vector.h -------------------------------------------------------------------------------- /checksum_crc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/checksum_crc.cpp -------------------------------------------------------------------------------- /checksum_crc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/checksum_crc.h -------------------------------------------------------------------------------- /client.h: -------------------------------------------------------------------------------- 1 | void __stdcall hkdCreateMove(int sequence_number, float input_sample_frametime, bool active); 2 | void __stdcall hkdRunCommand(CBaseEntity* pEntity, ValveSDK::CInput::CUserCmd* pUserCmd, void* moveHelper); 3 | void __stdcall hkdFrameStageNotify(ClientFrameStage_t curStage); 4 | void __stdcall hkdPaintTraverse(unsigned int vguiPanel, bool forceRepaint, bool allowForce); 5 | void __stdcall hkdDrawModelExecute(const ValveSDK::DrawModelState_t &state, const ValveSDK::ModelRenderInfo_t &pInfo, matrix3x4_t *pCustomBoneToWorld = NULL); 6 | ValveSDK::CInput::CUserCmd* __stdcall hkdGetUserCmd(int sequence_number); 7 | int __stdcall hkdIN_KeyEvent(int eventcode,ValveSDK::ButtonCode_t keynum,const char *pszCurrentBinding); 8 | void __stdcall hkdFinishMove(CBaseEntity *player, ValveSDK::CInput::CUserCmd *ucmd, PVOID move); 9 | 10 | extern DWORD dwOriginCreateMove; 11 | extern Base::Utils::CVMTHookManager g_pClientVMT; 12 | extern Base::Utils::CVMTHookManager g_pPanelVMT; 13 | extern Base::Utils::CVMTHookManager g_pPredictionVMT; 14 | extern Base::Utils::CVMTHookManager g_pModelRenderVMT; 15 | extern Base::Utils::CVMTHookManager g_pInputVMT; -------------------------------------------------------------------------------- /dt_common2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/dt_common2.h -------------------------------------------------------------------------------- /dt_recv2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/dt_recv2.h -------------------------------------------------------------------------------- /menu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/menu.cpp -------------------------------------------------------------------------------- /menu.h: -------------------------------------------------------------------------------- 1 | #define NUM_OF_TABS 5 2 | #define NUM_OF_CFGS 6 3 | #define NUM_OF_TOTAL_LISTITEMS 13 4 | 5 | 6 | enum 7 | { 8 | FL_DISABLEDRAG = (1 << 1) 9 | }; 10 | 11 | enum 12 | { 13 | DEFAULTCFG, 14 | LEGITCFG, 15 | RAGECFG, 16 | HVHCFG, 17 | MMCFG, 18 | CUSTOMCFG 19 | }; 20 | 21 | enum 22 | { 23 | AIMBOTTAB, 24 | ESPTAB, 25 | MISCTAB, 26 | SPECIALTAB, 27 | COLORTAB 28 | }; 29 | 30 | enum 31 | { 32 | SMALL_CHAMSTAB, 33 | SMALL_GLOWTAB, 34 | SMALL_ESPTAB, 35 | SMALL_PLAYERLISTTAB, 36 | SMALL_MODIFIEDTAB 37 | }; 38 | 39 | enum 40 | { 41 | ONOFF, 42 | DROPDOWN, 43 | SLIDER, 44 | BUTTON, 45 | ADDER 46 | }; 47 | 48 | typedef struct 49 | { 50 | char szName[128]; 51 | int iSpecialValue; 52 | } ListItem_t; 53 | 54 | //pseudo itemlist by kolo ehi ehi 55 | //this will be dynamic so we will refresh it every frame. i know its slow but who carezz ? 56 | class cListItem 57 | { 58 | public: 59 | void Draw(int x, int y, int w, int h); 60 | 61 | void OnlyList() 62 | { 63 | bOnlyListOnPage = true; 64 | } 65 | 66 | bool IsOnlyListOnPage() 67 | { 68 | return bOnlyListOnPage; 69 | } 70 | 71 | void ClearList() 72 | { 73 | vecListItems.clear(); 74 | 75 | bOnlyListOnPage = false; 76 | } 77 | 78 | int GetNumberOfItems() 79 | { 80 | return vecListItems.size(); 81 | } 82 | 83 | void AddItem(const char *pszName, int iSpecialValue, bool bSelected = false) 84 | { 85 | ListItem_t liNew; 86 | 87 | strcpy(liNew.szName,pszName); 88 | 89 | liNew.iSpecialValue = iSpecialValue; 90 | 91 | vecListItems.push_back(liNew); 92 | } 93 | 94 | bool IsScrollingNeeded() 95 | { 96 | return bScrollingNeeded; 97 | } 98 | 99 | bool IsFocused() 100 | { 101 | return bListInFocus; 102 | } 103 | 104 | void SetFocus(bool bCondition) 105 | { 106 | bListInFocus = bCondition; 107 | } 108 | 109 | ListItem_t GetSelectedItem() 110 | { 111 | return vecListItems[iSelectedIndex]; 112 | } 113 | 114 | ListItem_t GetTopItem() 115 | { 116 | return vecListItems[iTopIndex]; 117 | } 118 | 119 | ListItem_t GetItemFromIndex(int index) 120 | { 121 | return vecListItems[index]; 122 | } 123 | 124 | int GetSpecialValueFromIndex(int index) 125 | { 126 | return vecListItems[index].iSpecialValue; 127 | } 128 | 129 | void Select(int index) 130 | { 131 | iSelectedIndex = index; 132 | } 133 | 134 | bool IsSelected(int index) 135 | { 136 | return (iSelectedIndex == index); 137 | } 138 | 139 | void MoveUp(int amount = 2) 140 | { 141 | iTopIndex -= amount; 142 | 143 | if(iTopIndex < 0) 144 | iTopIndex = 0; 145 | } 146 | 147 | void MoveDown(int amount = 2) 148 | { 149 | iTopIndex += amount; 150 | 151 | //just following rules of itemlists which are scrollable 152 | int iLastPossibleTopIndex = abs(GetNumberOfItems() - HowManyToDisplayPerPage()) - 1; 153 | 154 | if(iTopIndex > iLastPossibleTopIndex) 155 | iTopIndex = iLastPossibleTopIndex; 156 | } 157 | 158 | int HowManyToDisplayPerPage() 159 | { 160 | return iDisplayPerPage; 161 | } 162 | 163 | void DisplayPerPage(int amount) 164 | { 165 | iDisplayPerPage = amount; 166 | } 167 | 168 | private: 169 | std::vector vecListItems; 170 | 171 | int iTopIndex; 172 | int iSelectedIndex; 173 | int iDisplayPerPage; 174 | 175 | bool bListInFocus; 176 | bool bOnlyListOnPage; 177 | bool bScrollingNeeded; 178 | }; 179 | 180 | typedef struct DropDown_s 181 | { 182 | int x, y; 183 | int iCount; 184 | 185 | float *fValues; 186 | float *cvar; 187 | 188 | char **ppszNames; 189 | } DropDown_t; 190 | 191 | class cMenuSection 192 | { 193 | public: 194 | void Draw(int x, int y, int w, int h, const char *pszSectionName); 195 | 196 | void AddElement(int iType, int add_to_x, const char *pszElementName, const char *pszComment, float *cvar, float min = 0, float max = 1, float step = 1, float fToValue = -1, int increment = 1); 197 | 198 | void DrawAllDropDowns(); 199 | 200 | void PostSection() 201 | { 202 | DrawAllDropDowns(); 203 | } 204 | 205 | void ClearSection() 206 | { 207 | vecDropDowns.clear(); 208 | 209 | RestartSection(); 210 | } 211 | 212 | void RestartSection() 213 | { 214 | iSection = 0; 215 | } 216 | 217 | void PostElement(int increment = 1) 218 | { 219 | iSection += increment; 220 | } 221 | 222 | void SetISection(int newvalue = 1) 223 | { 224 | iSection = newvalue; 225 | } 226 | 227 | void SetColorDummy(float r, float g, float b, float a) 228 | { 229 | fColDummy[0] = r; 230 | fColDummy[1] = g; 231 | fColDummy[2] = b; 232 | fColDummy[3] = a; 233 | } 234 | 235 | void SetSlider(int &iCurrentSlider, bool bValue = false, bool bColor = false, int iColIdx = -1, bool bSetDummy = false, int r = 255, int g = 255, int b = 255, int a = 255, bool bCham = false, float fLen = 360.0f) 236 | { 237 | if(bSetDummy) 238 | SetColorDummy(r,g,b,a); 239 | 240 | iColorIndex = iColIdx; 241 | 242 | bColored = bColor; 243 | bShowValue = bValue; 244 | bChams = bCham; 245 | 246 | fLength = fLen; 247 | 248 | iCurrentSlider++; 249 | } 250 | 251 | void SetSectionPos(int x, int y) 252 | { 253 | s_x = x; 254 | s_y = y; 255 | } 256 | 257 | void SetValueNames(char **szArrayArray, float *fArray, int iCount) 258 | { 259 | ppszValueNames = szArrayArray; 260 | fValueList = fArray; 261 | iValueCount = iCount; 262 | } 263 | 264 | void ClearAllElementSpecifics() 265 | { 266 | SetValueNames(NULL,NULL,0); 267 | } 268 | 269 | //slider specifics 270 | //---------------------- 271 | float fColDummy[4]; 272 | //---------------------- 273 | 274 | private: 275 | void AddDropDownToDrawList(DropDown_t ddNew) 276 | { 277 | vecDropDowns.push_back(ddNew); 278 | } 279 | 280 | int iSection; 281 | int s_x, s_y; 282 | 283 | //dropdown specifics 284 | //---------------------- 285 | float *fValueList; 286 | char **ppszValueNames; 287 | int iValueCount; 288 | bool bActiveDropDown[50]; 289 | std::vector vecDropDowns; 290 | //---------------------- 291 | 292 | //slider specifics 293 | //---------------------- 294 | int iColorIndex; 295 | 296 | bool bColored; 297 | bool bShowValue; 298 | bool bChams; 299 | 300 | float fLength; 301 | //---------------------- 302 | }; 303 | 304 | class cMenu 305 | { 306 | public: 307 | cMenu(int x, int y, int w, int h); 308 | 309 | //this will differ in different games 310 | void InitMenuElements(); 311 | 312 | void DrawMenu(); 313 | 314 | void DrawHeaderComment(int e_x, int e_y, const char *pszComment, bool bSlider = false); 315 | 316 | void SetMenuPos(int x, int y) 317 | { 318 | m_x = x; 319 | m_y = y; 320 | } 321 | 322 | void GetMenuPos(int &out_x, int &out_y) 323 | { 324 | out_x = m_x; 325 | out_y = m_y; 326 | } 327 | 328 | void GetMenuSize(int &out_w, int &out_h) 329 | { 330 | out_w = m_w; 331 | out_h = m_h; 332 | } 333 | 334 | bool IsHandlingItem() 335 | { 336 | return (iMenuFlags & FL_DISABLEDRAG); 337 | } 338 | 339 | void AddMenuFlag(int iFlag) 340 | { 341 | iMenuFlags |= iFlag; 342 | } 343 | 344 | void RemoveMenuFlag(int iFlag) 345 | { 346 | iMenuFlags &= ~iFlag; 347 | } 348 | 349 | void HandlingItem() 350 | { 351 | AddMenuFlag(FL_DISABLEDRAG); 352 | } 353 | 354 | void NotHandlingItem() 355 | { 356 | RemoveMenuFlag(FL_DISABLEDRAG); 357 | } 358 | 359 | int GetConfigIndex(int iCfgIdx = 0) 360 | { 361 | return iConfigIndex[iCfgIdx]; 362 | } 363 | 364 | void SetConfigIndex(int index, int iCfgIdx = 0) 365 | { 366 | iConfigIndex[iCfgIdx] = index; 367 | } 368 | 369 | const char *GetCurrentConfigName(int iCfgIdx = 0) 370 | { 371 | return sCurrentConfigName[iConfigIndex[iCfgIdx]].data(); 372 | } 373 | 374 | std::string GetCurrentConfig(int iCfgIdx = 0) 375 | { 376 | return sCurrentConfig[iConfigIndex[iCfgIdx]]; 377 | } 378 | 379 | int GetTabIndex() 380 | { 381 | return iTabIndex; 382 | } 383 | 384 | void SetTabIndex(int index) 385 | { 386 | iTabIndex = index; 387 | } 388 | 389 | int GetSmallTabIndex(int i = 0) 390 | { 391 | return iSmallTab[i]; 392 | } 393 | 394 | private: 395 | void DrawTab(int index, int &setindex, int x, int y, const char *pszTitle); 396 | void DrawSmallTab(int index, int &setindex, int x, int y, const char *pszTitle); 397 | void DrawAConfig(int index, int cfgidx, int x, int y, std::string sString); 398 | 399 | int m_x, m_y, m_w, m_h; 400 | int iMenuFlags; 401 | int iTabIndex; 402 | int iConfigIndex[2]; 403 | int iSmallTab[5]; 404 | 405 | std::string sCurrentConfig[NUM_OF_CFGS]; 406 | std::string sCurrentConfigName[NUM_OF_CFGS]; 407 | }; 408 | 409 | extern cMenu g_Menu; 410 | extern cListItem ListItemArray[NUM_OF_TOTAL_LISTITEMS]; -------------------------------------------------------------------------------- /mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "DllMain.h" 2 | 3 | cMouse g_Mouse; 4 | 5 | //not mine 6 | 7 | //parameters: 8 | //bDrag : pass a new boolean for it as this only handles if drag object is being dragged (change MAX_DRAG_OBJECTS and pass the bDragged from gmouse) 9 | //bCheck : a check if any other drag objects are being dragged (to prevent dragging other objects while current one is being dragged, so pass in other bDrag booleans) 10 | //bDragCheck : basically pass mouse.leftclick(x,y,w,h) as the param(the place where you have to hold down mouse to drag) 11 | //x : dragobject's x axis location on screen which we wanna modify 12 | //y : dragobject's y axis location on screen which we wanna modify 13 | //xdif : pass an empty int (change MAX_DRAG_OBJECTS and pass the iDiffX from gmouse here) 14 | //ydif : pass an empty int (change MAX_DRAG_OBJECTS and pass the iDiffY from gmouse here) 15 | 16 | void cMouse::Drag(bool& bDrag, bool bCheck, bool bDragCheck,int& x, int& y, int& xdif, int& ydif) 17 | { 18 | if(bCheck) 19 | { 20 | if(bDragCheck || (mouse1pressed && bDrag)) 21 | { 22 | if(!bDrag) 23 | bDrag = true; 24 | 25 | if(xdif == -1 || ydif == -1) 26 | { 27 | xdif = mouse_x - x; 28 | ydif = mouse_y - y; 29 | } 30 | 31 | x += mouse_x - (xdif + x); 32 | y += mouse_y - (ydif + y); 33 | } 34 | else 35 | { 36 | if(bDrag) 37 | bDrag = false; 38 | 39 | xdif = -1; 40 | ydif = -1; 41 | } 42 | } 43 | } 44 | 45 | //not mine 46 | void cMouse::DrawMouse() 47 | { 48 | //kolonote: we gotta implement pat0's COLORCODE macros 49 | static int default_r = 3, default_g = 6, default_b = 26, default_a = 215; 50 | 51 | g_Draw.FillRGBA(mouse_x + 1, mouse_y, 1, 17, default_r, default_g, default_b, default_a); 52 | 53 | for(int i = 0; i < 11; i++) 54 | g_Draw.FillRGBA(mouse_x + 2 + i, mouse_y + 1 + i, 1, 1, default_r, default_g, default_b, default_a); 55 | g_Draw.FillRGBA(mouse_x + 7, mouse_y + 12, 6, 1, default_r, default_g, default_b, default_a); 56 | g_Draw.FillRGBA(mouse_x + 6, mouse_y + 12, 1, 1, default_r, default_g, default_b, default_a); 57 | g_Draw.FillRGBA(mouse_x + 5, mouse_y + 13, 1, 1, default_r, default_g, default_b, default_a); 58 | g_Draw.FillRGBA(mouse_x + 4, mouse_y + 14, 1, 1, default_r, default_g, default_b, default_a); 59 | g_Draw.FillRGBA(mouse_x + 3, mouse_y + 15, 1, 1, default_r, default_g, default_b, default_a); 60 | g_Draw.FillRGBA(mouse_x + 2, mouse_y + 16, 1, 1, default_r, default_g, default_b, default_a); 61 | 62 | static int mouse_r = 255, mouse_g = 255, mouse_b = 255, mouse_a = 255; 63 | 64 | for(int i = 0; i < 4; i++) 65 | g_Draw.FillRGBA(mouse_x + 2 + i, mouse_y + 2 + i, 1, 14 - (i * 2), mouse_r,mouse_g,mouse_b,mouse_a); 66 | g_Draw.FillRGBA(mouse_x + 6, mouse_y + 6, 1, 6, mouse_r,mouse_g,mouse_b,mouse_a); 67 | g_Draw.FillRGBA(mouse_x + 7, mouse_y + 7, 1, 5, mouse_r,mouse_g,mouse_b,mouse_a); 68 | g_Draw.FillRGBA(mouse_x + 8, mouse_y + 8, 1, 4, mouse_r,mouse_g,mouse_b,mouse_a); 69 | g_Draw.FillRGBA(mouse_x + 9, mouse_y + 9, 1, 3, mouse_r,mouse_g,mouse_b,mouse_a); 70 | g_Draw.FillRGBA(mouse_x + 10, mouse_y + 10, 1, 2, mouse_r,mouse_g,mouse_b,mouse_a); 71 | g_Draw.FillRGBA(mouse_x + 11, mouse_y + 11, 1, 1, mouse_r,mouse_g,mouse_b,mouse_a); 72 | } 73 | 74 | bool cMouse::LeftClick(int x,int y,int w,int h) 75 | { 76 | return (mouse1pressed && IsOver(x,y,w,h)); 77 | } 78 | 79 | bool cMouse::RightClick(int x,int y,int w,int h) 80 | { 81 | return (mouse2pressed && IsOver(x,y,w,h)); 82 | } 83 | 84 | bool cMouse::OneLeftClick(int x,int y,int w,int h) 85 | { 86 | return (mouse1released && IsOver(x,y,w,h)); 87 | } 88 | 89 | bool cMouse::OneRightClick(int x,int y,int w,int h) 90 | { 91 | return (mouse2released && IsOver(x,y,w,h)); 92 | } 93 | 94 | bool cMouse::IsOver(int x,int y,int w,int h) 95 | { 96 | return (mouse_x > x && w+x > mouse_x && mouse_y > y && h+y > mouse_y); 97 | } 98 | 99 | //kolonote: 100 | //now the credits to this go to someone that posted it on GD in 2004 i think i forgot his name 101 | void cMouse::Update(ValveSDK::ConVar *mousevar) 102 | { 103 | static ValveSDK::ConVar *pRawInput = g_Valve.pConVar->FindVar(/*m_rawinput*/XorStr<0x63,11,0x160FA730>("\x0E\x3B\x17\x07\x10\x01\x07\x1A\x1E\x18"+0x160FA730).s); 104 | 105 | //IMPORTANT FIX DONT REMOVE ME 106 | if(pRawInput->GetInt()) 107 | pRawInput->SetValue(0); 108 | 109 | int width = g_Valve.pClient->GetScreenWidth(); 110 | int height = g_Valve.pClient->GetScreenHeight(); 111 | 112 | int winX = width * 0.5; 113 | int winY = height * 0.5; 114 | 115 | //3 winapi calls is all we need 116 | tagPOINT tp; 117 | GetCursorPos(&tp); 118 | 119 | LPPOINT pPoint = &tp; 120 | ScreenToClient(GetForegroundWindow(),pPoint); 121 | 122 | tp.x = pPoint->x; 123 | tp.y = pPoint->y; 124 | 125 | if(!g_Valve.pEngine->IsInGame()) 126 | { 127 | mouse_x = tp.x; 128 | mouse_y = tp.y; 129 | } 130 | else 131 | { 132 | if((tp.x - winX) != 0 || (tp.y - winY) != 0) 133 | { 134 | mouse_x += (tp.x - winX) * 2; 135 | mouse_y += (tp.y - winY) * 2; 136 | } 137 | } 138 | 139 | //just make sure it knows that it has to revert back mouse... sadly using mouseenable isnt the best way but ok 140 | if(mousevar->GetInt()) 141 | { 142 | mousevar->SetValue(0); 143 | 144 | mouse_x = winX; 145 | mouse_y = winY; 146 | 147 | bReturn = true; 148 | } 149 | 150 | //the mouse coordinates depending on the screen size 151 | if(mouse_x > width) 152 | mouse_x = width; 153 | 154 | if(mouse_x < 0) 155 | mouse_x = 0; 156 | 157 | if(mouse_y > height) 158 | mouse_y = height; 159 | 160 | if(mouse_y < 0) 161 | mouse_y = 0; 162 | 163 | //HANDLING: 164 | 165 | //handle mouse1 166 | if(GetAsyncKeyState(VK_LBUTTON)) 167 | mouse1pressed = true; 168 | else if(!GetAsyncKeyState(VK_LBUTTON)) 169 | { 170 | if(mouse1pressed) 171 | mouse1released = true; 172 | else 173 | mouse1released = false; 174 | 175 | mouse1pressed = false; 176 | } 177 | 178 | //handle mouse2 179 | if(GetAsyncKeyState(VK_RBUTTON)) 180 | mouse2pressed = true; 181 | else if(!GetAsyncKeyState(VK_RBUTTON)) 182 | { 183 | if(mouse2pressed) 184 | mouse2released = true; 185 | else 186 | mouse2released = false; 187 | 188 | mouse2pressed = false; 189 | } 190 | } 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | -------------------------------------------------------------------------------- /mouse.h: -------------------------------------------------------------------------------- 1 | #define MAX_DRAG_OBJECTS 3 2 | 3 | class cMouse 4 | { 5 | public: 6 | 7 | //called after menu drawn 8 | void DrawMouse(); 9 | 10 | //called when menu on/whatever 11 | void Update(ValveSDK::ConVar *mousevar); 12 | 13 | bool LeftClick(int x,int y,int w,int h); 14 | bool OneLeftClick(int x,int y,int w,int h); 15 | bool RightClick(int x,int y,int w,int h); 16 | bool OneRightClick(int x,int y,int w,int h); 17 | bool IsOver(int x,int y,int w,int h); 18 | 19 | void Drag(bool& bDrag, bool bCheck, bool bDragCheck,int& x, int& y, int& xdif, int& ydif); 20 | 21 | void GetMousePosition(int &posx, int &posy) 22 | { 23 | posx = mouse_x; 24 | posy = mouse_y; 25 | } 26 | 27 | bool HasMouseOneJustBeenReleased() 28 | { 29 | return mouse1released; 30 | } 31 | 32 | bool IsMouseTwoBeingHeld() 33 | { 34 | return mouse2pressed; 35 | } 36 | 37 | bool bReturn; 38 | 39 | bool bDragged[MAX_DRAG_OBJECTS]; 40 | int iDiffX[MAX_DRAG_OBJECTS]; 41 | int iDiffY[MAX_DRAG_OBJECTS]; 42 | 43 | private: 44 | int mouse_x, mouse_y; 45 | 46 | bool mouse1pressed; 47 | bool mouse1released; 48 | bool mouse2pressed; 49 | bool mouse2released; 50 | }; 51 | 52 | extern cMouse g_Mouse; 53 | -------------------------------------------------------------------------------- /netvars.h: -------------------------------------------------------------------------------- 1 | //Credits: Kiro 2 | 3 | typedef struct 4 | { 5 | char szTableName[256]; 6 | char szPropName[256]; 7 | RecvVarProxyFn SavedProxy; 8 | } Oldproxy_t; 9 | 10 | class CNetworkedVariableManager 11 | { 12 | public: 13 | 14 | ~CNetworkedVariableManager(void); 15 | 16 | // stores all tables, and all props inside those 17 | void Init(); 18 | 19 | // calls GetProp wrapper to get the absolute offset of the prop 20 | int GetOffset(const char *tableName, const char *propName); 21 | 22 | // calls GetProp wrapper to get prop and sets the proxy of the prop 23 | bool HookProp(const char *tableName, const char *propName, RecvVarProxyFn function); 24 | 25 | private: 26 | 27 | // wrapper so we can use recursion without too much performance loss 28 | int GetProp(const char *tableName, const char *propName, RecvProp **prop = 0); 29 | 30 | // uses recursion to return a the relative offset to the given prop and sets the prop param 31 | int GetProp(RecvTable *recvTable, const char *propName, RecvProp **prop = 0); 32 | 33 | RecvTable *GetTable(const char *tableName); 34 | 35 | std::vector m_tables; 36 | 37 | std::vector m_savedproxy; 38 | }; 39 | 40 | extern void YawEyeAngleProxy(const CRecvProxyData *pData, void *pStruct, void *pOut); 41 | extern void PitchEyeAngleProxy(const CRecvProxyData *pData, void *pStruct, void *pOut); 42 | 43 | extern CNetworkedVariableManager g_NetworkedVariableManager; -------------------------------------------------------------------------------- /sdk.h: -------------------------------------------------------------------------------- 1 | //Credits: Casualhacker 2 | inline void**& getvtable(void* inst, size_t offset = 0) 3 | { 4 | return *reinterpret_cast((size_t)inst + offset); 5 | } 6 | inline const void** getvtable(const void* inst, size_t offset = 0) 7 | { 8 | return *reinterpret_cast((size_t)inst + offset); 9 | } 10 | template< typename Fn > 11 | inline Fn getvfunc(const void* inst, size_t index, size_t offset = 0) 12 | { 13 | return reinterpret_cast(getvtable(inst, offset)[index]); 14 | } 15 | 16 | typedef float matrix3x4[3][4]; 17 | typedef float matrix4x4[4][4]; 18 | typedef void* (__cdecl* CreateInterface_t)(const char*, int*); 19 | typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode); 20 | 21 | inline void VectorSubtract(const Vector& a, const Vector& b, Vector& c) 22 | { 23 | CHECK_VALID(a); 24 | CHECK_VALID(b); 25 | c.x = a.x - b.x; 26 | c.y = a.y - b.y; 27 | c.z = a.z - b.z; 28 | } 29 | 30 | //SRC SDK VECTORADD 31 | inline void VectorAdd(const Vector& a, const Vector& b, Vector& c) 32 | { 33 | CHECK_VALID(a); 34 | CHECK_VALID(b); 35 | c.x = a.x + b.x; 36 | c.y = a.y + b.y; 37 | c.z = a.z + b.z; 38 | } 39 | 40 | //USERCMD OFFSETS 41 | #define USERCMDOFFSET 0xC4 42 | #define VERIFIEDCMDOFFSET 0xC8 43 | #define MULTIPLAYER_BACKUP 90 44 | #define CURRENTCOMMANDOFFSET 0x100C 45 | #define CURRENTPLAYERCOMMANDOFFSET 0x1640 46 | #define PREIDCTIONSEEDOFFSET 0x1A 47 | #define PREDICTIONPLAYEROFFSET 0x2D 48 | #define GLOBALSOFFSET 0x34 49 | #define INPUTOFFSET 0x20 50 | #define GETSPREADOFFSET 0x5E0 // updated 51 | #define GETCONEOFFSET 0x5E4 // updated 52 | #define UPDATEACCURACYPENALTYOFFSET 0x5E8 // updated 53 | #define WEAPONIDOFFSET 0x5A0 54 | #define APPSYSTEMFACTORYOFFSET 0x2A 55 | #define CLIENTFACTORYOFFSET 0x67 56 | 57 | //LIFESTATE 58 | #define LIFE_ALIVE 0 59 | #define LIFE_DYING 1 60 | #define LIFE_DEAD 2 61 | #define LIFE_RESPAWNABLE 3 62 | #define LIFE_DISCARDBODY 4 63 | 64 | //Player flags 65 | #define FL_ONGROUND (1<<0) // At rest / on the ground 66 | #define FL_DUCKING (1<<1) // Player flag -- Player is fully crouched 67 | #define FL_WATERJUMP (1<<3) // player jumping out of water 68 | #define FL_ONTRAIN (1<<4) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. 69 | #define FL_INRAIN (1<<5) // Indicates the entity is standing in rain 70 | #define FL_FROZEN (1<<6) // Player is frozen for 3rd person camera 71 | #define FL_ATCONTROLS (1<<7) // Player can't move, but keeps key inputs for controlling another entity 72 | #define FL_CLIENT (1<<8) // Is a player 73 | #define FL_FAKECLIENT (1<<9) // Fake client, simulated server side; don't send network messages to them 74 | #define FL_INWATER (1<<10) // In water 75 | 76 | 77 | //USERCMD BUTTONS 78 | #define IN_ATTACK (1 << 0) 79 | #define IN_JUMP (1 << 1) 80 | #define IN_DUCK (1 << 2) 81 | #define IN_FORWARD (1 << 3) 82 | #define IN_BACK (1 << 4) 83 | #define IN_USE (1 << 5) 84 | #define IN_CANCEL (1 << 6) 85 | #define IN_LEFT (1 << 7) 86 | #define IN_RIGHT (1 << 8) 87 | #define IN_MOVELEFT (1 << 9) 88 | #define IN_MOVERIGHT (1 << 10) 89 | #define IN_ATTACK2 (1 << 11) 90 | #define IN_RUN (1 << 12) 91 | #define IN_RELOAD (1 << 13) 92 | #define IN_ALT1 (1 << 14) 93 | #define IN_ALT2 (1 << 15) 94 | #define IN_SCORE (1 << 16) // Used by client.dll for when scoreboard is held down 95 | #define IN_SPEED (1 << 17) // Player is holding the speed key 96 | #define IN_WALK (1 << 18) // Player holding walk key 97 | #define IN_ZOOM (1 << 19) // Zoom key for HUD zoom 98 | #define IN_WEAPON1 (1 << 20) // weapon defines these bits 99 | #define IN_WEAPON2 (1 << 21) // weapon defines these bits 100 | #define IN_BULLRUSH (1 << 22) 101 | #define IN_GRENADE1 (1 << 23) // grenade 1 102 | #define IN_GRENADE2 (1 << 24) // grenade 2 103 | 104 | enum ClientFrameStage_t 105 | { 106 | FRAME_UNDEFINED = -1, // (haven't run any frames yet) 107 | FRAME_START, 108 | 109 | // A network packet is being recieved 110 | FRAME_NET_UPDATE_START, 111 | // Data has been received and we're going to start calling PostDataUpdate 112 | FRAME_NET_UPDATE_POSTDATAUPDATE_START, 113 | // Data has been received and we've called PostDataUpdate on all data recipients 114 | FRAME_NET_UPDATE_POSTDATAUPDATE_END, 115 | // We've received all packets, we can now do interpolation, prediction, etc.. 116 | FRAME_NET_UPDATE_END, 117 | 118 | // We're about to start rendering the scene 119 | FRAME_RENDER_START, 120 | // We've finished rendering the scene. 121 | FRAME_RENDER_END 122 | }; 123 | 124 | struct mstudiobbox_t 125 | { 126 | int bone; 127 | int group; 128 | Vector bbmin; 129 | Vector bbmax; 130 | int szhitboxnameindex; 131 | int unused[8]; 132 | 133 | const char* pszHitboxName() const 134 | { 135 | if (szhitboxnameindex == 0) 136 | return ""; 137 | 138 | return ((const char*)this) + szhitboxnameindex; 139 | } 140 | }; 141 | 142 | struct mstudiohitboxset_t 143 | { 144 | int sznameindex; 145 | inline char* const pszName(void) const { return ((char*)this) + sznameindex; } 146 | int numhitboxes; 147 | int hitboxindex; 148 | inline mstudiobbox_t* pHitbox(int i) const { return (mstudiobbox_t*)(((BYTE*)this) + hitboxindex) + i; }; 149 | }; 150 | 151 | struct studiohdr_t 152 | { 153 | unsigned char pad[0xAC]; 154 | int numhitboxsets; 155 | int hitboxsetindex; 156 | 157 | mstudiohitboxset_t* pHitboxSet(int i) const 158 | { 159 | return (mstudiohitboxset_t*)(((BYTE*)this) + hitboxsetindex) + i; 160 | }; 161 | 162 | inline mstudiobbox_t* pHitbox(int i, int set) const 163 | { 164 | mstudiohitboxset_t const* s = pHitboxSet(set); 165 | 166 | if (!s) 167 | return NULL; 168 | 169 | return s->pHitbox(i); 170 | }; 171 | 172 | inline int iHitboxCount(int set) const 173 | { 174 | mstudiohitboxset_t const* s = pHitboxSet(set); 175 | 176 | if (!s) 177 | return 0; 178 | 179 | return s->numhitboxes; 180 | }; 181 | }; 182 | 183 | 184 | class CBaseEntity; 185 | class model_t; 186 | 187 | typedef struct 188 | { 189 | byte r, g, b, a; 190 | } color32; 191 | 192 | #include "dt_recv2.h" 193 | #include "netvars.h" 194 | #include "CBaseCombatWeapon.h" 195 | #include "CBaseEntity.h" 196 | #include "ClientClass.h" 197 | #include "HLClient.h" 198 | #include "CEngineClient.h" 199 | #include "ISurface.h" 200 | #include "IPanel.h" 201 | #include "CEntityList.h" 202 | #include "CInput.h" 203 | #include "CPrediction.h" 204 | #include "CGameMovement.h" 205 | #include "CDebugOverlay.h" 206 | #include "CModelInfo.h" 207 | #include "CTrace.h" 208 | #include "ConVar.h" 209 | #include "CGlobalVars.h" 210 | #include "IMoveHelper.h" 211 | #include "IGameEvent.h" 212 | #include "IGameEventListener2.h" 213 | #include "IGameEventManager.h" 214 | #include "MD5.h" 215 | 216 | -------------------------------------------------------------------------------- /valve_off.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/valve_off.h -------------------------------------------------------------------------------- /valve_on.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaxzy/Interwebz-css/cf325f9373e88afe4f7a4e8466ace1d032fe67da/valve_on.h -------------------------------------------------------------------------------- /wchartypes.h: -------------------------------------------------------------------------------- 1 | //========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============// 2 | // 3 | // Purpose: All of our code is completely Unicode. Instead of char, you should 4 | // use wchar, uint8, or char8, as explained below. 5 | // 6 | // $NoKeywords: $ 7 | //=============================================================================// 8 | 9 | 10 | #ifndef WCHARTYPES_H 11 | #define WCHARTYPES_H 12 | #ifdef _WIN32 13 | #pragma once 14 | #endif 15 | 16 | #ifdef _INC_TCHAR 17 | #error ("Must include tier0 type headers before tchar.h") 18 | #endif 19 | 20 | // Temporarily turn off Valve defines 21 | #include "valve_off.h" 22 | 23 | #if !defined(_WCHAR_T_DEFINED) && !defined( __WCHAR_TYPE__ ) && !defined(GNUC) 24 | typedef unsigned short wchar_t; 25 | #define _WCHAR_T_DEFINED 26 | #endif 27 | 28 | // char8 29 | // char8 is equivalent to char, and should be used when you really need a char 30 | // (for example, when calling an external function that's declared to take 31 | // chars). 32 | typedef char char8; 33 | 34 | // uint8 35 | // uint8 is equivalent to byte (but is preferred over byte for clarity). Use this 36 | // whenever you mean a byte (for example, one byte of a network packet). 37 | typedef unsigned char uint8; 38 | typedef unsigned char BYTE; 39 | typedef unsigned char byte; 40 | 41 | // wchar 42 | // wchar is a single character of text (currently 16 bits, as all of our text is 43 | // Unicode). Use this whenever you mean a piece of text (for example, in a string). 44 | typedef wchar_t wchar; 45 | //typedef char wchar; 46 | 47 | // __WFILE__ 48 | // This is a Unicode version of __FILE__ 49 | #define WIDEN2(x) L ## x 50 | #define WIDEN(x) WIDEN2(x) 51 | #define __WFILE__ WIDEN(__FILE__) 52 | 53 | #ifdef STEAM 54 | #ifndef _UNICODE 55 | #define FORCED_UNICODE 56 | #endif 57 | #define _UNICODE 58 | #endif 59 | 60 | #if defined( POSIX ) 61 | #define _tcsstr strstr 62 | #define _tcsicmp stricmp 63 | #define _tcscmp strcmp 64 | #define _tcscpy strcpy 65 | #define _tcsncpy strncpy 66 | #define _tcsrchr strrchr 67 | #define _tcslen strlen 68 | #define _tfopen fopen 69 | #define _stprintf sprintf 70 | #define _ftprintf fprintf 71 | #define _vsntprintf _vsnprintf 72 | #define _tprintf printf 73 | #define _sntprintf _snprintf 74 | #define _T(s) s 75 | #else 76 | #include 77 | #endif 78 | 79 | #if defined(_UNICODE) 80 | typedef wchar tchar; 81 | #define tstring wstring 82 | #define __TFILE__ __WFILE__ 83 | #define TCHAR_IS_WCHAR 84 | #else 85 | typedef char tchar; 86 | #define tstring string 87 | #define __TFILE__ __FILE__ 88 | #define TCHAR_IS_CHAR 89 | #endif 90 | 91 | #ifdef FORCED_UNICODE 92 | #undef _UNICODE 93 | #endif 94 | 95 | // Turn valve defines back on 96 | #include "valve_on.h" 97 | 98 | 99 | #endif // WCHARTYPES 100 | 101 | 102 | -------------------------------------------------------------------------------- /xor.h: -------------------------------------------------------------------------------- 1 | template 2 | class XorStr 3 | { 4 | private: 5 | XorStr(); 6 | public: 7 | char s[BUFLEN]; 8 | 9 | XorStr(const char* xs); 10 | ~XorStr() 11 | { 12 | for(int i=0; i < BUFLEN; i++) s[i] = 0; 13 | } 14 | }; 15 | 16 | template 17 | XorStr::XorStr(const char* xs) 18 | { 19 | int xvalue = XORSTART; 20 | int i = 0; 21 | for(; i < (BUFLEN - 1); i++) 22 | { 23 | s[i] = xs[i - XREFKILLER] ^ xvalue; 24 | xvalue += 1; 25 | xvalue %= 256; 26 | } 27 | s[BUFLEN-1] = (2 * 2 - 3) - 1; 28 | } --------------------------------------------------------------------------------