Skip to content

Commit 19d5d26

Browse files
authored
Fix typo in function-hooking.md
1 parent 52c2b21 commit 19d5d26

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/plugin-development/function-hooking.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
Function hooking refers to the concept of modifying the behavior/logic function in another executable through inserting bits of code to yield control to some *other* function; enabling the development of patches both big and small to already compiled code.
44

5-
There are two main types of function hooks we use: Replacement and Inline. Replacement hooks are simpler than inline hooks, allowing us replace a funtion entirely while retaining the ability to **call the original function that we replaced**. These hooks are often used when we either want to completely replace/reimplement a function, or meddle with the arguments passed to it before yielding control back to the game.
5+
There are two main types of function hooks we use: Replacement and Inline. Replacement hooks are simpler than inline hooks, allowing us to replace a function entirely while retaining the ability to **call the original function that we replaced**. These hooks are often used when we either want to completely replace/reimplement a function, or meddle with the arguments passed to it before yielding control back to the game.
66

7-
This graphic, courtesy of the Super Smash Bros. Ultimate modding scene, should help demonstrate visusally what we mean by this.
7+
This graphic, courtesy of the Super Smash Bros. Ultimate modding scene, should help demonstrate visually what we mean by this.
88

99
![Diagram depicting a function replacement hook](../assets/replacement-hook-example.svg)
1010

1111
In this example, our code runs first, as the call to the original function (denoted by the invokation of the `original!` macro) occurs at the end of the hook.
1212

1313
Inline hooks work quite a bit differently from replacement hooks. They allow us to just insert our own code right *in the middle* of an existing function, removing the need to reimplement all the logic ourselves. Inline hooks are typically used to grab or quickly change the contents of a local variable or register at *just* the right moment. Here's another graphic for clarity:
1414

15-
![Diagram depicting an inline hook](../assets/inline-hook-example.svg)
15+
16+
![Diagram depicting an inline hook](../assets/inline-hook-example.svg)

0 commit comments

Comments
 (0)