Meta: Add files to repository
This commit is contained in:
parent
80a0428b66
commit
39198164cd
1029 changed files with 78311 additions and 0 deletions
28
System/Libraries/Function.HC
Normal file
28
System/Libraries/Function.HC
Normal file
|
@ -0,0 +1,28 @@
|
|||
U0 @function_insert_call(U32 from, U32 to)
|
||||
{
|
||||
*(from(U8*)) = 0xE8;
|
||||
*((from + 1)(I32*)) = to - from - 5;
|
||||
}
|
||||
|
||||
U0 @function_patch(U32 from, U32 to)
|
||||
{
|
||||
*(from(U8*)) = 0xE9;
|
||||
*((from + 1)(I32*)) = to - from - 5;
|
||||
}
|
||||
|
||||
class @function
|
||||
{
|
||||
U0(*InsertCall)
|
||||
(U32 from, U32 to);
|
||||
U0(*Patch)
|
||||
(U32 from, U32 to);
|
||||
};
|
||||
|
||||
@function Function;
|
||||
Function.InsertCall = &@function_insert_call;
|
||||
Function.Patch = &@function_patch;
|
||||
|
||||
// usage: Function.InsertCall(addr, &func);
|
||||
// usage: Function.Patch(&old_func, &new_func);
|
||||
|
||||
"function ";
|
Loading…
Add table
Add a link
Reference in a new issue