Repository navigation
Cut startup time by batching hook setup - #31
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Read export tables from the loaded target image instead of trusting on-disk headers as proof of module identity. Treat zero RVAs as missing exports and fall back to GetProcAddress for forwarded exports or unreadable tables. Remove the unused disk export parser and module identity cache.
Check loader exchange, feature flag, memory query and hook transfer results. Log the failed operation, address, size and captured error code before throwing. Keep optional export-table reads eligible for fallback.
Split reads and writes for hook groups at each memory region boundary. Keep overlapping sites together across boundaries so later hooks observe the bytes produced by earlier hooks.
Retain prepared site patches until the entire caller block is uploaded and protected as executable. Publish the jumps only after preparation succeeds, preserving per-region patch transfers.
Check aggregate caller allocation arithmetic against DWORD and vector limits. Verify each relocated instruction sequence fits its caller slot with room for the final jump back before copying it.
Belonit
left a comment
There was a problem hiding this comment.
I’ve added a few adjustments for edge cases that are easy to miss in a normal game run. DLLs can change their exports in DllMain, and nearby hooks can cross memory-region boundaries, so resolving addresses from disk or combining writes can cause problems.
Since callers now share one allocation, a size miscalculation could also corrupt another hook. The extra checks stop setup and log failures, and jumps are only installed once the caller code is ready to execute.
Otherwise, everything looks good. Great job!
For each of the ~3k hooks (Ares, Phobos, spawner) it calls LoadLibrary/GetProcAddress inside the game through a breakpoint and a single step, then allocates, writes and protects memory separately for each hook site.
Changes
PatchCode, in the same order as before.Results
Time from Syringe start to the game window:
Single-page allocations in the game drop from 2,700 to 15, and the largest free address range grows from 1,221 MB to 1,389 MB.
Testing