Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for weak tables that survive #73

Merged
merged 4 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ These don't matter except for other assembly patches
- hooks/aiinitattack.cpp

## Bugs
- Fix [problem described here](https://www.lua.org/bugs.html#5.0.2-5)
- hooks/weakgcmarkerFix.cpp
- Fix CUIWorldMesh:GetInterpolatedAlignedBox return table to properly store `ymax` and `zMax`
- hooks/FixGetInterpolatedAlignedBox.cpp
- Make `TestCommandCaps` test commands caps instead of toggle caps
Expand Down
41 changes: 41 additions & 0 deletions hooks/weakgcmarkerFix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include "../define.h"

asm(
"; arg_0 = 4;"
"; limit = 8;"
";.section h0; .set h0,0x00915A00 "
"; push ebp "
"; mov ebp, [esp+4+arg_0]"
"; push esi "
"; mov esi, eax "
"; mov eax, [esi]"
"; push edi "
"; xor edi, edi "
"; cmp eax, ebx "
"; jz short loc_915A3B "
";loc_915A11:"
"; mov cl, [eax+5]"
"; movzx edx, cl "
"; and edx, -7 " //the fixing line
"; cmp edx, [esp+0x0C+limit]"
"; jle short loc_915A27 "
"; and cl, 0x0FE "
"; mov [eax+5], cl "
"; mov esi, eax "
"; jmp short loc_915A35 "
";loc_915A27:"
"; mov ecx, [eax]"
"; mov [esi], ecx "
"; mov ecx, ebp "
"; add edi, 1 "
"; call 0x915950 "
";loc_915A35:"
"; mov eax, [esi]"
"; cmp eax, ebx "
"; jnz short loc_915A11 "
";loc_915A3B:"
"; mov eax, edi "
"; pop edi "
"; pop esi "
"; pop ebp "
"; ret ");