Skip to content

Commit 5c4a5b2

Browse files
committed
fix: remove additional lines
1 parent 6ab20c5 commit 5c4a5b2

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

content/6.plugins/3.polyhook/3.guide.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ This guide covers:
1616
- Inspecting and modifying function arguments and return values
1717
- Unhooking and managing callbacks
1818

19-
---
20-
2119
## Basic Concepts
2220

2321
### What is a Hook?
@@ -33,8 +31,6 @@ A **hook** is a method to intercept function calls. You can:
3331
- `HookDetour`: Hooks a standalone or static function.
3432
- `HookVirtual`: Hooks a class method via vtable index or function pointer.
3533

36-
---
37-
3834
## Data Types
3935

4036
Use `DataType` enum to describe argument and return types:
@@ -49,8 +45,6 @@ enum class DataType : uint8_t {
4945
5046
Use these consistently when describing function signatures to the hook APIs.
5147
52-
---
53-
5448
## Hooking Functions
5549
5650
### 1. Detour Hook
@@ -74,8 +68,6 @@ plg::vector<DataType> args = { DataType::Int32, DataType::Pointer };
7468
Callback* cb = HookDetour(targetFunc, DataType::Void, args, -1);
7569
```
7670
77-
---
78-
7971
### 2. Virtual Hook (by index)
8072
8173
Hook a method from an object’s vtable:
@@ -100,8 +92,6 @@ int index = GetVTableIndex((void*) &MyClass::MyMethod);
10092
Getting the vtable index requires knowledge of the class layout and may not be portable across different compilers or platforms. Use with caution, works only if using C++ or C-like languages.
10193
::
10294

103-
---
104-
10595
### 3. Virtual Hook (by function pointer)
10696

10797
Instead of using vtable index:
@@ -110,8 +100,6 @@ Instead of using vtable index:
110100
Callback* HookVirtualByFunc(void* pClass, void* pFunc, DataType returnType, const vector<DataType>& args, int varIndex);
111101
```
112102
113-
---
114-
115103
## Unhooking
116104
117105
- `UnhookDetour(void* pFunc)`
@@ -120,8 +108,6 @@ Callback* HookVirtualByFunc(void* pClass, void* pFunc, DataType returnType, cons
120108
- `UnhookAll()` – removes all hooks
121109
- `UnhookAllVirtual(void* pClass)` – removes all vtable hooks for a class
122110
123-
---
124-
125111
## Callback System
126112
127113
### 1. Register Callback
@@ -152,8 +138,6 @@ enum class ReturnAction : int32_t {
152138
};
153139
```
154140

155-
---
156-
157141
## Access Arguments & Return
158142

159143
### Getting arguments:
@@ -183,8 +167,6 @@ SetReturnFloat(ret, 1.0f);
183167
return ReturnAction::Supercede;
184168
```
185169
186-
---
187-
188170
## Full Example
189171
190172
Hook `int Add(int a, int b)` and modify result:
@@ -211,17 +193,13 @@ void setup() {
211193
}
212194
```
213195

214-
---
215-
216196
## Utility Functions
217197

218198
- `FindDetour`, `FindVirtual`, `FindVirtualByFunc`: Lookup hooks
219199
- `AreCallbacksRegistered`, `IsCallbackRegistered`: Introspection
220200
- `GetFunctionAddr`: Get function pointer (possibly detoured)
221201
- `GetOriginalAddr`: Get trampoline/original function
222202

223-
---
224-
225203
## Summary
226204

227205
:read-more{title="Polyhook Header" to="https://github.com/untrustedmodders/plugify-source-2/blob/main/plugify/polyhook.hpp"}
@@ -237,6 +215,4 @@ void setup() {
237215
| Unhook | `UnhookDetour`, `UnhookVirtual`, etc. |
238216
| Get Addresses | `GetFunctionAddr`, `GetOriginalAddr` |
239217

240-
---
241-
242218
Use this guide as a reference when developing with your PolyHook-based plugin. Always validate pointer arguments and ensure type safety when casting arguments or return values.

content/6.plugins/4.dyncall/3.guide.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ This guide covers:
1616
- Invoking the function
1717
- Handling return values
1818

19-
---
20-
2119
## Step-by-Step Example
2220

2321
Let's say you want to dynamically call this function:
@@ -65,8 +63,6 @@ double result = dyncall::CallDouble(vm, func_ptr);
6563
printf("Result: %f\n", result); // Result: 5.5
6664
```
6765
68-
---
69-
7066
## Other Argument Types
7167
7268
Here’s a summary of how to push different argument types:
@@ -80,8 +76,6 @@ Here’s a summary of how to push different argument types:
8076
| `void*` | `dyncall::ArgPointer(...)` | `dyncall::CallPointer(...)` |
8177
| `char*` | `dyncall::ArgString(...)` | `dyncall::CallString(...)` |
8278
83-
---
84-
8579
## Cleanup
8680
8781
Free the call VM after use:
@@ -90,8 +84,6 @@ Free the call VM after use:
9084
dyncall::Free(vm);
9185
```
9286

93-
---
94-
9587
## Advanced: Calling from Low-Level Language
9688

9789
Suppose the function is:
@@ -143,8 +135,6 @@ dc.Free(vm)
143135

144136
Example taken from [here](https://github.com/fr0nch/CustomRounds-Weapons/blob/7d0eb45c4a25549ab0d8c6acb31e9aa3bfde1226/src/cr_weapons.py#L252)
145137

146-
---
147-
148138
## Signature Format (Used in `dyncallback`, `dynload`)
149139

150140
Signature strings follow this format (from `dyncall_signature.h`):
@@ -162,17 +152,13 @@ Signature strings follow this format (from `dyncall_signature.h`):
162152
| `p` | pointer |
163153
| `s` | string |
164154

165-
---
166-
167155
## Notes & Safety
168156

169157
- Argument order matters: they must match the function signature exactly.
170158
- If the function uses `stdcall`, `fastcall`, or others, set `dyncall::Mode()` accordingly (e.g., `dyncall::Mode::StdCall`).
171159
- Use `dyncall::Reset()` before each call to reuse the VM.
172160
- Behavior is undefined if the wrong type is passed.
173161

174-
---
175-
176162
## Minimal Complete Example
177163

178164
```c++
@@ -198,8 +184,6 @@ int main() {
198184
}
199185
```
200186
201-
---
202-
203187
## See Also
204188
205189
- [dyncall GitHub](https://github.com/dyncall/dyncall)

0 commit comments

Comments
 (0)