Repository navigation
fix(blob): resolve ordinal imports for named IAT hooks - #4
Merged
Merged
Conversation
Co-Authored-By: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLOB imports loaded by ordinal were resolved into the IAT but omitted from the import registry. As a result,
BlobHasImportEx(blob, "wsock32.dll", "select")andBlobIATHookcould not findselectin old GoldSrc engines, andBlobHasImportcould miss a DLL imported only by ordinal.Record both named and ordinal imports together with their original resolved export address. For ordinal entries, resolve the requested function name against the same DLL and compare it with the retained address. Matching continues to work after another hook has overwritten the IAT slot. Named-import matching retains its existing behavior; no hardcoded ordinal or public API change is needed.
Adds a regression test using the real BLOB loader, an encrypted in-memory fixture, and real Win32 named/ordinal exports. Only unused host services and the hook allocation sink are stubbed. It covers ordinal-only DLL discovery, named lookup, the selected IAT slot, misses, lookup after hooking, restoration, and the existing named-import path.
Validation:
MetaHookandMetaHook_blobpassed.selecthook installed, the network worker exited cooperatively before resource cleanup, and the process returned 0. Temporary game files/configuration were restored.git diff --checkpassed.Completes the BLOB loader dependency documented in MetaHookSv/ThreadGuard#5, for MetaHookSv/ThreadGuard#4. This launcher fix must be shipped for that plugin's BLOB support.