-
Автор темы
- #1
C++:
enum weapon_functions
{
activate_duration = 2,
ai_sound_radius = 4,
ammo_amount = 5,
bayonet_melee_duration = 13,
bayonet_melee_out_duration = 14,
damage = 26,
damage_drop_min_distance = 27,
damage_drop_per_meter = 28,
damage_min = 29,
deselect_duration = 31,
holster_in_duration = 42,
melee_damage = 55,
melee_duration = 56,
melee_out_duration = 61,
melee_radius = 62,
melee_range = 63,
recoil_att = 66,
recoil_dec = 67,
recoil_dec_delay = 68,
recoil_max = 69,
recoil_rnd = 70,
reload_duration = 72,
rpm = 80,
secondary_melee_damage = 82,
secondary_melee_duration = 83,
secondary_melee_out_duration = 85,
secondary_melee_radius = 86,
secondary_melee_range = 87,
select_duration = 88,
spread_att = 92,
spread_dec = 93,
spread_dec_delay = 94,
spread_max = 95,
spread_min = 96,
sway_speed_mult = 103,
throw_delay_duration = 104,
throw_duration = 105,
throw_fire_delay_duration = 106,
toss_duration = 107,
zoom_factor = 108,
zoom_in_duration = 109,
zoom_out_duration = 111
};
C++:
class i_weapon_crypt
{
public:
void no_sway()
{
p_mem.write<Vec3>((uintptr_t)this, type_zero::_zero);
}
bool get_encrypt_value(uint32_t id, f32* value)
{
bool result = false;
uint32_t xor_decdata[2];
p_mem.read_memory(encrypted_data_entry(id) + 0x20, &xor_decdata, sizeof(xor_decdata));
result = *(uint32_t*)value = xor_decdata[0] ^ xor_decdata[1];
return result;
}
void set_encrypt_value(uint32_t id, f32 value)
{
p_mem.write<uint32_t>(encrypted_data_entry(id) + 0x20, *(uint32_t*)&value ^ p_mem.read<uint32_t>(encrypted_data_entry(id) + 0x24));
}
private:
uint64_t encrypted_data_entry(uint32_t id)
{
uint64_t result;
uint64_t v3 = p_mem.read64((uintptr_t)this + 0x68);
uint64_t v5 = p_mem.read64(v3 + 0x8);
while (!p_mem.read<BYTE>(v5 + 0x19))
{
uint32_t entity_id = p_mem.read<uint32_t>(v5 + 0x1C);
if (entity_id == id)
break;
else
if (entity_id < id)
v5 = p_mem.read<uint64_t>(v5 + 0x10);
else
v5 = p_mem.read<uint64_t>(v5);
}
if (p_mem.read<uint32_t>(v5 + 0x1C) == id)
result = v5;
return result;
}
};
C++:
if (settings.no_recoil)
{
m_weapon_crypt->set_encrypt_value(weapon_functions::recoil_att, 0.f);
m_weapon_crypt->set_encrypt_value(weapon_functions::recoil_dec, 0.f);
m_weapon_crypt->set_encrypt_value(weapon_functions::recoil_dec_delay, 0.f);
m_weapon_crypt->set_encrypt_value(weapon_functions::recoil_max, 0.f);
m_weapon_crypt->set_encrypt_value(weapon_functions::recoil_rnd, 0.f);
}