-
Автор темы
- #1
Всем привет Через 1-2 дня падает траст Extrnal Записи в память нету только чтение.
classes.h
memory.h
функции.h
csgo.h
Аим бот обходит все топ серверные анти читы (прекрасно там работает и Анти чит нечего не видит ) из этого считаю что какие то проверки вальве в том же мм должен обходить , с чем связано падение траст фактора не знаю , прошу помощи .В сурсе вырезал все функции требующие запись в память игры так же поменял саму память она нечего не записывает и не изменяет в памяти игры только читает , почему падает траст не понимаю уже просто нечему ибо 2 функции аим и вх
Пока что грешу на аим или хендл процес , как это решить и что конкретно снижает траст не знаю
classes.h
Код:
#pragma once
#include "includes.h"
#include "memory.h"
#include "offsets.h"
#include <math.h>
class c_engine
{
public:
DWORD get_clientstate()
{
return memory::read<DWORD>(globals::engine + offsets::dwClientState);
}
bool is_ingame()
{
return memory::read<DWORD>(get_clientstate() + offsets::dwClientState_State) == 6;
}
vec3_t get_viewangles()
{
DWORD client_state = memory::read<DWORD>(globals::engine + offsets::dwClientState);
vec3_t view_angles = memory::read<vec3_t>(client_state + offsets::dwClientState_ViewAngles);
return view_angles;
}
void set_viewangles(vec3_t view_angles)
{
//memory::write<vec3_t>( get_clientstate() + offsets::dwClientState_ViewAngles, view_angles );
}
};
c_engine g_engine;
class c_client
{
public:
uintptr_t get_entity_from_index(int index)
{
return memory::read<uintptr_t>(globals::client + offsets::dwEntityList + (index * 0x10));
}
};
c_client g_client;
//improve by creating a player-cache
class c_player
{
public:
std::uintptr_t address;
c_player()
{
address = memory::read<uintptr_t>(globals::client + offsets::dwLocalPlayer);
}
c_player(int index)
{
address = g_client.get_entity_from_index(index);
}
uint32_t get_health()
{
return memory::read<uint32_t>(address + offsets::m_iHealth);
}
uint32_t get_team()
{
return memory::read<uint32_t>(address + offsets::m_iTeamNum);
}
/*bool get_spotted()
{
return memory::read<uint32_t>(address + offsets::m_bSpotted);
}
bool set_spotted(bool value)
{
//if ( memory::write<uint32_t>( address + offsets::m_bSpotted, value ) )
return true;
}*/
bool get_dormant()
{
return memory::read<uint32_t>(address + offsets::m_bDormant);
}
/*uint32_t get_flags()
{
return memory::read<uint32_t>(address + offsets::m_fFlags);
}*/
uint32_t get_classid()
{
return memory::read<uint32_t>(memory::read<DWORD>(memory::read<DWORD>(memory::read<DWORD>(address + 0x8) + 0x8) + 0x1) + 0x14);
}
/*bool get_immunity()
{
return memory::read<bool>(address + offsets::m_bGunGameImmunity);
}*/
/*DWORD32 get_bone_matrix()
{
return memory::read<DWORD32>(address + offsets::m_dwBoneMatrix);
}*/
/*float get_sensitivity()
{
DWORD sensitivity = memory::read<DWORD>(globals::client + offsets::dwSensitivity) ^ (DWORD)(globals::client + offsets::dwSensitivityPtr);
return *(float*)&sensitivity;
}
bool set_sensitivity(DWORD value)
{
//if ( memory::write<DWORD>( (globals::client + offsets::dwSensitivity) ^ (DWORD)(globals::client + offsets::dwSensitivityPtr), value ) )
return true;
}*/
/*DWORD32 get_crosshair_id()
{
return memory::read<DWORD32>(address + offsets::m_iCrosshairId);
}
c_player get_crosshair_entity()
{
c_player enemy;
enemy.address = memory::read<DWORD>(globals::client + offsets::dwEntityList + (c_player().get_crosshair_id() - 1) * 0x10);
return enemy;
}*/
vec3_t aim_punch_angle()
{
return memory::read<vec3_t>(address + offsets::m_aimPunchAngle);
}
vec3_t get_origin()
{
return memory::read<vec3_t>(address + offsets::m_vecOrigin);
}
vec3_t get_bone_pos(int bone)
{
DWORD bone_matrix_ptr = memory::read<DWORD>(address + offsets::m_dwBoneMatrix);
bone_matrix bone_pos = memory::read<bone_matrix>(bone_matrix_ptr + bone * 0x30);
return vec3_t({ bone_pos.x, bone_pos.y, bone_pos.z });
}
vec3_t get_local_eye()
{
vec3_t vec_origin = get_origin();
vec3_t vec_offset = memory::read<vec3_t>(address + offsets::m_vecViewOffset);
return vec_origin + vec_offset;
}
/*uint32_t get_weapon()
{
return memory::read<uint32_t>(address + offsets::m_hActiveWeapon);
}
uint32_t get_weapon_entity()
{
return memory::read<uint32_t>(globals::client + offsets::dwEntityList + ((get_weapon() & 0xFFF) - 1) * 0x10);
}
uint32_t get_weapon_index()
{
return memory::read<uint32_t>(get_weapon_entity() + 0x2d90 + 0x40 + 0x1ea);
}*/
};
c_player g_localplayer;
Код:
#pragma once
#include "includes.h"
#include "globals.h"
namespace memory
{
template <class t>
t read( uintptr_t address )
{
t data{};
LI_FN(ReadProcessMemory).forwarded_safe_cached()( globals::_handle, ( PVOID ) address, &data, sizeof( t ), NULL );
return data;
}
uintptr_t get_module( const wchar_t* modName )
{
uintptr_t modBaseAddr = 0;
HANDLE hSnap = LI_FN(CreateToolhelp32Snapshot).forwarded_safe_cached()( TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, globals::process_id );
if( hSnap != INVALID_HANDLE_VALUE )
{
MODULEENTRY32 modEntry;
modEntry.dwSize = sizeof( modEntry );
if( Module32First( hSnap, &modEntry ) )
{
do
{
if( !_wcsicmp( modEntry.szModule, modName ) )
{
modBaseAddr = ( uintptr_t ) modEntry.modBaseAddr;
break;
}
} while( Module32Next( hSnap, &modEntry ) );
}
}
LI_FN(CloseHandle).forwarded_safe_cached()( hSnap );
return modBaseAddr;
}
}
Код:
#pragma once
#include "includes.h"
#include "classes.h"
#include "csgo.h"
#include "config.h"
namespace features
{
//just realized this shit is way off
//look at rcs code to see how to improve this
void recoil_crosshair()
{
if (!settings->visuals.recoil_crosshair)
return;
vec3_t vVecpunch{};
vec3_t aim_punch_angle = memory::read<vec3_t>(g_localplayer.address + offsets::m_aimPunchAngle);
auto x = (globals::res_x / 2);
auto y = (globals::res_y / 2);
auto dy = globals::res_y / 90;
auto dx = globals::res_x / 90;
x -= (dx * aim_punch_angle.y);
y += (dy * aim_punch_angle.x);
Ellipse(hdc, x - 2, y - 2, x + 2, y + 2);
}
void rect_esp(c_player enemy)
{
//visuals->enabled really just means rectangle enabled
if (!settings->visuals.enabled)
return;
//head pos
vec3_t enemy_head_pos = enemy.get_bone_pos(8);
enemy_head_pos.z += 10;
vec2_t enemy_head_screen{};
world_to_screen(enemy_head_pos, enemy_head_screen);
//base origin
vec3_t enemy_origin_pos = enemy.get_origin();
vec2_t enemy_origin_screen{};
world_to_screen(enemy_origin_pos, enemy_origin_screen);
float h = enemy_origin_screen.y - enemy_head_screen.y;
float w = (h / 2);
draw_box(enemy_head_screen.x - (w / 2), enemy_head_screen.y, w, h, 1);
}
void visuals()
{
if (!settings->visuals.enabled
&& !settings->visuals.recoil_crosshair)
return;
while (true)
{
//fast-esp = no sleep
if (!settings->misc.multi_threads)
Sleep(0);
if (!globals::b_run_features)
continue;
//localplayer visuals
recoil_crosshair();
for (int i = 0; i != 32; i++)
{
c_player enemy = c_player(i);
if (!enemy.address
|| enemy.get_dormant()
|| enemy.get_team() == g_localplayer.get_team()
|| enemy.address == g_localplayer.address
|| !enemy.get_health())
continue;
rect_esp(enemy);
}
}
}
//IMPROVEMENT:
//currently mouse aimbot uses the angle calculated with the normal aimbot's smoothing
//this converted smoothing, if at a higher value, can cause the aimbot to be inaccurate and aim around the player
//this fixes itself while firing, but it still a noticable problem on very high smoothing values
//to fix this - remove the smoothing in the normal aimbots calculations, and add your own mouse_event smoothing
void mouse_aimbot(vec3_t aim_angle)
{
float sens = settings->aimbot.sens;
vec3_t local_angle = g_engine.get_viewangles();
float delta_x = local_angle.x - aim_angle.x;
float delta_y = local_angle.y - aim_angle.y;
vec3_t mouse_angle{};
mouse_angle.x = (delta_x * -1.0f) / (0.022f * sens);
mouse_angle.y = (delta_y) / (0.022f * sens);
angle_sanitize(mouse_angle);
LI_FN(mouse_event).forwarded_safe_cached()(0x1, (int)mouse_angle.y, (int)mouse_angle.x, 0, 0);
}
void aimbot()
{
if (!settings->aimbot.enabled)
return;
float aim_smooth = settings->aimbot.smooth * 10.0f;
if (!GetAsyncKeyState(settings->aimbot.key))
return;
if (auto target = find_target())
{
c_player entity = c_player(target);
vec3_t local_eye = g_localplayer.get_local_eye();
vec3_t local_viewangles = g_engine.get_viewangles();
vec3_t target_position = entity.get_bone_pos(get_nearest_bone(entity));
vec3_t aim_angle = calc_aim(local_eye, target_position, local_viewangles);
aim_angle /= aim_smooth;
aim_angle = local_viewangles += aim_angle;
angle_sanitize(aim_angle);
if (settings->aimbot.type == 1)
g_engine.set_viewangles(aim_angle);
else if (settings->aimbot.type == 2)
mouse_aimbot(aim_angle);
}
}
}
C++:
#pragma once
#include "classes.h"
//enemy visuals color
#define EnemyPen 0x000000FF
//setup GDI for visuals
HDC hdc = GetDC( FindWindowA( NULL, xorstr_( "Counter-Strike: Global Offensive - Direct3D 9" ) ) );
HBRUSH EnemyBrush = LI_FN( CreateSolidBrush ).forwarded_safe_cached()(0x000000FF);
vec3_t calc_aim( vec3_t& source, vec3_t& destination, vec3_t& viewAngles )
{
vec3_t delta = source - destination;
auto radians_to_degrees = []( float radians )
{
return radians * 180 / static_cast<float>(3.14159265358979323846);
};
vec3_t angles;
angles.x = radians_to_degrees( atanf( delta.z / std::hypotf( delta.x, delta.y ) ) ) - viewAngles.x;
angles.y = radians_to_degrees( atanf( delta.y / delta.x ) ) - viewAngles.y;
angles.z = 0.0f;
if ( delta.x >= 0.0 )
angles.y += 180.0f;
//determine rcs inside of calcangle to do our fancy recoil-based fov
//you don't have to do it inside of calcangle at all
//but my internal I ported it from it makes sense I swear. Pass a struct or something of recoil settings idk
if ( true ) //is rcs enabled, currently no setting to disable
{
vec3_t vVecpunch;
vec3_t Delta;
auto aim_punch = g_localplayer.aim_punch_angle() * 2;
//rcs-independant smoothing?
Delta.x = aim_punch.x;
Delta.y = aim_punch.y;
angles.x -= Delta.x * settings->aimbot.rcs_x;
angles.y -= Delta.y * settings->aimbot.rcs_y + 0.04f;
angle_normalize( angles );
}
return angles;
}
bool world_to_screen( vec3_t pos, vec2_t& screen ) // converts 3D coords to 2D coords
{
float screen_width = (float)globals::res_x;
float screen_height = (float)globals::res_y;
float Matrix[16]; // [4][4]: 4*4 = 16
LI_FN( ReadProcessMemory ).forwarded_safe_cached()(globals::_handle, (PFLOAT)(globals::client + offsets::dwViewMatrix), &Matrix, sizeof( Matrix ), 0);
//Matrix-vector Product, multiplying world(eye) coordinates by projection matrix = clipCoords
vec4_t clipCoords;
clipCoords.x = pos.x * Matrix[0] + pos.y * Matrix[1] + pos.z * Matrix[2] + Matrix[3];
clipCoords.y = pos.x * Matrix[4] + pos.y * Matrix[5] + pos.z * Matrix[6] + Matrix[7];
clipCoords.z = pos.x * Matrix[8] + pos.y * Matrix[9] + pos.z * Matrix[10] + Matrix[11];
clipCoords.w = pos.x * Matrix[12] + pos.y * Matrix[13] + pos.z * Matrix[14] + Matrix[15];
if ( clipCoords.w < 0.1f ) // if the camera is behind our player don't draw, i think?
return false;
vec3_t NDC;
// Normalize our coords
NDC.x = clipCoords.x / clipCoords.w;
NDC.y = clipCoords.y / clipCoords.w;
NDC.z = clipCoords.z / clipCoords.w;
// Convert to window coords (x,y)
screen.x = (screen_width / 2 * NDC.x) + (NDC.x + screen_width / 2);
screen.y = -(screen_height / 2 * NDC.y) + (NDC.y + screen_height / 2);
return true;
}
int get_nearest_bone( c_player entity )
{
float best_dist = 360.f;
int aim_bone = 8;
std::vector<int> target_bones{ 8, 7, 6, 5, 3 };
for ( int i : target_bones )
{
vec3_t local_eye = g_localplayer.get_local_eye();
vec3_t local_angles = g_engine.get_viewangles();
vec3_t target_pos = entity.get_bone_pos( i );
auto angle = calc_aim( local_eye, target_pos, local_angles );
angle_normalize( angle );
auto this_dist = std::hypotf( angle.x, angle.y );
if ( best_dist > this_dist )
{
best_dist = this_dist;
aim_bone = i;
continue;
}
}
return aim_bone;
}
int find_target()
{
float best_fov = settings->aimbot.fov;
auto best_target = 0;
for ( int i = 1; i != 32; i++ )
{
c_player entity = c_player( i );
auto entity_bone_position = entity.get_bone_pos( get_nearest_bone( entity ) );
auto local_eye_pos = g_localplayer.get_local_eye();
auto distance = local_eye_pos.distance_to( entity_bone_position );
if ( !entity.address
|| entity.address == g_localplayer.address
|| entity.get_dormant()
|| entity.get_health() < 1
|| entity.get_team() == g_localplayer.get_team()
)
continue;
vec3_t local_angles = g_engine.get_viewangles();
vec3_t aim_angle = calc_aim( local_eye_pos, entity_bone_position, local_angles );
angle_normalize( aim_angle );
auto fov = std::hypotf( aim_angle.x, aim_angle.y ); //add distance based fov soon
if ( fov < best_fov )
{
best_fov = fov;
best_target = i;
}
}
return best_target;
}
void draw_filled_rect( int x, int y, int w, int h )
{
RECT rect = { x, y, x + w, y + h };
FillRect( hdc, &rect, EnemyBrush );
}
void draw_box( int x, int y, int w, int h, int thickness )
{
draw_filled_rect( x, y, w, thickness ); //Top horiz line
draw_filled_rect( x, y, thickness, h ); //Left vertical line
draw_filled_rect( (x + w), y, thickness, h ); //right vertical line
draw_filled_rect( x, y + h, w + thickness, thickness ); //bottom horiz line
}
Пока что грешу на аим или хендл процес , как это решить и что конкретно снижает траст не знаю
Всем привет Через 1-2 дня падает траст Extrnal Записи в память нету только чтение.
//rcs-independant smoothing?
Delta.x = aim_punch.x;
Delta.y = aim_punch.y;
angles.x -= Delta.x * settings->aimbot.rcs_x;
angles.y -= Delta.y * settings->aimbot.rcs_y + 0.04f;
angle_normalize( angles );
}
return angles;
}
bool world_to_screen( vec3_t pos, vec2_t& screen ) // converts 3D coords to 2D coords
{
float screen_width = (float)globals::res_x;
float screen_height = (float)globals::res_y;
float Matrix[16]; // [4][4]: 4*4 = 16
LI_FN( ReadProcessMemory ).forwarded_safe_cached()(globals::_handle, (PFLOAT)(globals::client + offsets::dwViewMatrix), &Matrix, sizeof( Matrix ), 0);
//Matrix-vector Product, multiplying world(eye) coordinates by projection matrix = clipCoords
vec4_t clipCoords;
clipCoords.x = pos.x * Matrix[0] + pos.y * Matrix[1] + pos.z * Matrix[2] + Matrix[3];
clipCoords.y = pos.x * Matrix[4] + pos.y * Matrix[5] + pos.z * Matrix[6] + Matrix[7];
clipCoords.z = pos.x * Matrix[8] + pos.y * Matrix[9] + pos.z * Matrix[10] + Matrix[11];
clipCoords.w = pos.x * Matrix[12] + pos.y * Matrix[13] + pos.z * Matrix[14] + Matrix[15];
if ( clipCoords.w < 0.1f ) // if the camera is behind our player don't draw, i think?
return false;
vec3_t NDC;
// Normalize our coords
NDC.x = clipCoords.x / clipCoords.w;
NDC.y = clipCoords.y / clipCoords.w;
NDC.z = clipCoords.z / clipCoords.w;
// Convert to window coords (x,y)
screen.x = (screen_width / 2 * NDC.x) + (NDC.x + screen_width / 2);
screen.y = -(screen_height / 2 * NDC.y) + (NDC.y + screen_height / 2);
return true;
}
int get_nearest_bone( c_player entity )
{
float best_dist = 360.f;
int aim_bone = 8;
std::vector<int> target_bones{ 8, 7, 6, 5, 3 };
for ( int i : target_bones )
{
vec3_t local_eye = g_localplayer.get_local_eye();
vec3_t local_angles = g_engine.get_viewangles();
vec3_t target_pos = entity.get_bone_pos( i );
auto angle = calc_aim( local_eye, target_pos, local_angles );
angle_normalize( angle );
auto this_dist = std::hypotf( angle.x, angle.y );
if ( best_dist > this_dist )
{
best_dist = this_dist;
aim_bone = i;
continue;
}
}
return aim_bone;
}
int find_target()
{
float best_fov = settings->aimbot.fov;
auto best_target = 0;
for ( int i = 1; i != 32; i++ )
{
c_player entity = c_player( i );
auto entity_bone_position = entity.get_bone_pos( get_nearest_bone( entity ) );
auto local_eye_pos = g_localplayer.get_local_eye();
auto distance = local_eye_pos.distance_to( entity_bone_position );
if ( !entity.address
|| entity.address == g_localplayer.address
|| entity.get_dormant()
|| entity.get_health() < 1
|| entity.get_team() == g_localplayer.get_team()
)
continue;
vec3_t local_angles = g_engine.get_viewangles();
vec3_t aim_angle = calc_aim( local_eye_pos, entity_bone_position, local_angles );
angle_normalize( aim_angle );
auto fov = std::hypotf( aim_angle.x, aim_angle.y ); //add distance based fov soon
if ( fov < best_fov )
{
best_fov = fov;
best_target = i;
}
}
return best_target;
}
void draw_filled_rect( int x, int y, int w, int h )
{
RECT rect = { x, y, x + w, y + h };
FillRect( hdc, &rect, EnemyBrush );
}
void draw_box( int x, int y, int w, int h, int thickness )
{
draw_filled_rect( x, y, w, thickness ); //Top horiz line
draw_filled_rect( x, y, thickness, h ); //Left vertical line
draw_filled_rect( (x + w), y, thickness, h ); //right vertical line
draw_filled_rect( x, y + h, w + thickness, thickness ); //bottom horiz line
}[/CODE]
Аим бот обходит все топ серверные анти читы (прекрасно там работает и Анти чит нечего не видит ) из этого считаю что какие то проверки вальве в том же мм должен обходить , с чем связано падение траст фактора не знаю , прошу помощи .В сурсе вырезал все функции требующие запись в память игры так же поменял саму память она нечего не записывает и не изменяет в памяти игры только читает , почему падает траст не понимаю уже просто нечему ибо 2 функции аим и вх
Пока что грешу на аим или хендл процес , как это решить и что конкретно снижает траст не знаю
Последнее редактирование: