feat: add comprehensive xDL wrapper layer#1
Merged
HanSoBored merged 1 commit intomasterfrom Mar 30, 2026
Merged
Conversation
- Add generic xDL wrapper API (Phase 1/2/3) - Phase 1: Core Discovery (iterate, open, close, sym, dsym, get_lib_info) - Phase 2: Debug Introspection (addr_to_symbol, addr_to_symbol4, context management) - Phase 3: Advanced Features (open_from_phdr) - Fix thread safety with TLS (__thread) for basename buffer - Add parameter validation for all public APIs - Add 22 unit tests covering edge cases and functional tests - Update CMakeLists.txt and Makefile for new source file - Add test targets to Makefile (test, test-clean) Related: - Backlog: docs/internal/backlog/XDL_WRAPPER_ENHANCEMENT.md - Design: docs/internal/DS/XDL_WRAPPER_DESIGN.md - Review: docs/internal/review/XDL_WRAPPER_CODE_REVIEW.md
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.
Summary
This PR implements a comprehensive xDL wrapper layer that expands Android-Mem-Kit's dynamic linking capabilities from IL2CPP-only to a generic dynamic linking toolkit.
Changes
New Features
Phase 1: Core Discovery API
memkit_xdl_iterate()- Iterate all loaded shared librariesmemkit_xdl_open()/memkit_xdl_close()- Generic library handle managementmemkit_xdl_sym()/memkit_xdl_dsym()- Symbol resolution (.dynsym and .symtab)memkit_xdl_get_lib_info()- Get detailed library informationPhase 2: Debug Introspection API
memkit_xdl_addr_ctx_create()/memkit_xdl_addr_ctx_destroy()- Context managementmemkit_xdl_addr_to_symbol()- Address-to-symbol reverse lookupmemkit_xdl_addr_to_symbol4()- Address-to-symbol with flagsPhase 3: Advanced Features
memkit_xdl_open_from_phdr()- Create handle from dl_phdr_infoBug Fixes
__thread)memkit_xdl_iterate()Testing
Build System
CMakeLists.txtandMakefiletestandtest-cleantargetsFiles Changed
CMakeLists.txtMakefileinclude/memkit.hsrc/xdl_wrapper.ctests/xdl_wrapper_test.cTesting
�[1;37mTarget:�[0m
�[1;37m - ABI : arm64-v8a�[0m
�[1;37m - Platform : android-35�[0m
�[1;37mTest binary built successfully:�[0m build/arm64-v8a/lib/xdl_wrapper_test
�[1;33mNote:�[0m This is an Android binary. Push to device to run:
adb push build/arm64-v8a/lib/xdl_wrapper_test /data/local/tmp/
adb shell /data/local/tmp/xdl_wrapper_test
Related Documentation
Checklist