mirror of
https://git.checksum.fail/alec/erythros
synced 2025-12-12 05:59:53 +02:00
Meta: Add files to repository
This commit is contained in:
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 ";
|
||||
Reference in New Issue
Block a user