summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-06 16:09:55 +0100
committersalmonik <salmonik@tuta.io>2026-11-06 16:09:55 +0100
commit33f5ed9ef58f26c6b3b52cf605dd4311d658a60d (patch)
treea97254872e465c9107b7ef19695ab56bb076d7e2 /Makefile
parentItems: log the usable ammo table once (diff)
downloadhl2h-33f5ed9ef58f26c6b3b52cf605dd4311d658a60d.tar.gz
hl2h-33f5ed9ef58f26c6b3b52cf605dd4311d658a60d.zip
Fix audit findings: crash safety, correctness, rendering, performance
Crash/UB: - gate every hook behind an init-stage flag until config/surface/input are ready - publish module maps as immutable atomic snapshots instead of reallocating shared vectors under unlocked readers - validate the %ebp walk in the RandomSeed/RandomFloat hooks against the stack - bounds-check every RecvTable/RecvProp/string dereference with module_range() - preserve the Itanium vtable header when cloning (client, CInput, model render, studio render) - reject negative usercmd sequence numbers; guard config_load against a null section target; cap the bone parent walk; check mprotect; drop PROT_EXEC on the GOT patch; absorb server.so .bss tail Correctness: - filter dormant entities across ESP, aimbot, triggerbot, melee, items and projectiles (slot self-tested against the local player) - reset the server-health latch per map and only latch on valid model indices - bone cache sized for the 128-target scan; set valid=false on every failure; head_position keeps searching past an invalid bone - vischeck steps past glass by probing until clear, and ignores entities owned by the target (held weapons, bone followers) - aimbot: maxs no longer disables it, AABB-aware FOV prefilter, lock hysteresis, lead point re-checked for FOV and visibility - spread: seed hook arms on the no-spread toggle alone; engine toggle only controls the RandomFloat zeroing - resolve m_hOwnerEntity/m_hOwner; NPC lead velocity from the server entity - vector_angles pitch range, point_ground normal test, underwater jump+duck no longer skips combat, semi-auto press/release edge for synthetic fire - item/projectile markers and blast rings refresh origin per frame while discovery stays at 10 Hz; trajectory uses the real m_DmgRadius and honours the blast-radius toggle Rendering/GUI: - one overlay draw per engine frame (FRAME_RENDER_START boundary), fixing alpha stacking and the speed-graph flicker - clipped lines/outlines and ellipsised text instead of drawing past the content pane or shifting over neighbours - dropdown dismissal consumes the click; hover ignores hidden controls - chams: reset AlphaModulate, reference shared materials once, restore prop tint colour; fonts created once per handle - projection uses Source's 4:3 aspect scaling and roll; screen size refreshed each frame; FOV circle gated on the aim toggles, not the bind Performance: - TTL caches for NPC relation, friendly/neutral and damage class - model names memoised per model index - entity pointer -> index cache for the triggerbot (was a 4096-slot walk/tick) Build: - real Makefile with -MMD dependency tracking, debug/release objects and an always-relink rule; build.sh kept as a thin wrapper
Diffstat (limited to '')
-rw-r--r--Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..12a6f92
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,60 @@
1# libhl2hake.so — 32-bit Source Engine plugin.
2#
3# make release build (build/release, -O2)
4# make debug build/debug with -O0 -g (symbolise crash addresses)
5# make clean
6#
7# Needs a 32-bit multilib toolchain (g++-multilib on Debian/Ubuntu).
8
9CXX ?= g++
10OUT := libhl2hake.so
11SRC := $(wildcard src/*.cpp)
12ODIR ?= build/release
13OPT ?= -O2
14
15CXXFLAGS := -m32 -std=c++17 -Wall -Wextra -Werror -fPIC \
16 -fvisibility=hidden -fno-omit-frame-pointer -pthread \
17 -MMD -MP $(OPT)
18LDFLAGS := -m32 -shared -pthread -Wl,--no-undefined
19LDLIBS := -ldl
20
21OBJ := $(patsubst src/%.cpp,$(ODIR)/%.o,$(SRC))
22DEP := $(OBJ:.o=.d)
23
24all: check $(OUT)
25 @file $(OUT)
26 @test -f assets/LiberationSans-Regular.ttf || \
27 echo "warning: assets/ is missing next to the .so; the overlay falls back to system fonts" >&2
28
29# Objects, dependency files and headers are handled by make itself; this only
30# keeps the debug build in its own directory.
31debug:
32 @$(MAKE) --no-print-directory ODIR=build/debug OPT="-O0 -g"
33
34# Always relink. Both configs write the same output file, so without this a
35# plain `make` after `make debug` would keep the debug binary (the .so is newer
36# than the release objects). Linking is sub-second.
37.PHONY: FORCE
38FORCE:
39
40$(OUT): $(OBJ) FORCE
41 $(CXX) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
42
43$(ODIR)/%.o: src/%.cpp | $(ODIR)
44 $(CXX) $(CXXFLAGS) -c $< -o $@
45
46$(ODIR):
47 @mkdir -p $@
48
49# Fail once with a usable message instead of a wall of compiler errors.
50.PHONY: check
51check:
52 @printf 'int main(){return 0;}\n' | \
53 $(CXX) -m32 -x c++ - -o /dev/null 2>/dev/null || \
54 { echo "error: $(CXX) cannot build 32-bit binaries; install g++-multilib" >&2; exit 1; }
55
56.PHONY: all debug clean
57clean:
58 rm -rf build $(OUT)
59
60-include $(DEP)