Go: Native escape hatch¶
Functions¶
NativeEnabledNow¶
| Go | |
|---|---|
NativeEnabledNow reports whether the host answers the native calls, which its config.json decides.
- Return type:
bool
NativeSymbol¶
| Go | |
|---|---|
NativeSymbol is the address of an engine function by its decorated symbol name.
- Parameters:
- symbol :
string
- symbol :
- Return type:
(unsafe.Pointer, error)
NativeSignature¶
| Go | |
|---|---|
NativeSignature is the first match of a byte pattern such as "48 8B ?? 08" in the engine executable.
- Parameters:
- pattern :
string
- pattern :
- Return type:
(unsafe.Pointer, error)
NativeExport¶
| Go | |
|---|---|
NativeExport is an export of a module already loaded into the process; an empty module names the engine executable. LeviLamina's API is an export of LeviLamina.dll.
- Parameters:
- module :
string - name :
string
- module :
- Return type:
(unsafe.Pointer, error)
NativeObjectOf¶
| Go | |
|---|---|
NativeObjectOf is the address of one engine service object.
- Parameters:
- kind :
NativeObjectKind
- kind :
- Return type:
(unsafe.Pointer, error)
NativePlayerOf¶
| Go | |
|---|---|
NativePlayerOf is the engine's Player object of an online player, valid while the player stays online.
- Parameters:
- p :
Player
- p :
- Return type:
(unsafe.Pointer, error)
NativeActorOf¶
| Go | |
|---|---|
NativeActorOf is the engine's Actor object of a loaded actor.
- Parameters:
- id :
ActorID
- id :
- Return type:
(unsafe.Pointer, error)
NativeDimensionOf¶
| Go | |
|---|---|
NativeDimensionOf is the engine's Dimension object of a dimension id.
- Parameters:
- dim :
int32
- dim :
- Return type:
(unsafe.Pointer, error)
NativeBlockSourceOf¶
| Go | |
|---|---|
NativeBlockSourceOf is the engine's BlockSource of a dimension id.
- Parameters:
- dim :
int32
- dim :
- Return type:
(unsafe.Pointer, error)
InstallNativeHook¶
| Go | |
|---|---|
InstallNativeHook installs detour on target at a HookPriority value. detour must be a C function with the exact signature and calling convention of target, and it reaches the engine through Original only. The host removes a detour this mod still holds when the mod unloads, and does not wait for a call already inside it on another thread.
- Parameters:
- target :
unsafe.Pointer - detour :
unsafe.Pointer - priority :
int32
- target :
- Return type:
(NativeHook, error)
RemoveNativeHook¶
| Go | |
|---|---|
RemoveNativeHook removes a detour this mod installed.
- Parameters:
- h :
NativeHook
- h :
- Return type:
error
NativeError¶
NativeError is the answer of a native slot other than PIER_NATIVE_OK.
NativeError.Disabled¶
| Go | |
|---|---|
Disabled reports whether the host's config.json leaves native_detour off.
- Return type:
bool
NativeError.Error¶
| Go | |
|---|---|
- Return type:
string
NativeObjectKind¶
| Go | |
|---|---|
NativeObjectKind names one engine service object for NativeObjectOf.
| Name | Value | Description |
|---|---|---|
NativeMinecraft |
C.PIER_NATIVE_OBJ_MINECRAFT |
|
NativeLevel |
C.PIER_NATIVE_OBJ_LEVEL |
|
NativeServerNetworkHandler |
C.PIER_NATIVE_OBJ_SERVER_NETWORK_HANDLER |
|
NativeServerInstance |
C.PIER_NATIVE_OBJ_SERVER_INSTANCE |
|
NativeCommandRegistry |
C.PIER_NATIVE_OBJ_COMMAND_REGISTRY |
|
NativeNetworkSystem |
C.PIER_NATIVE_OBJ_NETWORK_SYSTEM |
|
NativeDBStorage |
C.PIER_NATIVE_OBJ_DB_STORAGE |
|
NativeClientInstance |
C.PIER_NATIVE_OBJ_CLIENT_INSTANCE |
|
NativeMultiPlayerLevel |
C.PIER_NATIVE_OBJ_MULTIPLAYER_LEVEL |
NativeHook¶
NativeHook is one installed detour: the id RemoveNativeHook takes, and the address through which the detour calls the next detour or the engine.
HookPriority*¶
The priorities of ll::memory::HookPriority, for InstallNativeHook.
| Name | Value | Description |
|---|---|---|
HookPriorityHighest |
0 |
|
HookPriorityHigh |
100 |
|
HookPriorityNormal |
200 |
|
HookPriorityLow |
300 |
|
HookPriorityLowest |
400 |