AntiFishhook is an AntiHook library for fishhook
at runtime (make fishhook doesn't work) .
include fishhook
and anti-fishhook
Run or test in your phone(arm64) instend of simulator
Swift Function name mangling
import antiFishhook
resetSymbol("$s10Foundation5NSLogyySS_s7CVarArg_pdtF") // Swift's Foudation.NSLog
NSLog("Hello AntiFishHook")
resetSymbol("printf") // printf
printf("Hello AntiFishHook")
#include "antiFishhook-Swift.h"
+ (void)antiFishhook {
resetSymbol(@"$s10Foundation5NSLogyySS_s7CVarArg_pdtF"); // Swift's Foudation.NSLog
resetSymbol(@"printf"); // printf
}
typealias MyNSLog = @convention(thin) (_ format: String, _ args: CVarArg...) -> Void
func myNSLog(_ format: String, _ args: CVarArg...) {
print("Hello fishHook")
}
let selfNSLog: MyNSLog = myNSLog
let selfNSLogPointer = unsafeBitCast(selfNSLog, to: UnsafeMutableRawPointer.self)
var origNSLogPointer: UnsafeMutableRawPointer?
replaceSymbol("$s10Foundation5NSLogyySS_s7CVarArg_pdtF", newMethod: selfNSLogPointer, oldMethod: &origNSLogPointer)
NSLog("Hello World")
// will print Hello fishHook
Use by adding source file to your project instend of pod