Skip to content

Commit b03ba1f

Browse files
Add more info
1 parent a79c069 commit b03ba1f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/extra/advanced/modding-api/index.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
# MCPELauncher API Referenc
1+
# MCPELauncher API Reference
2+
3+
This document provides an overview of the MCPELauncher API, detailing the available symbols, their signatures, and descriptions. The API is designed for advanced modding and hooking functionalities in Minecraft Pocket Edition.
4+
5+
## Overview
6+
7+
The MCPELauncher API allows developers to hook into Minecraft's runtime, modify behavior, and manage dynamic libraries. It provides functions for logging, hooking symbols, patching memory, and handling dynamic libraries.
8+
9+
## Accessing the API
10+
11+
Use `dlopen("libmcpelauncher_mod.so", RTLD_NOW)` and `dlsym` to access the API. The symbols are defined in the `libmcpelauncher_mod.so` shared library.
12+
13+
Otherwise declare the symbols as weam `extern "C"` in your C++ code to avoid name mangling and allow the launcher to provide the implementations.
14+
15+
```c++
16+
extern "C" {
17+
__attribute__((weak)) void* mcpelauncher_hook(void* sym, void* hook, void** orig);
18+
__attribute__((weak)) void* mcpelauncher_hook2(void* lib, const char* sym, void* hook, void** orig);
19+
// ... other symbols
20+
}
21+
```
22+
223
## Logging Functions
324
425
| Symbol | Description | Notes |

0 commit comments

Comments
 (0)