https://github.com/kynex7510/CTRDL
dl API implementation for the 3DS
https://github.com/kynex7510/CTRDL
3ds 3ds-homebrew
Last synced: about 1 month ago
JSON representation
dl API implementation for the 3DS
- Host: GitHub
- URL: https://github.com/kynex7510/CTRDL
- Owner: kynex7510
- License: mit
- Created: 2022-07-16T20:45:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-20T17:53:07.000Z (5 months ago)
- Last Synced: 2024-11-20T18:42:10.809Z (5 months ago)
- Topics: 3ds, 3ds-homebrew
- Language: C
- Homepage:
- Size: 124 KB
- Stars: 9
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CTRDL
Implementation of common `dl*` APIs, along with custom additions, which can be used for loading and executing ELF files on the Nintendo 3DS.
## Build
Download a [prebuilt](https://github.com/kynex7510/CTRDL/releases) version, use as a CMake dependency, or build manually:
```
cmake -B Build -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release
cmake --build Build --config Release
cmake --install Build --prefix Build/Release
```## Symbol resolution
Since all homebrew is statically linked by default, there's no way for a program to expose symbols to shared objects. This behaviour can be simulated by redeclaring `ctrdlProgramResolver`, which is called internally whenever a symbol has to be looked up in the program, or its dependencies. By default `ctrdlProgramResolver` returns `NULL`.
Additionally, a custom resolver can be passed to the extensions `ctrdlOpen`, `ctrdlFOpen`, `ctrdlMap`, which will be used at the relocation step, and which always precedes other lookup mechanisms (`dlsym` is not affected).
## Limitations
- `RTLD_LAZY`, `RTLD_DEEPBIND`, and `RTLD_NODELETE` are not supported.