НАЧНИ ПРОГРАММИРОВАТЬ ПРЯМО СЕЙЧАС
-
Автор темы
- #1
Код:
char __userpurge DesyncDirection@<al>(CRagebot *a1@<ecx>, __m128i jitter@<xmm2>, int direction, int cmd_hash, int cmd_hash1)
{
CRagebot *This; // edi
CCSGOPlayerAnimState *animState; // esi
__m128 v7; // xmm1
__m128 v8; // xmm0
__m128 v9; // xmm1
__m128 feetSinCos; // ST30_16
__m128 v11; // xmm0
__m128 v12; // xmm1
__m128 currentFeetYaw; // ST20_16
__m128 previousFeetYaw; // xmm0
float v15; // ST18_4
float v16; // xmm1_4
bool v17; // cf
bool v18; // zf
float v19; // xmm1_4
float v20; // xmm0_4
float v21; // xmm0_4
char result; // al
float v23; // [esp+14h] [ebp-2Ch]
This = a1;
animState = *((m_AnimState ^ *(m_AnimStateHash ^ 0x54F12F43)) + *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12F37));
if ( !animState )
goto LABEL_18;
v7 = LODWORD(animState->m_flCurrentFeetYaw);
v7.m128_f32[0] = v7.m128_f32[0] * 0.017453292;
v8 = ScalarSinCos(v7);
v9 = LODWORD(This->m_flCurrentFeetYaw);
v9.m128_f32[0] = v9.m128_f32[0] * 0.017453292;
feetSinCos = v8;
v11 = ScalarSinCos(v9);
v12 = LODWORD(This->m_flPreviousFeetYaw);
v12.m128_f32[0] = v12.m128_f32[0] * 0.017453292;
currentFeetYaw = v11;
previousFeetYaw = ScalarSinCos(v12);
This->m_flPreviousFeetYaw = This->m_flCurrentFeetYaw;
This->m_flCurrentFeetYaw = animState->m_flCurrentFeetYaw;
v15 = atan2(
((currentFeetYaw.m128_f32[0] + feetSinCos.m128_f32[0]) + previousFeetYaw.m128_f32[0]),
((COERCE_FLOAT(_mm_shuffle_ps(currentFeetYaw, currentFeetYaw, 1))
+ COERCE_FLOAT(_mm_shuffle_ps(feetSinCos, feetSinCos, 1)))
+ COERCE_FLOAT(_mm_shuffle_ps(previousFeetYaw, previousFeetYaw, 1))));
v23 = fmod(((v15 * 57.295776) - *jitter.m128i_i32), 360.0);
v16 = v23;
if ( (v15 * 57.295776) <= *jitter.m128i_i32 )
{
if ( v23 <= -180.0 )
v16 = v23 + 360.0;
}
else if ( v23 >= 180.0 )
{
v16 = v23 - 360.0;
}
if ( direction == 1 )
{
v17 = v16 > 0.0;
v18 = v16 == 0.0;
}
else
{
v17 = v16 < 0.0;
v18 = v16 == 0.0;
}
if ( v17 || v18 )
{
LABEL_18:
This->m_iJitterIteration = 1;
result = 0;
}
else
{
v19 = (30 * (This->m_iJitterIteration % 12));
v20 = *((cmd_hash ^ cmd_hash1) - 1425092403);
if ( direction == 1 )
v21 = v20 - v19;
else
v21 = v20 + v19;
*((cmd_hash ^ cmd_hash1) - 1425092403) = v21;
*((GlobalsXor1 ^ GlobalsXor2) - 0x54F12EAF) = 1;// ShouldChoked
result = 1;
++This->m_iJitterIteration;
}
return result;
}
char __thiscall Ragebot::DesyncAnimations(CRagebot *this, int type, int cmd_hash, int cmd_hash_1)
{
CRagebot *This; // edi
int v5; // eax
int dsc_type; // esi
int localAnimState; // edx
int v8; // ecx
int v9; // ebx
signed int direction; // ebp
float dsc; // xmm0_4
float v12; // xmm1_4
float yaw; // xmm0_4
float lby_delta; // xmm1_4
float desync_length; // xmm2_4
__m128i jitter; // xmm1
float final_yaw; // xmm0_4
char result; // al
int v19; // eax
int v20; // eax
float v21; // xmm1_4
float v22; // xmm1_4
Vector4D stretch; // xmm2
float max_desync; // xmm2_4
float balance; // xmm1_4
int v26; // eax
int v27; // eax
float v28; // xmm1_4
float lby_delta_1; // [esp+14h] [ebp-4h]
int typea; // [esp+1Ch] [ebp+4h]
float dsc_1; // [esp+1Ch] [ebp+4h]
This = this;
if ( this->m_bAutomaticDir )
{
if ( rbot_antiaim_autodir == 2 ) // Desync
{
v5 = this->m_iAutoDirection;
dsc_type = 3 - (v5 != 1);
*((cmd_hash ^ cmd_hash_1) - 0x54F12F33) = *((cmd_hash ^ cmd_hash_1) - 1425092403) - (90 * v5);
goto LABEL_7;
}
if ( rbot_antiaim_autodir == 3 ) // Desync jitter
{
dsc_type = Jitter;
goto LABEL_8;
}
}
dsc_type = type;
LABEL_7:
if ( !dsc_type )
return 0;
LABEL_8:
localAnimState = *((m_AnimState ^ *(m_AnimStateHash ^ 0x54F12F43)) + *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12F37));
v8 = CRC32_Table[(*((m_AnimState ^ *(m_AnimStateHash ^ 0x54F12F43)) + *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12F37)) >> 8)
+ (((*((m_AnimState ^ *(m_AnimStateHash ^ 0x54F12F43)) + *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12F37)) >> 16) & 7) << 8)];
v9 = v8 ^ (localAnimState + 0x54F12F43);
typea = CRC32_Table[(*((m_AnimState ^ *(m_AnimStateHash ^ 0x54F12F43)) + *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12F37)) >> 8)
+ (((*((m_AnimState ^ *(m_AnimStateHash ^ 0x54F12F43)) + *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12F37)) >> 16) & 7) << 8)];
if ( (v8 ^ v8 ^ (localAnimState + 0x54F12F43)) == 0x54F12F43 )
return 0;
direction = 1;
if ( dsc_type == Jitter )
{
if ( rbot_antiaim_autodir )
{
direction = This->m_iAutoDirection;
if ( !This->m_bAutomaticDir )
{
*((cmd_hash ^ cmd_hash_1) - 0x54F12F33) = (90 * direction) + *((cmd_hash ^ cmd_hash_1) - 0x54F12F33);
v8 = typea;
}
}
else
{
*((cmd_hash ^ cmd_hash_1) - 0x54F12F33) = *((cmd_hash ^ cmd_hash_1) - 0x54F12F33) + 90.0;
}
dsc = CalculateDesyncDelta(((v9 ^ v8) - 0x54F12F43));
v12 = 180.0 - dsc;
dsc_1 = dsc;
yaw = *((cmd_hash ^ cmd_hash_1) - 0x54F12F33);
lby_delta = v12 + 10.0;
lby_delta_1 = lby_delta;
desync_length = 180.0 - (lby_delta * 0.5);
jitter = COERCE_UNSIGNED_INT((90 * direction));
*jitter.m128i_i32 = *jitter.m128i_i32 + yaw;
if ( direction == 1 )
{
final_yaw = yaw + desync_length;
}
else
{
if ( direction != -1 )
{
LABEL_19:
if ( DesyncDirection(This, jitter, direction != 1, cmd_hash, cmd_hash_1) )
{
This->m_iJitter = 0;
return 1;
}
if ( *((gpGlobalsHash1 ^ gpGlobalsHash2) - 0x54F12F33) < *((LBYPredHash1 ^ LBYPredHash2) - 0x54F12F3F) )
{
v19 = This->m_iJitter;
}
else
{
This->m_iJitter = 0;
v19 = 0;
}
v20 = v19 - 1;
if ( v20 )
{
if ( v20 == 1 )
{
if ( direction == 1 )
v21 = lby_delta_1;
else
v21 = dsc_1 - 190.0;
*((cmd_hash ^ cmd_hash_1) - 0x54F12F33) = *((cmd_hash ^ cmd_hash_1) - 0x54F12F33) + v21;
}
}
else
{
if ( direction == 1 )
v22 = dsc_1 - 190.0;
else
v22 = lby_delta_1;
*((cmd_hash ^ cmd_hash_1) - 0x54F12F33) = *((cmd_hash ^ cmd_hash_1) - 0x54F12F33) + v22;
*((GlobalsXor1 ^ GlobalsXor2) - 0x54F12EAF) = 1;
}
if ( ++This->m_iJitter >= 3 )
This->m_iJitter = 0;
goto LABEL_52;
}
final_yaw = yaw - desync_length;
}
*((cmd_hash ^ cmd_hash_1) - 1425092403) = final_yaw;
goto LABEL_19;
}
stretch = *((cmd_hash ^ cmd_hash_1) - 1425092403);
if ( dsc_type == Stretch )
stretch.x = stretch.x - 90.0;
else
stretch.x = stretch.x + 90.0;
if ( DesyncDirection(This, stretch, dsc_type == 3, cmd_hash, cmd_hash_1) )
return 1;
max_desync = CalculateDesyncDelta(((typea ^ v9) - 0x54F12F43));
if ( dsc_type == Balance )
balance = -1.0;
else
balance = 1.0;
if ( *((gpGlobalsHash1 ^ gpGlobalsHash2) - 1425092403) <= *((LBYPredHash1 ^ LBYPredHash2) - 0x54F12F3F) )
{
if ( *((GlobalsXor1 ^ GlobalsXor2) - 0x54F12EAB) >= 2 )
goto LABEL_52;
v26 = cmd_hash ^ cmd_hash_1;
if ( dsc_type == 1 )
*(v26 - 0x54F12F33) = *(v26 - 1425092403) - 100.0;
else
*(v26 - 0x54F12F33) = (balance * 120.0) + *(v26 - 0x54F12F33);
}
else if ( dsc_type != Still )
{
*((cmd_hash ^ cmd_hash_1) - 0x54F12F33) = *((cmd_hash ^ cmd_hash_1) - 0x54F12F33) - ((max_desync + 30.0) * balance);
}
*((GlobalsXor1 ^ GlobalsXor2) - 0x54F12EAF) = 1;
LABEL_52:
v27 = cmd_hash ^ cmd_hash_1;
v28 = *((cmd_hash ^ cmd_hash_1) - 1425092403);
if ( v28 <= 180.0 )
{
if ( v28 < -180.0 )
v28 = v28 + 360.0;
*(v27 - 0x54F12F33) = v28;
result = 1;
}
else
{
*(v27 - 0x54F12F33) = v28 - 360.0;
result = 1;
}
return result;
}
Код:
// Ragebot class
int m_iRotate = 0;
int m_iRotateIteration = 0;
float m_flCurrentFeetYaw = 0.0f;
float m_flPreviousFeetYaw = 0.0f;
bool m_bAutomaticDir = false;
int m_iAutoDirection = 0;
// Autodirection stuff
float distance = g_LocalPlayer->m_vecOrigin().Dot(player->m_vecOrigin());
m_iAutoDirection = 2 * ( distance <= 0.0f ) - 1;
m_bAutomaticDir = true;
// Desync
void Ragebot::DesyncAnimations( int type ) {
enum DesyncAA {
Still = 1,
Balance,
Stretch,
Jitter
};
if ( m_bAutomaticDir ) {
if ( rbot_antiaim_autodir == 2 ) {
type = 3 - ( m_iAutoDirection != 1 );
g_Context->m_Cmd->viewangles.y -= 90.0f * static_cast< float >( m_iAutoDirection );
} else if ( rbot_antiaim_autodir == 3 ) {
type = Jitter;
}
}
if ( !type )
return;
g_Context->m_Cmd->viewangles.y = Math::AngleNormalize( g_Context->m_Cmd->viewangles.y );
if ( type == Jitter ) {
int jitter_side = 1;
if ( rbot_antiaim_autodir ) {
jitter_side = m_iAutoDirection;
if ( !m_bAutomaticDir )
g_Context->m_Cmd->viewangles.y += 90.0f * static_cast< float >( m_iAutoDirection );
} else {
g_Context->m_Cmd->viewangles.y += 90.0f;
}
float desync = g_LocalPlayer->m_PlayerAnimState()->GetDesyncDelta();
float inverse_desync = 190.0f - desync;
float jitter = 180.0f - inverse_desync * 0.5f;
if ( jitter_side == 1 )
g_Context->m_Cmd->viewangles.y += jitter;
else if ( jitter_side == -1 )
g_Context->m_Cmd->viewangles.y -= jitter;
#if 0
float jitterRotate = 90.0f * jitter_side + g_Context->m_Cmd->viewangles.yaw;
if ( DesyncRotate( jitterRotate, jitter_side ) ) {
m_iRotate = 0;
return;
}
#endif
int rotate = 0;
if ( g_GlobalVars->curtime < g_Context->m_flLBYUpdateTime ) {
rotate = m_iRotate;
} else {
m_iRotate = 0;
}
rotate--;
if ( rotate ) {
if ( rotate == 1 ) {
if ( jitter_side == 1 )
g_Context->m_Cmd->viewangles.yaw += inverse_desync;
else
g_Context->m_Cmd->viewangles.yaw += desync - 190.0f;
}
} else {
if ( jitter_side == 1 )
g_Context->m_Cmd->viewangles.yaw += desync - 190.0f;
else
g_Context->m_Cmd->viewangles.yaw += inverse_desync;
g_Context->m_bShouldChoke = true;
}
if ( ++m_iRotate >= 3 )
m_iRotate = 0;
} else {
#if 0
float stretch = g_Context->m_Cmd->viewangles.y;
if ( type == Stretch )
stretch -= 90.0f;
else
stretch += 90.0f;
stretch = Math::AngleNormalize( stretch );
if ( DesyncRotate( stretch, type == Stretch ) )
return;
#endif
float desync = g_LocalPlayer->m_PlayerAnimState()->GetDesyncDelta();
float balance = 1.0f;
if ( type == Balance )
balance = -1.0f;
if ( g_Context->m_flLBYUpdateTime >= g_GlobalVars->curtime ) {
if ( !g_Context->m_bShouldChoke && g_ClientState->chokedcommands >= 2 ) {
g_Context->m_Cmd->viewangles.yaw = Math::AngleNormalize( g_Context->m_Cmd->viewangles.yaw );
return;
}
if ( type == Still )
g_Context->m_Cmd->viewangles.yaw -= 100.0f;
else
g_Context->m_Cmd->viewangles.yaw += ( balance * 120.0f );
} else if ( type != Still ) {
// lby breaker
g_Context->m_Cmd->viewangles.yaw -= ( desync + 30.0f ) * balance;
}
g_Context->m_bShouldChoke = true;
}
g_Context->m_Cmd->viewangles.yaw = Math::AngleNormalize( g_Context->m_Cmd->viewangles.yaw );
}
bool Ragebot::DesyncRotate( float rotation, int direction ) {
CCSGOPlayerAnimState* animState = g_LocalPlayer->m_PlayerAnimState();
float feetYaw = DEG2RAD( animState->m_flGoalFeetYaw );
float feetSin, feetCos;
DirectX::XMScalarSinCos( &feetSin, &feetCos, feetYaw );
float feetSin1, feetCos1;
DirectX::XMScalarSinCos( &feetSin1, &feetCos1, m_flGoalFeetYaw );
float feetSin2, feetCos2;
DirectX::XMScalarSinCos( &feetSin2, &feetCos2, m_flPreviousFeetYaw );
m_flPreviousFeetYaw = m_flGoalFeetYaw;
m_flGoalFeetYaw = animState->m_flGoalFeetYaw;
float totalRotation = atan2( feetSin1 + feetSin + feetSin2, feetCos1 + feetCos + feetCos2 );
totalRotation = Math::AngleNormalize( RAD2DEG( totalRotation ) - rotation );
if ( direction == 1 ) {
if ( totalRotation >= 0.0f ) {
m_iRotateIteration = 1;
return false;
}
} else if ( totalRotation <= 0.0f ) {
m_iRotateIteration = 1;
return false;
}
float rotate = static_cast< float >( 30 * ( m_iRotateIteration % 12 ) );
if ( direction == 1 )
g_Context->m_Cmd->viewangles.y -= rotate;
else
g_Context->m_Cmd->viewangles.y += rotate;
g_Context->m_Cmd->viewangles.y = Math::AngleNormalize( g_Context->m_Cmd->viewangles.y );
g_Context->m_bShouldChoke = true;
++m_iRotateIteration;
return true;
}
Демонстрация работы всех типов десинка:
Still - десинк без лбу брейкера
Balance
Stretch
Код требует не только исправления( подсказка: DesyncRotate ), но и дополнительные части, которые вполне можно реализовать без дампа АВ ( предугадывание обновления LBY ).
fake = cmd->viewangles.y когда SendPacket == true
real = C_BaseEntity::m_angRotation(или CCSGOPlayerAnimState::m_flGoalFeetYaw) когда SendPacket == true
Последнее редактирование: