New TraceToExit

Забаненный
Статус
Оффлайн
Регистрация
20 Июн 2021
Сообщения
1
Реакции[?]
5
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
today a new update in CS:GO was released where tracetoexit was changed in server.dll

new TraceToExit in server.dll
Пожалуйста, авторизуйтесь для просмотра ссылки.


old TraceToExit in server.dll
Пожалуйста, авторизуйтесь для просмотра ссылки.

new tracetoexit pseudocode + sigs

Код:
// "55 8B EC 83 EC 4C F3 0F 10 75"
char __usercall TraceToExit@<al>(trace_t *enter_trace@<edx>, Vector *end_pos@<ecx>, Vector start_pos, float direction_x, float direction_y, float direction_z, trace_t *exit_trace, int unk, int unk2, int player)
{
  float v19; // xmm1_4
  float v20; // xmm2_4
  float v21; // xmm3_4
  float v22; // xmm0_4
  float v23; // xmm1_4
  int contents; // eax
  char result; // al
  char exit_trace_startsolid; // dl
  char no_draw; // bl
  float v28; // eax
  float v29; // xmm0_4
  float v30; // xmm2_4
  float v31; // xmm1_4
  float v32; // xmm0_4
  int world_entity; // eax
  void **hit_ent; // ecx
  float v35; // xmm1_4
  float v36; // xmm0_4
  float v37; // [esp+1Ch] [ebp-60h]
  int two_ent_filter[5]; // [esp+30h] [ebp-4Ch] BYREF
  int clip_trace_filter[4]; // [esp+44h] [ebp-38h] BYREF
  Vector v40; // [esp+54h] [ebp-28h]
  Vector start; // [esp+60h] [ebp-1Ch] BYREF
  float pen_distance; // [esp+6Ch] [ebp-10h] MAPDST
  int first_contents; // [esp+74h] [ebp-8h] MAPDST

  first_contents = 0;
  pen_distance = 0.0;
  first_contents = 0;

  do
  {
    pen_distance = pen_distance + 4.0;
    v19 = direction_y * pen_distance;
    v20 = direction_z * pen_distance;
    v21 = start_pos.x + (float)(direction_x * pen_distance);
    v22 = start_pos.y + v19;
    v23 = start_pos.z + v20;
    end_pos->x = v21;
    end_pos->y = v22;
    end_pos->z = v23;
    start.x = v21 - (float)(direction_x * 4.0);
    start.y = v22 - (float)(direction_y * 4.0);
    start.z = v23 - (float)(direction_z * 4.0);

    if ( !first_contents )
      first_contents = g_EngineTrace->GetPointContents(end_pos, 0x4600400B, 0);

    contents = g_EngineTrace->GetPointContents(end_pos, 0x4600400B, 0);
    if ( (contents & 0x600400B) == 0 || (contents & 0x40000000) != 0 && first_contents != contents )
    {
      // TraceLineWithFilter(end_pos, &_end, 0x4600400B, (CTraceFilterSimple*)0, exit_trace); - previous upd
      TraceLineWithCollisionGroup(end_pos, &start, 0x4600400B, player, 0, exit_trace);
     
      // previous upd: cliptracetoplayers was without any filters.
      clip_trace_filter[1] = player;
      clip_trace_filter[0] = (int)&CTraceFilterSimple_vtable;
      clip_trace_filter[2] = 0;
      clip_trace_filter[3] = 0;
      if ( ((int (__thiscall *)(void ***))sv_clip_penetration_traces_to_players[13])(&sv_clip_penetration_traces_to_players) )
        ClipTraceToPlayers(&start, end_pos, 0x4600400B, (int)clip_trace_filter, exit_trace, -60.0, v37);

      if ( exit_trace->startsolid == 1 && (exit_trace->surface.flags & 0x8000u) != 0 )
      {
        two_ent_filter[1] = player;
        two_ent_filter[4] = (int)exit_trace->hit_entity;
        two_ent_filter[2] = 0;
        two_ent_filter[3] = 0;
        two_ent_filter[0] = (int)&CTraceFilterSkipTwoEntities_vtable;      
        // TraceLineWithCollisionGroup(end_pos, &start_pos, 0x600400B, exit_trace->hit_entity, 0, exit_trace); - previous upd
        TraceLineWithFilter(end_pos, &start_pos, 0x600400B, (int)two_ent_filter, (int)exit_trace);
        if ( trace_t::DidHit(exit_trace) && !exit_trace->startsolid )
          goto LABEL_13;
      }
      else if ( !trace_t::DidHit(exit_trace) || exit_trace_startsolid )
      {
        if ( enter_trace->hit_entity )
        {
          world_entity = g_world[0] ? (*(int (__thiscall **)(int))(*(_DWORD *)g_world[0] + 28))(g_world[0]) : 0;
          hit_ent = (void **)enter_trace->hit_entity;
          if ( hit_ent != (void **)world_entity )
          {
            if ( (unsigned __int8)is_breakable(hit_ent) )
            {

              copy_trace(exit_trace, enter_trace);
              result = 1;
              v35 = start_pos.y + direction_y;
              v36 = start_pos.z + direction_z;
              exit_trace->endpos.x = start_pos.x + direction_x;
              exit_trace->endpos.y = v35;
              exit_trace->endpos.z = v36;
              return result;
            }
          }
        }
      }
      else
      {
        no_draw = (enter_trace->surface.flags & SURF_NODRAW) != 0;
        if ( (exit_trace->surface.flags & SURF_NODRAW) == 0 )
          goto LABEL_34;

        if ( (unsigned __int8)is_breakable((void **)exit_trace->hit_entity)
          && (unsigned __int8)is_breakable((void **)enter_trace->hit_entity) )
        {
LABEL_13:
          *end_pos = exit_trace->endpos;
          return 1;
        }

        if ( no_draw )
        {
LABEL_34:
          v28 = exit_trace->plane.normal.z;
          *(_QWORD *)&v40.x = *(_QWORD *)&exit_trace->plane.normal.x;
          v40.z = v28;
          if ( (float)((float)((float)(v40.y * direction_y) + (float)(v40.x * direction_x)) + (float)(v28 * direction_z)) <= 1.0 )
          {
            result = 1;
            v29 = exit_trace->fraction * 4.0;
            v30 = end_pos->x - (float)(direction_x * v29);
            v31 = end_pos->y - (float)(direction_y * v29);
            v32 = end_pos->z - (float)(direction_z * v29);
            end_pos->x = v30;
            end_pos->y = v31;
            end_pos->z = v32;
            return result;
          }
        }
      }
    }
  }
  while ( pen_distance <= 90.0 );
  return 0;
}

// "55 8B EC 83 E4 F0 83 EC 6C 56 52"
void __usercall TraceLineWithFilter(Vector *from@<ecx>, Vector *to@<edx>, int mask, int filter, int out_trace)
{
  double v5; // xmm2_8
  int v6; // eax
  float v7; // [esp+10h] [ebp-74h]
  int v8[3]; // [esp+1Ch] [ebp-68h] BYREF
  int v9[3]; // [esp+28h] [ebp-5Ch] BYREF
  Ray_t ray; // [esp+34h] [ebp-50h] BYREF

  ray.m_pWorldAxisTransform = 0;
  Ray_t::Init(&ray, &from->x, &to->x);
  g_EngineTrace->TraceRay(&ray, mask, (void *)filter, (trace_t *)out_trace);
  // visualize_trace removed from pseudo
}

// "55 8B EC 83 E4 F0 83 EC 7C 56 52"
void __usercall TraceLineWithCollisionGroup(Vector *from@<ecx>, Vector *to@<edx>, int mask, int player, int group, trace_t *out_trace)
{
  double v6; // xmm2_8
  int v7; // eax
  float v8; // [esp+10h] [ebp-84h]
  int v9[3]; // [esp+1Ch] [ebp-78h] BYREF
  int v10[3]; // [esp+28h] [ebp-6Ch] BYREF
  int filter[4]; // [esp+34h] [ebp-60h] BYREF
  Ray_t ray; // [esp+44h] [ebp-50h] BYREF

  ray.m_pWorldAxisTransform = 0;
  Ray_t::Init(&ray, &from->x, &to->x);
  filter[1] = player;
  filter[0] = (int)&CTraceFilterSimple_vtable;
  filter[2] = group;
  filter[3] = 0;
  g_EngineTrace->TraceRay(&ray, mask, filter, out_trace);
  // visualize_trace removed from pseudo
}
credits: Soufiw L3D451R7

Пожалуйста, авторизуйтесь для просмотра ссылки.


Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Последнее редактирование:
sapphire dev
Пользователь
Статус
Оффлайн
Регистрация
15 Мар 2018
Сообщения
188
Реакции[?]
124
Поинты[?]
36K
Дарю для супримаси,не много, относительно, говнокода, фильтр зафиксите, а реверс вт в2 со стеклами это нечто...

 
Последнее редактирование:
Сверху Снизу