Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 524 Bytes

README.md

File metadata and controls

17 lines (14 loc) · 524 Bytes

HookMacros

Swift 5.9 function hooking macros

#hookf(target: socket, closure: { (x0: Int32, x1: Int32, x2: Int32, socketOrig: (@convention(c) (Int32, Int32, Int32) -> Int32)) -> Int32 in
    let orig_ = socketOrig(x0, x1, x2)
    print("orig:", orig_)
    return 0
})

#hook(cls: "NSObject", sel: "isProxy", imp: { (cls: NSObject, _cmd: Selector, orig: (@convention(c) (NSObject, Selector) -> Bool)) -> Bool in
    print("orig:", orig(cls, _cmd))
    return true
})

Check out HookMacrosClient for examples.