[AHK] Объединение и оффсеты. СРОЧНО - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: Sanoxxx, Alowir, Phoenixxx_Czar  
[AHK] Объединение и оффсеты. СРОЧНО
VadimLovesYou Дата: Среда, 20.04.2022, 08:52 | Сообщение # 1
Новичок
Сообщений: 2
Статус: Offline
Всем добрый день, я не программист, но сами знаете как иногда бывает.
В данный момент не могу решить ситуацию.

Есть 4 отдельных AHK-скрипта, все они для процесса csgo.exe и выполняют по сути одну и ту же задачу , просто разными способами и 1 скрипт для другой задачи.
Так же есть репозиторий оффсетов, который обновляется вместе с игрой.
Сама сложность состоит в том, что скрипты написаны давно и сейчас при компиляции выдают ошибки. Помогите соотнести их с оффсетами или как-то обновить до рабочего состояния.

Так же нужно взять один из четырез скриптов, который окажется самым удобным т объединить с другим (либо в один файл, либо один процесс запускает другой.

Ниже прикрепляю все имеющиеся материалы.

Скрипт 1:
Код


Vector velocity = local_player->GetVelocity();
QAngle direction = velocity.ToAngle();
float speed = velocity.Length();

direction.y = cmd->viewangles.y - direction.y;

Vector negated_direction = direction.Forward() * -speed;

cmd->forwardmove = negated_direction.x;
cmd->sidemove = negated_direction.y;


Скрипт 2:
Код


void StopMovement(CUserCmd& cmd)
{
    constexpr bool isHexagoneGodlike = true;

    C_CSPlayer* pLocalPlayer = util::GetLocalPlayer();

    if (pLocalPlayer->GetMoveType() != MOVETYPE_WALK)
  return; // Not implemented otherwise :(

    Vector3 hvel = pLocalPlayer->GetVelocity();
    hvel.z = 0;
    float speed = hvel.length2d();

    if (speed < 1.f) // Will be clipped to zero anyways
    {
  cmd.forwardmove = 0.f;
  cmd.sidemove = 0.f;
  return;
    }

    // Homework: Get these dynamically
    float accel = 5.5f;
    float maxSpeed = 320.f;
    float playerSurfaceFriction = 1.0f; // I'm a slimy boi
    float max_accelspeed = accel * g_ptrs.pGlobals->interval_per_tick * maxSpeed * playerSurfaceFriction;

    float wishspeed{};

    // Only do custom deceleration if it won't end at zero when applying max_accel
    // Gamemovement truncates speed < 1 to 0
    if (speed - max_accelspeed <= -1.f)
    {
  // We try to solve for speed being zero after acceleration:
  // speed - accelspeed = 0
  // speed - accel*frametime*wishspeed = 0
  // accel*frametime*wishspeed = speed
  // wishspeed = speed / (accel*frametime)
  // ^ Theoretically, that's the right equation, but it doesn't work as nice as
  //   doing the reciprocal of that times max_accelspeed, so I'm doing that :shrug:
  wishspeed = max_accelspeed / (speed / (accel * g_ptrs.pGlobals->interval_per_tick));
    }
    else // Full deceleration, since it won't overshoot
    {
  // Or use max_accelspeed, doesn't matter
  wishspeed = max_accelspeed;
    }

    // Calculate the negative movement of our velocity, relative to our viewangles
    Vector3 ndir = (hvel * -1.f).vectorToAngles();
    ndir.y = cmd.viewangles.y - ndir.y; // Relative to local view
    ndir = ndir.anglesToVector(); // Back to vector, y'all

    cmd.forwardmove = ndir.x * wishspeed;
    cmd.sidemove = ndir.y * wishspeed;
}


Скрипт 3:
Код

bool RayTracing::bHasChanceToHit( CUserCmd* pCommand, const Vector& vStart, const Vector& vIn, C_BaseEntity* pLocalBaseEntity, C_BaseEntity* pWeapon, C_BaseEntity* pBaseEntity, int iHitGroup, float fMinChance )
{
    int iTracesHit = 0;

    for ( int i = 0; i < 256; ++i )
    {
  Vector vEnd;
  g_NoSpread.FixSpread( i, pCommand, pWeapon, vIn, vEnd );
  AngleVectors( vEnd, vEnd );
  vEnd = vEnd * pWeapon->GetCSWpnData()->fGetRange() + vStart;
  
  trace_t pTrace; TraceLine( vStart, vEnd, 0x4600400B, pLocalBaseEntity, &pTrace );

  if ( pTrace.m_pEnt != pBaseEntity )
   continue;

  if ( pTrace.hitgroup != iHitGroup )
   continue;

  ++iTracesHit;
    }

    if ( iTracesHit / 256.f >= fMinChance / 100.f )
  return true;

    return false;
}


Скрипт 4:
Код

void fastStop(CUserCmd* cmd)
    {
        Vector velocity = g::local_player->m_vecVelocity();
  QAngle direction;
  math::vector2angles(velocity, direction);
  float speed = velocity.Length2D();

  direction.yaw = cmd->viewangles.yaw - direction.yaw;

  Vector forward;
  math::angle2vectors(direction, forward);

  Vector right = (forward + 0.217812) * -speed;
  Vector left = (forward + -0.217812) * -speed;

  Vector move_forward = (forward + 0.217812) * -speed;
  Vector move_backward = (forward + -0.217812) * -speed;

  if (!(cmd->buttons & IN_MOVELEFT))
  {
   cmd->sidemove += +left.y;
  }

  if (!(cmd->buttons & IN_MOVERIGHT))
  {
   cmd->sidemove -= -right.y;
  }

  if (!(cmd->buttons & IN_FORWARD))
  {
   if (cmd->buttons & IN_MOVELEFT || cmd->buttons & IN_MOVERIGHT || settings::misc::auto_strafe) //insert here your bool for auto strafe
    return;

   cmd->forwardmove += +move_forward.x;
  }

  if (!(cmd->buttons & IN_BACK))
  {
   if (cmd->buttons & IN_MOVELEFT || cmd->buttons & IN_MOVERIGHT || settings::misc::auto_strafe) //insert here your bool for auto strafe
    return;

   cmd->forwardmove -= -move_backward.x;
  }
    }


Все предыдущие имели задачей максимально быстро снизить скорость модели. Последний банальный вх. Нужно объединить, чтобы получить можный инструмент:

Код


$F1::
t := !t

Data := t
Size = 1

VarSetCapacity(Buf, Size, 0)
NumPut(Data, Buf, "UInt")

PROCESS_VM_WRITE = 0x20
PROCESS_VM_OPERATION = 0x8

Process, Exist, csgo.exe

If(!ErrorLevel) {
  MsgBox, Process not found.
}

PID := ErrorLevel

base := GetDllBase("client.dll", ErrorLevel)
Address := base + 1896792
;msgbox % Address

hProcess := DllCall("OpenProcess", "UInt", PROCESS_VM_WRITE | PROCESS_VM_OPERATION
                    , "Int",  False
                    , "UInt", PID)
If(!hProcess) {
   MsgBox, Failed to read memory.
}

Ret := DllCall("WriteProcessMemory", "UInt", hProcess
                    , "UInt", Address
                    , "UInt", &Buf
                    , "UInt", Size
                    , "UInt", 0)

DllCall("CloseHandle", "UInt", hProcess)

If(!Ret) {
  MsgBox, Failed to write.
}
return


GetDllBase(DllName, PID = 0)
{
   TH32CS_SNAPMODULE := 0x00000008
    INVALID_HANDLE_VALUE = -1
    VarSetCapacity(me32, 548, 0)
    NumPut(548, me32, "Uint")
    snapMod := DllCall("CreateToolhelp32Snapshot", "Uint", TH32CS_SNAPMODULE
                    , "Uint", PID)
    If (snapMod = INVALID_HANDLE_VALUE) {
        Return 0
    }
    If (DllCall("Module32First", "Uint", snapMod, "Uint", &me32)){
        while(DllCall("Module32Next", "Uint", snapMod, "UInt", &me32)) {
            If !DllCall("lstrcmpi", "Str", DllName, "UInt", &me32 + 32) {
                DllCall("CloseHandle", "UInt", snapMod)
                Return NumGet(&me32 + 20)
            }
        }
    }
    DllCall("CloseHandle", "Uint", snapMod)
    Return 0
}


Огромное спасибо всем, кто проситалю Тем кто поможет - пожизненный респект

Добавлено (20.04.2022, 09:27)
---------------------------------------------
https://github.com/frk1/hazedumper

Офсеты

  • Страница 1 из 1
  • 1
Поиск:
Статистика Форума