From 7e500aaab375992e3f927e14e03e28fd5e1b1215 Mon Sep 17 00:00:00 2001 From: drof Date: Sat, 7 Nov 2026 20:23:37 +0000 Subject: [PATCH] Dateien nach "/" hochladen --- esp.cpp | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++ features.cpp | 1 + glow.cpp | 33 ++++++++++++++ math.cpp | 66 ++++++++++++++++++++++++++++ movement.cpp | 48 +++++++++++++++++++++ 5 files changed, 267 insertions(+) create mode 100644 esp.cpp create mode 100644 features.cpp create mode 100644 glow.cpp create mode 100644 math.cpp create mode 100644 movement.cpp diff --git a/esp.cpp b/esp.cpp new file mode 100644 index 0000000..609245b --- /dev/null +++ b/esp.cpp @@ -0,0 +1,119 @@ +#include "inc/include.h" + +void draw_bar(Context* pctx, int r, int g, int b, int a, + float flX, float flY, float flW, float flH, + int current, const int max, + bool bg = true) +{ + if (current < 0) + current = 0; + + if (current > max) + current = max; + + flY -= flH; + + const float base = flH / static_cast(max) * static_cast(current); + const float delta = (flH - base); + + const float bar_x = flX; + + if (bg) + { + render::draw_set_color(pctx, 5, 5, 5, 255); + render::draw_filled_rect(pctx, bar_x, flY, bar_x + xf(0x40A00000), flY + flH); + } + render::draw_set_color(pctx, r, g, b, a); + render::draw_filled_rect(pctx, bar_x, flY + delta, bar_x + xf(0x40A00000), flY + flH); + + if (bg) + { + render::draw_set_color(pctx, 5, 5, 5, 255); + render::draw_outlined_rect(pctx, bar_x, flY, bar_x + xf(0x40A00000), flY + flH); + } +} + +void esp_process_object(Context* pctx, CachedEntity* prec) +{ + if(prec->signifier == 0x726579616c70 && prec->is_ally == true) + return; + + if(prec->dist_to_local >= xf(0x4C189680)) + return; + + if(!prec->rpts_avail) + return; + + auto& rpts = prec->rpts; + + render::draw_set_color(pctx, 5, 5, 5, 255); + render::draw_outlined_rect(pctx, rpts.x - xf(0x3F800000), rpts.y - xf(0x3F800000), rpts.x + rpts.w + xf(0x3F800000), rpts.y + rpts.h + xf(0x3F800000)); + render::draw_set_color(pctx, 65, 65, 255, 255); + render::draw_outlined_rect(pctx, rpts.x, rpts.y, rpts.x + rpts.w, rpts.y + rpts.h); + render::draw_set_color(pctx, 5, 5, 5, 255); + render::draw_outlined_rect(pctx, rpts.x + xf(0x3F800000), rpts.y + xf(0x3F800000), rpts.x + rpts.w - xf(0x3F800000), rpts.y + rpts.h - xf(0x3F800000)); + + draw_bar( pctx, 65, 255, 65, 255, + rpts.x - ((xf(0x41200000) / xf(0x40000000)) + xf(0x40000000)), + rpts.y + rpts.h, rpts.w, rpts.h, + prec->health, 100); + + int push_y = 0; + const auto draw_pos_top_x = prec->draw_pos_top[0]; + const auto draw_pos_top_y = prec->draw_pos_top[1]; + + if (prec->signifier == 0x726579616c70) + { + if (prec->name != nullptr) + { + pctx->pfn_draw_colored_text(*pctx->mss_ptr, 2, 12, + draw_pos_top_x, + draw_pos_top_y - push_y, + 255, 255, 255, 255, + 0, prec->name); + push_y += 15; + } + + pctx->pfn_draw_colored_text(*pctx->mss_ptr, 2, 12, + draw_pos_top_x, + draw_pos_top_y - push_y, + 255, 255, 255, 255, + 0, "%iLVL", prec->level); + push_y += 14; + } + + pctx->pfn_draw_colored_text(*pctx->mss_ptr, 2, 12, + draw_pos_top_x, + draw_pos_top_y - push_y, + 255, 255, 255, 255, + 0, "[%.0f m]", + prec->dist_to_local / xf(0x47C35000)); + push_y += 14; +} + +void features::esp_tick(Context* pctx) +{ + +} + +void features::esp(Context* pctx) +{ + auto me = r5::local_player(pctx); + if(!me.is_valid()) + return; + + if(!me.is_alive()) + return; + + u64 entlist_base = pctx->game_base + OFF_ENTITY_LIST; + + for(size_t i = 0ull; i < pctx->state.highest_eidx; i++) + { + auto rec = &pctx->state.entity_cache[ i ]; + + if(rec->is_valid == false) + continue; + + esp_process_object( pctx, rec ); + } +} diff --git a/features.cpp b/features.cpp new file mode 100644 index 0000000..1a8ff14 --- /dev/null +++ b/features.cpp @@ -0,0 +1 @@ +#include "inc/include.h" diff --git a/glow.cpp b/glow.cpp new file mode 100644 index 0000000..9cd5f74 --- /dev/null +++ b/glow.cpp @@ -0,0 +1,33 @@ +#include "inc/include.h" + +void features::glow(Context* pctx) +{ + auto me = r5::local_player(pctx); + u64 entlist_base = pctx->game_base + OFF_ENTITY_LIST; + + for(size_t i = 0ull; i < 128; i++) + { + auto rec = reinterpret_cast( entlist_base + (i * sizeof(EntityRecord)) ); + if(rec->ptr != 0ull && rec->ptr != me.base()) + { + auto entity = rec->ptr; + auto entity_obj= Entity(entity); + if(PLAYER__IS_ALIVE(entity) && !entity_obj.is_ally_of(pctx, me)) + { + u64 signifier_base = *(u64*)(entity + 0x478); + if(signifier_base != 0ull) + { + u64 entity_type = *(u64*)(signifier_base); + if(entity_type == 0x6d6d75645f63706e || entity_type == 0x726579616c70) + { + *(int*)(entity + 0x28C) = 0; + *(int*)(entity + 0x26C) = 7; + *(int*)(entity + 0x29C) = -213; + *(int*)(entity + 0x278) = -1082130432; + *(u32*)(entity + 0x264) = 0x46000000; + } + } + } + } + } +} diff --git a/math.cpp b/math.cpp new file mode 100644 index 0000000..0fa9a29 --- /dev/null +++ b/math.cpp @@ -0,0 +1,66 @@ +#include "inc/include.h" + +bool math::setup_render_points(Context* ctx, const matrix3x4 &coord_frame, const Vector3D &mins, const Vector3D &maxs, render_points_t &out) +{ + const int num_transformations = 8; + + Vector3D transformed[num_transformations]; + Vector3D points[num_transformations] = { + {mins.x, mins.y, mins.z}, + {mins.x, maxs.y, mins.z}, + {maxs.x, maxs.y, mins.z}, + {maxs.x, mins.y, mins.z}, + {mins.x, maxs.y, maxs.z}, + {mins.x, mins.y, maxs.z}, + {maxs.x, mins.y, maxs.z}}; + + for (int i = 0; i < num_transformations; i++) + { + vector_transform(points[i], coord_frame, transformed[i]); + } + + Vector3D flb{}, brt{}, blb{}, frt{}, frb{}, brb{}, blt{}, flt{}; + if (!render::w2s(ctx, transformed[3], &flb) || !render::w2s(ctx, transformed[5], &brt) || + !render::w2s(ctx,transformed[0], &blb) || !render::w2s(ctx,transformed[4], &frt) || + !render::w2s(ctx,transformed[2], &frb) || !render::w2s(ctx,transformed[1], &brb) || + !render::w2s(ctx,transformed[6], &blt) || !render::w2s(ctx,transformed[7], &flt)) + { + return false; + } + Vector3D position_array[num_transformations] = {flb, brt, blb, frt, frb, brb, blt, flt}; + + float left = flb.x; + float top = flb.y; + float right = flb.x; + float bottom = flb.y; + + for (auto &index : position_array) + { + if (left > index.x) + { + left = index.x; + } + + if (right < index.x) + { + right = index.x; + } + + if (top < index.y) + { + top = index.y; + } + + if (bottom > index.y) + { + bottom = index.y; + } + } + + out.x = left; + out.y = bottom; + out.w = (right - left); + out.h = (top - bottom); + + return true; +} diff --git a/movement.cpp b/movement.cpp new file mode 100644 index 0000000..fdb3818 --- /dev/null +++ b/movement.cpp @@ -0,0 +1,48 @@ +#include "inc/include.h" + +void features::movement(Context* pctx) +{ + float time_base = r5::cur_time(pctx); + float trav_progress = *(float*)(pctx->me + OFF_TRAVERSAL_PROGRESS); + float trav_time_start = *(float*)(pctx->me + OFF_TRAVERSAL_START_TIME); + + auto sgctx = &pctx->state.sgctx; + + switch(sgctx->state) + { + case SUPERGLIDE_STATE_IDLE: + if( (time_base - trav_time_start) < xf(0x3E4CCCCD)) + { + sgctx->state = SUPERGLIDE_STATE_STARTED; + sgctx->last = time_base; + } + + break; + case SUPERGLIDE_STATE_STARTED: + if(sgctx->force_duck) + { + pctx->state.in_duck.tap(); + pctx->state.in_jump.tap(); + sgctx->force_duck = 0; + sgctx->force_reset = 1; + return; + } + + if(sgctx->force_reset) + { + sgctx->force_reset = 0; + sgctx->state = SUPERGLIDE_STATE_IDLE; + return; + } + + if(trav_progress >= xf(0x3F666666)) + { + pctx->state.in_jump.tap(); + sgctx->force_duck = 1; + } + + break; + default: + break; + } +}