-
Автор темы
- #1
Offsets.cpp
Удалить
Вставить
Entities.h
Удалить
Вставить
Удалить
Вставить
В class CBaseCombatWeapon
Удалить
Вставить
Autowall.cpp
Удалить
Вставить
Удалить
Вставить
Ragebot.cpp
в void CRageBot::DoAntiAim(CUserCmd *pCmd, bool &bSendPacket)
Удалить
Вставить
Удалить
Код:
Functions::KeyValues_LoadFromBuffer = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\xE8\x00\x00\x00\x00\x8A\xD8\xFF\x15\x00\x00\x00\x00\x84\xDB", "x????xxxx????xx");
Код:
Functions::KeyValues_LoadFromBuffer = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\xE8\x00\x00\x00\x00\x80\x7D\xF8\x00\x00\x00\x85\xDB", "x????xxxx??xx");
Удалить
Код:
class CSWeaponInfo;
Код:
class CCSWeaponData;
Код:
class CSWeaponInfo
{
public:
char _0x0000[2048];
__int32 m_IsFullAuto; //0x0800
char _0x0804[52];
__int32 weapon_type; //0x0838
__int32 weapon_team; //0x083C
__int32 weapon_id; //0x0840
char _0x0844[4];
float heat_ps; //0x0848
__int32 price; //0x084C
float m_flArmorRatio; //0x0850
float player_speed; //0x0854
float player_speed_alt; //0x0858
__int32 crosshair_min_distance; //0x085C
__int32 crosshair_delta; //0x0860
float m_flPenetration; //0x0864
__int32 m_iDamage; //0x0868
float m_flRange; //0x086C
float m_flRangeModifier; //0x0870
__int32 bullets; //0x0874
float cycle_time; //0x0878
float cycle_time_alt; //0x087C
char _0x0880[416];
float spread; //0x0A20
float spread_alt; //0x0A24
};
Код:
class CCSWeaponData
{
public:
virtual ~CCSWeaponData() {};
/*Parse(KeyValues *, char const*)
RefreshDynamicParameters(void)
GetPrimaryClipSize(C_EconItemView const*, int, float)const
GetSecondaryClipSize(C_EconItemView const*, int, float)const
GetDefaultPrimaryClipSize(C_EconItemView const*, int, float)const
GetDefaultSecondaryClipSize(C_EconItemView const*, int, float)const
GetPrimaryReserveAmmoMax(C_EconItemView const*, int, float)const
GetSecondaryReserveAmmoMax(C_EconItemView const*, int, float)const*/
char* consoleName; // 0x0004
char pad_0008[12]; // 0x0008
int iMaxClip1; // 0x0014
int iMaxClip2; // 0x0018
int iDefaultClip1; // 0x001C
int iDefaultClip2; // 0x0020
char pad_0024[8]; // 0x0024
char* szWorldModel; // 0x002C
char* szViewModel; // 0x0030
char* szDroppedModel; // 0x0034
char pad_0038[4]; // 0x0038
char* N0000023E; // 0x003C
char pad_0040[56]; // 0x0040
char* szEmptySound; // 0x0078
char pad_007C[4]; // 0x007C
char* szBulletType; // 0x0080
char pad_0084[4]; // 0x0084
char* szHudName; // 0x0088
char* szWeaponName; // 0x008C
char pad_0090[56]; // 0x0090
int WeaponType; // 0x00C8
int iWeaponPrice; // 0x00CC
int iKillAward; // 0x00D0
char* szAnimationPrefix; // 0x00D4
float flCycleTime; // 0x00D8
float flCycleTimeAlt; // 0x00DC
float flTimeToIdle; // 0x00E0
float flIdleInterval; // 0x00E4
bool bFullAuto; // 0x00E8
char pad_0x00E5[3]; // 0x00E9
int iDamage; // 0x00EC
float flArmorRatio; // 0x00F0
int iBullets; // 0x00F4
float flPenetration; // 0x00F8
float flFlinchVelocityModifierLarge; // 0x00FC
float flFlinchVelocityModifierSmall; // 0x0100
float flRange; // 0x0104
float flRangeModifier; // 0x0108
float flThrowVelocity; // 0x010C
char pad_0x010C[12]; // 0x0110
bool bHasSilencer; // 0x011C
char pad_0x0119[3]; // 0x011D
char* pSilencerModel; // 0x0120
int iCrosshairMinDistance; // 0x0124
int iCrosshairDeltaDistance;// 0x0128 - iTeam?
float flMaxPlayerSpeed; // 0x012C
float flMaxPlayerSpeedAlt; // 0x0130
float flSpread; // 0x0134
float flSpreadAlt; // 0x0138
float flInaccuracyCrouch; // 0x013C
float flInaccuracyCrouchAlt; // 0x0140
float flInaccuracyStand; // 0x0144
float flInaccuracyStandAlt; // 0x0148
float flInaccuracyJumpInitial;// 0x014C
float flInaccuracyJump; // 0x0150
float flInaccuracyJumpAlt; // 0x0154
float flInaccuracyLand; // 0x0158
float flInaccuracyLandAlt; // 0x015C
float flInaccuracyLadder; // 0x0160
float flInaccuracyLadderAlt; // 0x0164
float flInaccuracyFire; // 0x0168
float flInaccuracyFireAlt; // 0x016C
float flInaccuracyMove; // 0x0170
float flInaccuracyMoveAlt; // 0x0174
float flInaccuracyReload; // 0x0178
int iRecoilSeed; // 0x017C
float flRecoilAngle; // 0x0180
float flRecoilAngleAlt; // 0x0184
float flRecoilAngleVariance; // 0x0188
float flRecoilAngleVarianceAlt; // 0x018C
float flRecoilMagnitude; // 0x0190
float flRecoilMagnitudeAlt; // 0x0194
float flRecoilMagnitudeVariance; // 0x0198
float flRecoilMagnitudeVarianceAlt; // 0x019C
float flRecoveryTimeCrouch; // 0x01A0
float flRecoveryTimeStand; // 0x01A4
float flRecoveryTimeCrouchFinal; // 0x01A8
float flRecoveryTimeStandFinal; // 0x01AC
int iRecoveryTransitionStartBullet;// 0x01B0
int iRecoveryTransitionEndBullet; // 0x01B4
bool bUnzoomAfterShot; // 0x01B8
bool bHideViewModelZoomed; // 0x01B9
char pad_0x01B5[2]; // 0x01BA
char iZoomLevels[3]; // 0x01BC
int iZoomFOV[2]; // 0x01C0
float fZoomTime[3]; // 0x01C4
char* szWeaponClass; // 0x01D4
float flAddonScale; // 0x01D8
char pad_0x01DC[4]; // 0x01DC
char* szEjectBrassEffect; // 0x01E0
char* szTracerEffect; // 0x01E4
int iTracerFrequency; // 0x01E8
int iTracerFrequencyAlt; // 0x01EC
char* szMuzzleFlashEffect_1stPerson; // 0x01F0
char pad_0x01F4[4]; // 0x01F4
char* szMuzzleFlashEffect_3rdPerson; // 0x01F8
char pad_0x01FC[4]; // 0x01FC
char* szMuzzleSmokeEffect; // 0x0200
float flHeatPerShot; // 0x0204
char* szZoomInSound; // 0x0208
char* szZoomOutSound; // 0x020C
float flInaccuracyPitchShift; // 0x0210
float flInaccuracySoundThreshold; // 0x0214
float flBotAudibleRange; // 0x0218
char pad_0x0218[8]; // 0x0220
char* pWrongTeamMsg; // 0x0224
bool bHasBurstMode; // 0x0228
char pad_0x0225[3]; // 0x0229
bool bIsRevolver; // 0x022C
bool bCannotShootUnderwater; // 0x0230
};
Удалить
Код:
float GetInaccuracy()
{
typedef float(__thiscall* oInaccuracy)(PVOID);
return call_vfunc< oInaccuracy >(this, 484)(this);
}
float GetInnacc()
{
typedef float(__thiscall *OrigFn)(void *);
return call_vfunc<OrigFn>(this, 484)(this);
}
void UpdateAccPenalty()
{
typedef void(__thiscall *OrigFn)(void *);
return call_vfunc<OrigFn>(this, 485)(this);
}
CSWeaponInfo* GetCSWpnData()
{
static DWORD GetCSWpnDataAddr = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\x55\x8B\xEC\x81\xEC\x00\x00\x00\x00\xB8\x00\x00\x00\x00\x57", "xxxxx????x????x");
if (GetCSWpnDataAddr)
{
CSWeaponInfo* retData;
__asm
{
mov ecx, this
call GetCSWpnDataAddr
mov retData, eax
}
return retData;
}
else
{
return nullptr;
}
}
Код:
float GetSpread() { return call_vfunc<float(__thiscall*)(void*)>(this, 439)(this); }
CCSWeaponData* GetWeaponData() { return call_vfunc<CCSWeaponData*(__thiscall*)(void*)>(this, 446)(this); }
float GetInaccuracy() { return call_vfunc<float(__thiscall*)(void*)>(this, 469)(this); }
void UpdateAccuracyPenalty() { call_vfunc<void(__thiscall*)(void*)>(this, 470)(this); }
Удалить
Код:
bool HandleBulletPenetration(CSWeaponInfo *wpn_data, FireBulletData &data);
Код:
bool HandleBulletPenetration(CCSWeaponData *wpn_data, FireBulletData &data);
Код:
bool SimulateFireBullet(IClientEntity *local, CBaseCombatWeapon *weapon, FireBulletData &data)
{
data.penetrate_count = 4; // Max Amount Of Penitration
data.trace_length = 0.0f; // wow what a meme
auto *wpn_data = weapon->GetCSWpnData(); // Get Weapon Info
data.current_damage = (float)wpn_data->m_iDamage;// Set Damage Memes
while ((data.penetrate_count > 0) && (data.current_damage >= 1.0f))
{
data.trace_length_remaining = wpn_data->m_flRange - data.trace_length;
Vector End_Point = data.src + data.direction * data.trace_length_remaining;
UTIL_TraceLine(data.src, End_Point, 0x4600400B, local, 0, &data.enter_trace);
UTIL_ClipTraceToPlayers(data.src, End_Point * 40.f, 0x4600400B, &data.filter, &data.enter_trace);
if (data.enter_trace.fraction == 1.0f) break;
if ((data.enter_trace.hitgroup <= 7) && (data.enter_trace.hitgroup > 0) && (local->GetTeamNum() != data.enter_trace.m_pEnt->GetTeamNum()))
{
data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
data.current_damage *= pow(wpn_data->m_flRangeModifier, data.trace_length * 0.002);
ScaleDamage(data.enter_trace.hitgroup, data.enter_trace.m_pEnt, wpn_data->m_flArmorRatio, data.current_damage);
return true;
}
if (!HandleBulletPenetration(wpn_data, data)) break;
}
return false;
}
bool HandleBulletPenetration(CSWeaponInfo *wpn_data, FireBulletData &data)
{
surfacedata_t *enter_surface_data = Interfaces::PhysProps->GetSurfaceData(data.enter_trace.surface.surfaceProps);
int enter_material = enter_surface_data->game.material;
float enter_surf_penetration_mod = enter_surface_data->game.flPenetrationModifier;
data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
data.current_damage *= pow(wpn_data->m_flRangeModifier, (data.trace_length * 0.002));
if ((data.trace_length > 3000.f) || (enter_surf_penetration_mod < 0.1f))data.penetrate_count = 0;
if (data.penetrate_count <= 0)return false;
Vector dummy;
trace_t trace_exit;
if (!TraceToExit(dummy, data.enter_trace, data.enter_trace.endpos, data.direction, &trace_exit)) return false;
surfacedata_t *exit_surface_data = Interfaces::PhysProps->GetSurfaceData(trace_exit.surface.surfaceProps);
int exit_material = exit_surface_data->game.material;
float exit_surf_penetration_mod = exit_surface_data->game.flPenetrationModifier;
float final_damage_modifier = 0.16f;
float combined_penetration_modifier = 0.0f;
if (((data.enter_trace.contents & CONTENTS_GRATE) != 0) || (enter_material == 89) || (enter_material == 71)) { combined_penetration_modifier = 3.0f; final_damage_modifier = 0.05f; }
else { combined_penetration_modifier = (enter_surf_penetration_mod + exit_surf_penetration_mod) * 0.5f; }
if (enter_material == exit_material)
{
if (exit_material == 87 || exit_material == 85)combined_penetration_modifier = 3.0f;
else if (exit_material == 76)combined_penetration_modifier = 2.0f;
}
float v34 = fmaxf(0.f, 1.0f / combined_penetration_modifier);
float v35 = (data.current_damage * final_damage_modifier) + v34 * 3.0f * fmaxf(0.0f, (3.0f / wpn_data->m_flPenetration) * 1.25f);
float thickness = VectorLength(trace_exit.endpos - data.enter_trace.endpos);
thickness *= thickness;
thickness *= v34;
thickness /= 24.0f;
float lost_damage = fmaxf(0.0f, v35 + thickness);
if (lost_damage > data.current_damage)return false;
if (lost_damage >= 0.0f)data.current_damage -= lost_damage;
if (data.current_damage < 1.0f) return false;
data.src = trace_exit.endpos;
data.penetrate_count--;
return true;
}
Код:
bool SimulateFireBullet(IClientEntity *local, CBaseCombatWeapon *weapon, FireBulletData &data)
{
data.penetrate_count = 4; // Max Amount Of Penitration
data.trace_length = 0.0f; // wow what a meme
auto *wpn_data = weapon->GetWeaponData(); // Get Weapon Info
data.current_damage = (float)wpn_data->iDamage;// Set Damage Memes
while ((data.penetrate_count > 0) && (data.current_damage >= 1.0f))
{
data.trace_length_remaining = wpn_data->flRange - data.trace_length;
Vector End_Point = data.src + data.direction * data.trace_length_remaining;
UTIL_TraceLine(data.src, End_Point, 0x4600400B, local, 0, &data.enter_trace);
UTIL_ClipTraceToPlayers(data.src, End_Point * 40.f, 0x4600400B, &data.filter, &data.enter_trace);
if (data.enter_trace.fraction == 1.0f) break;
if ((data.enter_trace.hitgroup <= 7) && (data.enter_trace.hitgroup > 0) && (local->GetTeamNum() != data.enter_trace.m_pEnt->GetTeamNum()))
{
data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
data.current_damage *= pow(wpn_data->flRangeModifier, data.trace_length * 0.002);
ScaleDamage(data.enter_trace.hitgroup, data.enter_trace.m_pEnt, wpn_data->flArmorRatio, data.current_damage);
return true;
}
if (!HandleBulletPenetration(wpn_data, data)) break;
}
return false;
}
bool HandleBulletPenetration(CCSWeaponData *wpn_data, FireBulletData &data)
{
surfacedata_t *enter_surface_data = Interfaces::PhysProps->GetSurfaceData(data.enter_trace.surface.surfaceProps);
int enter_material = enter_surface_data->game.material;
float enter_surf_penetration_mod = enter_surface_data->game.flPenetrationModifier;
data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
data.current_damage *= pow(wpn_data->flRangeModifier, (data.trace_length * 0.002));
if ((data.trace_length > 3000.f) || (enter_surf_penetration_mod < 0.1f))data.penetrate_count = 0;
if (data.penetrate_count <= 0)return false;
Vector dummy;
trace_t trace_exit;
if (!TraceToExit(dummy, data.enter_trace, data.enter_trace.endpos, data.direction, &trace_exit)) return false;
surfacedata_t *exit_surface_data = Interfaces::PhysProps->GetSurfaceData(trace_exit.surface.surfaceProps);
int exit_material = exit_surface_data->game.material;
float exit_surf_penetration_mod = exit_surface_data->game.flPenetrationModifier;
float final_damage_modifier = 0.16f;
float combined_penetration_modifier = 0.0f;
if (((data.enter_trace.contents & CONTENTS_GRATE) != 0) || (enter_material == 89) || (enter_material == 71)) { combined_penetration_modifier = 3.0f; final_damage_modifier = 0.05f; }
else { combined_penetration_modifier = (enter_surf_penetration_mod + exit_surf_penetration_mod) * 0.5f; }
if (enter_material == exit_material)
{
if (exit_material == 87 || exit_material == 85)combined_penetration_modifier = 3.0f;
else if (exit_material == 76)combined_penetration_modifier = 2.0f;
}
float v34 = fmaxf(0.f, 1.0f / combined_penetration_modifier);
float v35 = (data.current_damage * final_damage_modifier) + v34 * 3.0f * fmaxf(0.0f, (3.0f / wpn_data->flPenetration) * 1.25f);
float thickness = VectorLength(trace_exit.endpos - data.enter_trace.endpos);
thickness *= thickness;
thickness *= v34;
thickness /= 24.0f;
float lost_damage = fmaxf(0.0f, v35 + thickness);
if (lost_damage > data.current_damage)return false;
if (lost_damage >= 0.0f)data.current_damage -= lost_damage;
if (data.current_damage < 1.0f) return false;
data.src = trace_exit.endpos;
data.penetrate_count--;
return true;
}
в void CRageBot::DoAntiAim(CUserCmd *pCmd, bool &bSendPacket)
Удалить
Код:
CSWeaponInfo* pWeaponInfo = pWeapon->GetCSWpnData();
Код:
CCSWeaponData* pWeaponInfo = pWeapon->GetWeaponData();
Последнее редактирование: