First release

This commit is contained in:
√(noham)²
2025-10-23 21:41:46 +02:00
commit 5e98304b62
24 changed files with 1926 additions and 0 deletions

33
src/utils/MemoryUtils.h Normal file
View File

@@ -0,0 +1,33 @@
#import <Foundation/Foundation.h>
@interface MemoryUtils : NSObject
/**
* Hooks a function by symbol name with automatic fallback from symtbl_solve to symexp_solve.
*
* @param imageName The name of the image/library to search in (e.g., "QtNetwork").
* @param symbolName The mangled symbol name to hook.
* @param hookFunction The function to replace the original with.
* @param originalFunction Pointer to store the original function address.
* @param logPrefix Prefix for log messages (optional, can be nil).
* @return YES if the hook was successfully installed, NO otherwise.
*/
+ (BOOL)hookSymbol:(NSString *)imageName
symbolName:(NSString *)symbolName
hookFunction:(void *)hookFunction
originalFunction:(void **)originalFunction
logPrefix:(NSString *)logPrefix;
/**
* Hooks a function by symbol name with delay support.
*
* @param delayInSeconds The delay in seconds before installing the hook (use 0 for immediate hooking).
*/
+ (BOOL)hookSymbol:(NSString *)imageName
symbolName:(NSString *)symbolName
hookFunction:(void *)hookFunction
originalFunction:(void **)originalFunction
logPrefix:(NSString *)logPrefix
delayInSeconds:(NSTimeInterval)delayInSeconds;
@end