Skip to content

Use System C Function

Silver edited this page Aug 24, 2020 · 3 revisions

It is really very simple in OCRunner.

//you only need to add the C function declaration in Script.
//link NSLog
void NSLog(NSString *format, ...);

//then you can use it in Scrtips.
NSLog(@"test for link function %@", @"xixi");

You can run the code by changing the content of ViewController1 in OCRunnerDemo.

When you add this code in scripts. OCRunner will use ORSearchedFunction to search the pointer of function name. It's core is SymbolSearch (edit from fishhook).

If the searched result of function name is NULL,OCRunner will notice you in console like this:

|----------------------------------------------|
|❕you need add ⬇️ code in the application file |
|----------------------------------------------|
[ORSystemFunctionTable reg:@"dispatch_source_set_timer" pointer:&dispatch_source_set_timer];
-----------------------------------------------
Clone this wiki locally