📦
4476 /agent/index.js.map
16230 /agent/index.js
1875 /agent/constants.js.map
5735 /agent/constants.js
219 /agent/include.js.map
95 /agent/include.js
6199 /agent/logger.js.map
5737 /agent/logger.js
4022 /agent/plugin/breaker/breaker.js.map
4136 /agent/plugin/breaker/breaker.js
169 /agent/plugin/breaker/include.js.map
22 /agent/plugin/breaker/include.js
44468 /agent/plugin/cipher/cipher.js.map
46889 /agent/plugin/cipher/cipher.js
468 /agent/plugin/exp/FTMobileSDK.js.map
411 /agent/plugin/exp/FTMobileSDK.js
701 /agent/plugin/exp/LuaNativeBridge.js.map
531 /agent/plugin/exp/LuaNativeBridge.js
553 /agent/plugin/exp/NEHASDK.js.map
882 /agent/plugin/exp/NEHASDK.js
891 /agent/plugin/exp/NSAlertController.js.map
751 /agent/plugin/exp/NSAlertController.js
1102 /agent/plugin/exp/NSFileManager.js.map
857 /agent/plugin/exp/NSFileManager.js
639 /agent/plugin/exp/NSObject.js.map
564 /agent/plugin/exp/NSObject.js
1508 /agent/plugin/exp/NSProcessInfo.js.map
2872 /agent/plugin/exp/NSProcessInfo.js
4712 /agent/plugin/exp/SBIcon.js.map
4971 /agent/plugin/exp/SBIcon.js
897 /agent/plugin/exp/SpringBoard.js.map
993 /agent/plugin/exp/SpringBoard.js
1765 /agent/plugin/exp/UITextField.js.map
1632 /agent/plugin/exp/UITextField.js
814 /agent/plugin/exp/getenv.js.map
638 /agent/plugin/exp/getenv.js
410 /agent/plugin/exp/include.js.map
317 /agent/plugin/exp/include.js
834 /agent/plugin/exp/pthread_.js.map
716 /agent/plugin/exp/pthread_.js
193 /agent/plugin/foundation/include.js.map
44 /agent/plugin/foundation/include.js
357 /agent/plugin/foundation/nsbundle.js.map
266 /agent/plugin/foundation/nsbundle.js
950 /agent/plugin/foundation/nslog.js.map
914 /agent/plugin/foundation/nslog.js
2432 /agent/plugin/hooks/NSOperationQueue.js.map
2833 /agent/plugin/hooks/NSOperationQueue.js
2938 /agent/plugin/hooks/NSURLSession.js.map
6244 /agent/plugin/hooks/NSURLSession.js
9965 /agent/plugin/hooks/Socket.js.map
18067 /agent/plugin/hooks/Socket.js
798 /agent/plugin/hooks/UILabel.js.map
566 /agent/plugin/hooks/UILabel.js
2599 /agent/plugin/hooks/dialog.js.map
4749 /agent/plugin/hooks/dialog.js
12261 /agent/plugin/hooks/dump.js.map
10815 /agent/plugin/hooks/dump.js
7053 /agent/plugin/hooks/dyld.js.map
10049 /agent/plugin/hooks/dyld.js
2930 /agent/plugin/hooks/hooks.js.map
2813 /agent/plugin/hooks/hooks.js
360 /agent/plugin/hooks/include.js.map
233 /agent/plugin/hooks/include.js
1138 /agent/plugin/hooks/libdyld.js.map
1456 /agent/plugin/hooks/libdyld.js
1290 /agent/plugin/hooks/libobjc.js.map
2017 /agent/plugin/hooks/libobjc.js
370 /agent/plugin/include.js.map
299 /agent/plugin/include.js
187 /agent/plugin/info/include.js.map
39 /agent/plugin/info/include.js
18952 /agent/plugin/info/info.js.map
32880 /agent/plugin/info/info.js
2633 /agent/plugin/info/itor.js.map
2160 /agent/plugin/info/itor.js
1829 /agent/plugin/jailbreak/enum.js.map
7617 /agent/plugin/jailbreak/enum.js
14148 /agent/plugin/jailbreak/hooks.js.map
21890 /agent/plugin/jailbreak/hooks.js
234 /agent/plugin/jailbreak/include.js.map
82 /agent/plugin/jailbreak/include.js
146 /agent/plugin/jailbreak/jail.js.map
10 /agent/plugin/jailbreak/jail.js
953 /agent/plugin/jailbreak/thread.js.map
894 /agent/plugin/jailbreak/thread.js
191 /agent/plugin/lang/include.js.map
54 /agent/plugin/lang/include.js
5617 /agent/plugin/lang/oc/ViewController.js.map
10230 /agent/plugin/lang/oc/ViewController.js
3387 /agent/plugin/lang/oc/button.js.map
7057 /agent/plugin/lang/oc/button.js
642 /agent/plugin/lang/oc/clazz.js.map
671 /agent/plugin/lang/oc/clazz.js
278 /agent/plugin/lang/oc/include.js.map
141 /agent/plugin/lang/oc/include.js
365 /agent/plugin/lang/oc/method.js.map
225 /agent/plugin/lang/oc/method.js
19872 /agent/plugin/lang/oc/oc.js.map
24844 /agent/plugin/lang/oc/oc.js
177 /agent/plugin/lang/oc/types/include.js.map
26 /agent/plugin/lang/oc/types/include.js
9933 /agent/plugin/lang/oc/types/objc_method.js.map
13383 /agent/plugin/lang/oc/types/objc_method.js
172 /agent/plugin/lang/swift/include.js.map
19 /agent/plugin/lang/swift/include.js
147 /agent/plugin/lang/swift/main.js.map
10 /agent/plugin/lang/swift/main.js
15549 /agent/plugin/memory/findsvc.js.map
41077 /agent/plugin/memory/findsvc.js
168 /agent/plugin/memory/include.js.map
22 /agent/plugin/memory/include.js
169 /agent/plugin/service/include.js.map
19 /agent/plugin/service/include.js
2575 /agent/plugin/service/main.js.map
3163 /agent/plugin/service/main.js
510 /agent/runtime.js.map
403 /agent/runtime.js
131 /agent/types.js.map
10 /agent/types.js
33124 /agent/utils.js.map
34419 /agent/utils.js
✄
{"version":3,"file":"index.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AACrB,OAAO,aAAa,CAAA;AAKpB,8BAA8B;AAC9B,gDAAgD;AAEhD,gBAAgB;AAChB,oBAAoB;AAEpB,6BAA6B;AAC7B,6BAA6B;AAC7B,iCAAiC;AAEjC,gBAAgB;AAChB,qBAAqB;AACrB,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,kBAAkB;AAClB,uBAAuB;AACvB,kBAAkB;AAElB,aAAa;AAEb,cAAc;AAEd,aAAa;AACb,+HAA+H;AAC/H,+DAA+D;AAC/D,wCAAwC;AACxC,8CAA8C;AAC9C,uFAAuF;AACvF,KAAK;AACL,+BAA+B;AAG/B,+EAA+E;AAC/E,6GAA6G;AAC7G,sBAAsB;AACtB,+CAA+C;AAC/C,qDAAqD;AACrD,iDAAiD;AACjD,sGAAsG;AACtG,QAAQ;AACR,MAAM;AAEN,2CAA2C;AAC3C,sGAAsG;AACtG,sBAAsB;AACtB,+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tE,iCAAiC;AACjC,QAAQ;AACR,KAAK;AAEL,kEAAkE;AAClE,mHAAmH;AACnH,sBAAsB;AACtB,+CAA+C;AAC/C,oEAAoE;AACpE,SAAS;AACT,wBAAwB;AACxB,yEAAyE;AACzE,iCAAiC;AACjC,QAAQ;AACR,KAAK;AAEL,8CAA8C;AAC9C,+FAA+F;AAC/F,sBAAsB;AACtB,+CAA+C;AAC/C,gDAAgD;AAChD,SAAS;AACT,wBAAwB;AACxB,qDAAqD;AACrD,iFAAiF;AACjF,QAAQ;AACR,KAAK;AAGL,2EAA2E;AAC3E,iHAAiH;AACjH,sBAAsB;AACtB,+CAA+C;AAC/C,0EAA0E;AAC1E,SAAS;AACT,wBAAwB;AACxB,8EAA8E;AAC9E,iCAAiC;AACjC,QAAQ;AACR,KAAK;AAEL,sEAAsE;AACtE,uHAAuH;AACvH,sBAAsB;AACtB,+CAA+C;AAC/C,gFAAgF;AAChF,SAAS;AACT,wBAAwB;AACxB,qFAAqF;AACrF,QAAQ;AACR,KAAK;AAEL,0CAA0C;AAC1C,sBAAsB;AACtB,0CAA0C;AAC1C,SAAS;AACT,qBAAqB;AACrB,kDAAkD;AAClD,SAAS;AACT,KAAK"}
✄
import './include.js';
import './logger.js';
// logd(`PID:\t${Process.id}`)
// logd(`TID:\t${Process.getCurrentThreadId()}`)
// hook_strcmp()
// hook_all_detect()
// hook_dyld_get_image_name()
// hook_dyld_mod_init_funcs()
// hook_dyld_doModInitFunctions()
// hook_dlopen()
// hook_load_images()
// hook_getenv()
// hook_initialize()
// hook_load()
// hook_dispatch()
// hook_NSProcessInfo()
// hook_pthread_()
// showInfo()
// examples ↓ 
// OC replace
// const oc_src: ObjC.ObjectMethod = ObjC.classes["BCEUIAlertAction"]["- alertUserInMainThreadWithType:withMessage:withTitle:"]
// const newM = ObjC.implement(oc_src, (ins_, sel_, v, v1) => {
//     const ins = new ObjC.Object(ins_)
//     const sel = ObjC.selectorAsString(sel_)
//     console.warn(`-[BCEUIAlertAction alertUserInMainThreadWithType] ${ins} ${sel} `)
// })
// oc_src.implementation = newM
// // -[ISLanguageSetupController setLanguage:0x8dcc5b6d84ef5a86 specifier:0x0]
// Interceptor.attach(ObjC.classes["ISLanguageSetupController"]["- setLanguage:specifier:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         const value = new ObjC.Object(args[2])
//         logw(`\nCalled ISLanguageSetupController \n\t${ins} \n\t${sel} \n\tsetLanguage:'${value}'`)
//     }
// }) 
// FBProcessExecutionContext setDisableASLR
// Interceptor.attach(ObjC.classes["FBProcessExecutionContext"]["- setDisableASLR:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const value = args[2]
//         args[2] = ptr(1)
//         logw(`\nCalled setDisableASLR: ${ins} ${value}`)
//     }
// })
// // FBProcessExecutionContext - disableASLR
// Interceptor.attach(ObjC.classes["FBProcessExecutionContext"]["- disableASLR"].implementation, {
//     onEnter(args) {
//     },
//     onLeave(retval) {
//         logw(`\nCalled disableASLR: ${retval}`)
//         retval.replace(ptr(1))
//     }
// })
// // -[FBProcessExecutionContext setWatchdogProvider:0x2828c1760]
// Interceptor.attach(ObjC.classes["FBProcessExecutionContext"]["- setWatchdogProvider:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         const value = new ObjC.Object(args[2])
//         logw(`\nCalled FBProcessExecutionContext \n\t${ins} \n\t${sel} \n'${value}'`)
//         // args[2] = NULL
//         // [[[SBSceneWatchdogProvider alloc] init] initAsDisabled:true]
//         const newWdog = ObjC.classes["SBSceneWatchdogProvider"].alloc().init().initAsDisabled_(true)
//         args[2] = newWdog.handle
//     }
// }) 
// //  -[FBProcessExecutionContext setWaitForDebugger:0x0]
// Interceptor.attach(ObjC.classes["FBProcessExecutionContext"]["- setWaitForDebugger:"].implementation, {
//     onEnter: function (args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         const value = args[2]
//         logw(`\nCalled setWaitForDebugger: \n\t${ins} \n\t${sel} \n'${value}'`)
//         args[2] = ptr(1)
//     }
// })
// // -[LSApplicationProxy _initWithContext:0x16f41e6a0 bundleUnit:0x130 applicationRecord:0x281952580 bundleID:0x1ea2e1130 resolveAndDetach:0x1]
// Interceptor.attach(ObjC.classes.LSApplicationProxy["- _initWithContext:bundleUnit:applicationRecord:bundleID:resolveAndDetach:"].implementation, {
//     onEnter(args) {
//         logw(`\nCalled _initWithContext:bundleUnit:applicationRecord:bundleID:resolveAndDetach:`)
//         logw(`ins ${new ObjC.Object(args[0])}`)
//         // lfs(args[0])
//         // LSApplicationProxy ( 0x200d11ed8 ) -> LSBundleProxy ( 0x200d12ba8 ) -> LSResourceProxy ( 0x200d11e88 ) -> _LSQueryResult ( 0x200d12950 ) -> NSObject ( 0x200cfb260 )
//         // --- 0x200cfb288 & NSObject ---
//         // [ 0 ]   0x0 [ 0x282da1450 ] -> isa: | ObjC.Object <- class of LSApplicationProxy @ 0x200d11ed8
//         //         0x200d11eb0 -> LSApplicationProxy
//         // --- 0x200d11e60 & LSResourceProxy ---
//         // [ 0 ]   0x8 [ 0x282da1458 ] -> _localizedName: | object
//         //         null
//         // [ 1 ]   0x10 [ 0x282da1460 ] -> __boundIconInfo: | object
//         //         null
//         // --- 0x200d12b80 & LSBundleProxy ---
//         // [ 0 ]   0x18 [ 0x282da1468 ] -> _localizedShortName: | object
//         //         null
//         // [ 1 ]   0x20 [ 0x282da1470 ] -> _foundBackingBundle: | boolean
//         //         false
//         // [ 2 ]   0x21 [ 0x282da1471 ] -> _containerized: | boolean
//         //         false
//         // [ 3 ]   0x28 [ 0x282da1478 ] -> _bundleIdentifier: | object
//         //         null
//         // [ 4 ]   0x30 [ 0x282da1480 ] -> _bundleURL: | object
//         //         null
//         // [ 5 ]   0x38 [ 0x282da1488 ] -> _bundleExecutable: | object
//         //         null
//         // [ 6 ]   0x40 [ 0x282da1490 ] -> _bundleContainerURL: | object
//         //         null
//         // [ 7 ]   0x48 [ 0x282da1498 ] -> _bundleVersion: | object
//         //         null
//         // [ 8 ]   0x50 [ 0x282da14a0 ] -> _sdkVersion: | object
//         //         null
//         // [ 9 ]   0x58 [ 0x282da14a8 ] -> _signerIdentity: | object
//         //         null
//         // [ 10 ]  0x60 [ 0x282da14b0 ] -> _signerOrganization: | object
//         //         null
//         // [ 11 ]  0x68 [ 0x282da14b8 ] -> _cacheGUID: | object
//         //         null
//         // [ 12 ]  0x70 [ 0x282da14c0 ] -> _sequenceNumber: | object
//         //         0
//         // [ 13 ]  0x78 [ 0x282da14c8 ] -> _machOUUIDs: | object
//         //         null
//         // [ 14 ]  0x80 [ 0x282da14d0 ] -> _compatibilityState: | object
//         //         0
//         // [ 15 ]  0x88 [ 0x282da14d8 ] -> __infoDictionary: | object
//         //         null
//         // [ 16 ]  0x90 [ 0x282da14e0 ] -> __entitlements: | object
//         //         null
//         // [ 17 ]  0x98 [ 0x282da14e8 ] -> __environmentVariables: | object
//         //         null
//         // [ 18 ]  0xa0 [ 0x282da14f0 ] -> __validationToken: | object
//         //         null
//         // --- 0x200d11eb0 & LSApplicationProxy ---
//         // [ 0 ]   0xa8 [ 0x282da14f8 ] -> _deviceIdentifierVendorName: | object
//         //         null
//         // [ 1 ]   0xb0 [ 0x282da1500 ] -> _record: | object
//         //         null
//         // [ 2 ]   0xb8 [ 0x282da1508 ] -> _plugInKitPlugins: | object
//         //         null
//         // [ 3 ]   0xc0 [ 0x282da1510 ] -> _userInitiatedUninstall: | boolean
//         logw(`_initWithContext ${(args[2])}`)
//         logw(`bundleUnit ${(args[3])}`)
//         logw(`applicationRecord ${args[4]} ${new ObjC.Object(args[4])}`)
//         // m(args[4]) -> LSApplicationRecord
//         logw(`bundleID ${new ObjC.Object(args[5])}`)
//         logw(`resolveAndDetach ${(args[6])}`)
//     }
// })
// 拿到任意一个app的代理application对象
// ObjC.classes.LSApplicationProxy["applicationProxyForIdentifier:"]("com.apple.springboard")
// // -[SBSwitcherModifier loggingCategory]
// Interceptor.attach(ObjC.classes.SBSwitcherModifier["- loggingCategory"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled loggingCategory \n\t${ins} \n\t${sel}`)
//         printBacktrace(this.context)
//     }
// })
// // -[SBFluidSwitcherRootSwitcherModifier handleEvent:]
// Interceptor.attach(ObjC.classes.SBFluidSwitcherRootSwitcherModifier["- handleEvent:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled handleEvent: \n\t${ins} \n\t${sel} \n\t${new ObjC.Object(args[3])}`)
//        printBacktrace(this.context)
//     }
// })
// // -[SBMainWorkspace applicationProcessWillLaunch:0x14f135990]
// Interceptor.attach(ObjC.classes.SBMainWorkspace["- applicationProcessWillLaunch:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled applicationProcessWillLaunch: \n\t${ins} \n\t${sel}`)
//         printBacktrace(this.context)
//     }
// }) 
// // -[SBMainWorkspace applicationProcessDidExit:0x108f48430 withContext:0x281612380]
// Interceptor.attach(ObjC.classes.SBMainWorkspace["- applicationProcessDidExit:withContext:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled applicationProcessDidExit: \n\t${ins} \n\t${sel}`)
//         printBacktrace(this.context)
//     }
// })
// // -[FBProcess _notePendingExitForReason:0x1efac15d0]
// Interceptor.replace(ObjC.classes.FBProcess["- _notePendingExitForReason:"].implementation, new NativeCallback(function(a0,a1,a2){
//     logd(`called NOP _notePendingExitForReason: ${new ObjC.Object(a2)}`)
//     printBacktrace(this.context)
// }, 'void',['pointer','pointer','pointer']))
// -[FBSApplicationLibrary applicationsDidFailToInstall:0x281ca5f20]
// Interceptor.attach(ObjC.classes.FBSApplicationLibrary["- applicationsDidFailToInstall:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled applicationsDidFailToInstall: \n\t${ins} \n\t${sel} ${new ObjC.Object(args[2])}`)
//        printBacktrace(this.context)
//     }
// })
// _LSBundleIDValidationToken + supportsSecureCoding
// Interceptor.attach(ObjC.classes["_LSBundleIDValidationToken"]["+ supportsSecureCoding"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled supportsSecureCoding \n\t${ins} \n\t${sel}`)
//         printBacktrace(this.context)
//     },
//     onLeave(retval) {
//         logw(`\nReturned supportsSecureCoding \n\t${retval}`)
//         retval.replace(NULL)
//     }, 
// })
// -[MCInstallProfileViewController profileConnection:0x2825b2400 didFinishInstallationWithIdentifier:0x0 error:0x2805365b0]
// Interceptor.attach(ObjC.classes.MCInstallProfileViewController["- profileConnection:didFinishInstallationWithIdentifier:error:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const sel = ObjC.selectorAsString(args[1])
//         logw(`\nCalled profileConnection:didFinishInstallationWithIdentifier:error: \n\t${ins} \n\t${sel}`)
//         printBacktrace(this.context)
//     }
// })
// // // -[MCProfile isLocked]
// Interceptor.attach(ObjC.classes.MCProfile["- isLocked"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled isLocked ${ins}`)
//         printBacktrace(this.context)
//    },
//    onLeave(retval) {
//        logw(`\nReturned isLocked ${retval}`)
//    }
// })
// 0x1b690bdec
// new NativeFunction(ptr(0x1b690bdec), 'void', ['pointer', 'pointer', 'pointer', 'pointer'])(ptr(0x1ec0408c0), ptr(0x281ed4510), ptr(38), ptr(0))
// -[STTelephonyStateProvider setTelephonyDaemonRestartHandlerCanceled:0x0]
// Interceptor.attach(ObjC.classes.STTelephonyStateProvider["- setTelephonyDaemonRestartHandlerCanceled:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         const args2 = new ObjC.Object(args[2])
//         logw(`\nCalled setTelephonyDaemonRestartHandlerCanceled: \n\t${ins} ${args2}`)
//     }
// })
// // -[SBTelephonyManager _primarySubscriptionSlot]
// Interceptor.attach(ObjC.classes.SBTelephonyManager["- _primarySubscriptionSlot"].implementation, {
//     onEnter(args) {
//     },
//     onLeave(retval) {
//         logw(`\nReturned _primarySubscriptionSlot \n\t${retval}`)
//         logw(`${new ObjC.Object(retval)}`)
//     }
// })
// // -[MCProfile trustLevel]
// Interceptor.attach(ObjC.classes.MCProfile["- trustLevel"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled trustLevel ${ins}`)
//         printBacktrace(this.context)
//     },
//     onLeave(retval) {
//         logw(`\nReturned trustLevel \n\t${retval}`)
//     }
// })
// // -[STTelephonyStateProvider _handleTelephonyDaemonRestart]
// Interceptor.replace(ObjC.classes.STTelephonyStateProvider["- _handleTelephonyDaemonRestart"].implementation, new NativeCallback(function(a0,a1,a2){
//     logw(`\nCalled _handleTelephonyDaemonRestart \n\t${new ObjC.Object(a0)}`)
// }, 'void',['pointer','pointer','pointer']))
// // -[STTelephonyStateProvider isSIMPresentForSlot:0x2]
// Interceptor.attach(ObjC.classes.STTelephonyStateProvider["- isSIMPresentForSlot:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled isSIMPresentForSlot: \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturnedisSIMPresentForSlot: \n\t${retval}`)
//     }
// })
// // -[STTelephonySubscriptionInfo registrationStatus]
// Interceptor.attach(ObjC.classes.STTelephonySubscriptionInfo["- registrationStatus"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled registrationStatus \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturned registrationStatus \n\t${retval}`)
//         retval.replace(ptr(1))
//     }
// })
// // -[STTelephonySubscriptionInfo cellularRegistrationStatus]
// Interceptor.attach(ObjC.classes.STTelephonySubscriptionInfo["- cellularRegistrationStatus"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled cellularRegistrationStatus \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturned cellularRegistrationStatus \n\t${retval}`)
//         retval.replace(ptr(1))
//     }
// })
// // -[STTelephonySubscriptionInfo isPreferredForDataConnections]
// Interceptor.attach(ObjC.classes.STTelephonySubscriptionInfo["- isPreferredForDataConnections"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled isPreferredForDataConnections \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturned isPreferredForDataConnections \n\t${retval}`)
//         retval.replace(ptr(1))
//     }
// })
// // -[STTelephonySubscriptionInfo SIMStatus]
// Interceptor.attach(ObjC.classes.STTelephonySubscriptionInfo["- SIMStatus"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled SIMStatus \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturned SIMStatus \n\t${retval}`)
//         retval.replace(allocOCString("kCTSIMSupportSIMStatusNotReady").handle)
//     }
// })
// // -[MCProfileConnection mustInstallProfileNonInteractively:0x282d60380]
// Interceptor.attach(ObjC.classes.MCProfileConnection["- mustInstallProfileNonInteractively:"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled mustInstallProfileNonInteractively: \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturned mustInstallProfileNonInteractively \n\t${retval}`)
//         retval.replace(ptr(1))
//     }
// })
// // -[MCProfileConnection isProfileUIInstallationEffectivelyAllowed]
// Interceptor.attach(ObjC.classes.MCProfileConnection["- isProfileUIInstallationEffectivelyAllowed"].implementation, {
//     onEnter(args) {
//         const ins = new ObjC.Object(args[0])
//         logw(`\nCalled isProfileUIInstallationEffectivelyAllowed \n\t${ins}`)
//     },
//     onLeave(retval) {
//         logw(`\nReturned isProfileUIInstallationEffectivelyAllowed \n\t${retval}`)
//     }
// })
// ObjC.choose(ObjC.classes.PhoneService,{
//     onMatch(item) {
//         logw(`\nPhoneService: ${item}`)
//     },
//     onComplete() {
//         logw(`\nPhoneService: search complete`)
//     },
// })
✄
{"version":3,"file":"constants.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/constants.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,kDAAkD;AAClD,MAAM,CAAN,IAAY,IAkDT;AAlDH,WAAY,IAAI;IAEZ,8DAA8D;IAC9D,oBAAoB;IAEpB,4BAA4B;IAC5B,kDAAkD;IAClD,gCAAgC;IAEhC,6CAAqC,CAAA;IACrC,iCAAyB,CAAA;IACzB,+BAAuB,CAAA;IACvB,kCAA0B,CAAA;IAC1B,wCAAgC,CAAA;IAChC,2BAAmB,CAAA;IACnB,6BAAqB,CAAA;IACrB,kCAA0B,CAAA;IAC1B,qCAA6B,CAAA;IAC7B,yCAAiC,CAAA;IACjC,0CAAkC,CAAA;IAClC,gCAAwB,CAAA;IACxB,gCAAwB,CAAA;IACxB,oCAA4B,CAAA;IAC5B,8BAAsB,CAAA;IACtB,qCAA6B,CAAA;IAC7B,sCAA8B,CAAA;IAC9B,gCAAwB,CAAA;IACxB,uCAA+B,CAAA;IAC/B,0CAAkC,CAAA;IAClC,yCAAiC,CAAA;IACjC,+BAAuB,CAAA;IACvB,oCAA4B,CAAA;IAC5B,gCAAwB,CAAA;IACxB,gCAAwB,CAAA;IACxB,6BAAqB,CAAA;IACrB,mCAA2B,CAAA;IAC3B,8BAAsB,CAAA;IACtB,oCAA4B,CAAA;IAC5B,mCAA2B,CAAA;IAC3B,sCAA8B,CAAA;IAC9B,0CAAkC,CAAA;IAClC,mCAA2B,CAAA;IAC3B,6CAAqC,CAAA;IACrC,iDAAyC,CAAA;IACzC,uCAA+B,CAAA;IAC/B,4DAAoD,CAAA;IACpD,gEAAwD,CAAA;IACxD,gEAAwD,CAAA;IACxD,sDAA8C,CAAA;IAC9C,gCAAwB,CAAA;AAC1B,CAAC,EAlDS,IAAI,KAAJ,IAAI,QAkDb;AAED,uDAAuD;AACvD,uFAAuF;AACvF,0GAA0G;AAC1G,2CAA2C;AAC3C,2JAA2J;AAC3J,iHAAiH;AACjH,2CAA2C;AAC3C,8HAA8H;AAC9H,2CAA2C;AAC3C,0IAA0I;AAC1I,+EAA+E;AAC/E,+EAA+E;AAC/E,uEAAuE;AACvE,kHAAkH;AAClH,2CAA2C;AAC3C,oIAAoI;AACpI,4EAA4E;AAC5E,sGAAsG;AACtG,2CAA2C;AAC3C,qIAAqI;AACrI,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,KAAK;AAEL,MAAM,CAAN,IAAY,aAeX;AAfD,WAAY,aAAa;IACvB,qFAA0B,CAAA;IAC1B,6FAA0B,CAAA;IAC1B,uGAA+B,CAAA;IAC/B,+FAA2B,CAAA;IAC3B,6EAAkB,CAAA;IAClB,iFAAoB,CAAA;IACpB,uEAAe,CAAA;IACf,yFAAwB,CAAA;IACxB,+EAAmB,CAAA;IACnB,sFAAsB,CAAA;IACtB,wGAA+B,CAAA;IAC/B,8EAAkB,CAAA;IAClB,4EAAiB,CAAA;IACjB,oGAA6B,CAAA;AAC/B,CAAC,EAfW,aAAa,KAAb,aAAa,QAexB;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,qEAAqB,CAAA;IACrB,uEAAkB,CAAA;AACpB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB"}
✄
// constants used for Security Attributes etc.
// NSLog(@"kSecAttrService: %@", kSecAttrService);
export var kSec;
(function (kSec) {
    // To reference some of the constants, the had to be echoed to
    // get their values.
    // NSLog(@"Constants Dump");
    // NSLog(@"kSecAttrService: %@", kSecAttrService);
    // NSLog(@"End Constants Dump");
    kSec["kSecReturnAttributes"] = "r_Attributes";
    kSec["kSecReturnData"] = "r_Data";
    kSec["kSecReturnRef"] = "r_Ref";
    kSec["kSecMatchLimit"] = "m_Limit";
    kSec["kSecMatchLimitAll"] = "m_LimitAll";
    kSec["kSecClass"] = "class";
    kSec["kSecClassKey"] = "keys";
    kSec["kSecClassIdentity"] = "idnt";
    kSec["kSecClassCertificate"] = "cert";
    kSec["kSecClassGenericPassword"] = "genp";
    kSec["kSecClassInternetPassword"] = "inet";
    kSec["kSecAttrService"] = "svce";
    kSec["kSecAttrAccount"] = "acct";
    kSec["kSecAttrAccessGroup"] = "agrp";
    kSec["kSecAttrLabel"] = "labl";
    kSec["kSecAttrCreationDate"] = "cdat";
    kSec["kSecAttrAccessControl"] = "accc";
    kSec["kSecAttrGeneric"] = "gena";
    kSec["kSecAttrSynchronizable"] = "sync";
    kSec["kSecAttrSynchronizableAny"] = "syna";
    kSec["kSecAttrModificationDate"] = "mdat";
    kSec["kSecAttrServer"] = "srvr";
    kSec["kSecAttrDescription"] = "desc";
    kSec["kSecAttrComment"] = "icmt";
    kSec["kSecAttrCreator"] = "crtr";
    kSec["kSecAttrType"] = "type";
    kSec["kSecAttrScriptCode"] = "scrp";
    kSec["kSecAttrAlias"] = "alis";
    kSec["kSecAttrIsInvisible"] = "invi";
    kSec["kSecAttrIsNegative"] = "nega";
    kSec["kSecAttrHasCustomIcon"] = "cusi";
    kSec["kSecProtectedDataItemAttr"] = "prot";
    kSec["kSecAttrAccessible"] = "pdmn";
    kSec["kSecAttrAccessibleWhenUnlocked"] = "ak";
    kSec["kSecAttrAccessibleAfterFirstUnlock"] = "ck";
    kSec["kSecAttrAccessibleAlways"] = "dk";
    kSec["kSecAttrAccessibleWhenUnlockedThisDeviceOnly"] = "aku";
    kSec["kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly"] = "akpu";
    kSec["kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly"] = "cku";
    kSec["kSecAttrAccessibleAlwaysThisDeviceOnly"] = "dku";
    kSec["kSecValueData"] = "v_Data";
})(kSec || (kSec = {}));
// typedef NS_ENUM(NSUInteger, NSSearchPathDirectory) {
//     NSApplicationDirectory = 1,             // supported applications (Applications)
//     NSDemoApplicationDirectory,             // unsupported applications, demonstration versions (Demos)
// tslint:disable-next-line:max-line-length
//     NSDeveloperApplicationDirectory,        // developer applications (Developer/Applications). DEPRECATED - there is no one single Developer directory.
//     NSAdminApplicationDirectory,            // system and network administration applications (Administration)
// tslint:disable-next-line:max-line-length
//     NSLibraryDirectory,                     // various documentation, support, and configuration files, resources (Library)
// tslint:disable-next-line:max-line-length
//     NSDeveloperDirectory,                   // developer resources (Developer) DEPRECATED - there is no one single Developer directory.
//     NSUserDirectory,                        // user home directories (Users)
//     NSDocumentationDirectory,               // documentation (Documentation)
//     NSDocumentDirectory,                    // documents (Documents)
//     NSCoreServiceDirectory,                 // location of CoreServices directory (System/Library/CoreServices)
// tslint:disable-next-line:max-line-length
//     NSAutosavedInformationDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 11,   // location of autosaved documents (Documents/Autosaved)
//     NSDesktopDirectory = 12,                // location of user's desktop
//     NSCachesDirectory = 13,                 // location of discardable cache files (Library/Caches)
// tslint:disable-next-line:max-line-length
//     NSApplicationSupportDirectory = 14,     // location of application support files (plug-ins, etc) (Library/Application Support)
//
//     [... snip ...]
//
// };
export var NSSearchPaths;
(function (NSSearchPaths) {
    NSSearchPaths[NSSearchPaths["NSApplicationDirectory"] = 1] = "NSApplicationDirectory";
    NSSearchPaths[NSSearchPaths["NSDemoApplicationDirectory"] = 2] = "NSDemoApplicationDirectory";
    NSSearchPaths[NSSearchPaths["NSDeveloperApplicationDirectory"] = 3] = "NSDeveloperApplicationDirectory";
    NSSearchPaths[NSSearchPaths["NSAdminApplicationDirectory"] = 4] = "NSAdminApplicationDirectory";
    NSSearchPaths[NSSearchPaths["NSLibraryDirectory"] = 5] = "NSLibraryDirectory";
    NSSearchPaths[NSSearchPaths["NSDeveloperDirectory"] = 6] = "NSDeveloperDirectory";
    NSSearchPaths[NSSearchPaths["NSUserDirectory"] = 7] = "NSUserDirectory";
    NSSearchPaths[NSSearchPaths["NSDocumentationDirectory"] = 8] = "NSDocumentationDirectory";
    NSSearchPaths[NSSearchPaths["NSDocumentDirectory"] = 9] = "NSDocumentDirectory";
    NSSearchPaths[NSSearchPaths["NSCoreServiceDirectory"] = 10] = "NSCoreServiceDirectory";
    NSSearchPaths[NSSearchPaths["NSAutosavedInformationDirectory"] = 11] = "NSAutosavedInformationDirectory";
    NSSearchPaths[NSSearchPaths["NSDesktopDirectory"] = 12] = "NSDesktopDirectory";
    NSSearchPaths[NSSearchPaths["NSCachesDirectory"] = 13] = "NSCachesDirectory";
    NSSearchPaths[NSSearchPaths["NSApplicationSupportDirectory"] = 14] = "NSApplicationSupportDirectory";
})(NSSearchPaths || (NSSearchPaths = {}));
export const NSUserDomainMask = 1;
export const NSUTF8StringEncoding = 4;
export var BundleType;
(function (BundleType) {
    BundleType[BundleType["NSBundleFramework"] = 1] = "NSBundleFramework";
    BundleType[BundleType["NSBundleAllBundles"] = 2] = "NSBundleAllBundles";
})(BundleType || (BundleType = {}));
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/include.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,YAAY,CAAA;AACnB,OAAO,cAAc,CAAA;AAErB,OAAO,qBAAqB,CAAA"}
✄
import './logger.js';
import './utils.js';
import './runtime.js';
import './plugin/include.js';
✄
{"version":3,"file":"logger.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,yCAAS,CAAA;IAA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] = "C31";
    LogColor[LogColor["C32"] = 32] = "C32";
    LogColor[LogColor["C33"] = 33] = "C33";
    LogColor[LogColor["C34"] = 34] = "C34";
    LogColor[LogColor["C35"] = 35] = "C35";
    LogColor[LogColor["C36"] = 36] = "C36";
    LogColor[LogColor["C41"] = 41] = "C41";
    LogColor[LogColor["C42"] = 42] = "C42";
    LogColor[LogColor["C43"] = 43] = "C43";
    LogColor[LogColor["C44"] = 44] = "C44";
    LogColor[LogColor["C45"] = 45] = "C45";
    LogColor[LogColor["C46"] = 46] = "C46";
    LogColor[LogColor["C90"] = 90] = "C90";
    LogColor[LogColor["C91"] = 91] = "C91";
    LogColor[LogColor["C92"] = 92] = "C92";
    LogColor[LogColor["C93"] = 93] = "C93";
    LogColor[LogColor["C94"] = 94] = "C94";
    LogColor[LogColor["C95"] = 95] = "C95";
    LogColor[LogColor["C96"] = 96] = "C96";
    LogColor[LogColor["C97"] = 97] = "C97";
    LogColor[LogColor["C100"] = 100] = "C100";
    LogColor[LogColor["C101"] = 101] = "C101";
    LogColor[LogColor["C102"] = 102] = "C102";
    LogColor[LogColor["C103"] = 103] = "C103";
    LogColor[LogColor["C104"] = 104] = "C104";
    LogColor[LogColor["C105"] = 105] = "C105";
    LogColor[LogColor["C106"] = 106] = "C106";
    LogColor[LogColor["C107"] = 107] = "C107";
})(LogColor || (LogColor = {}));
export class Logger {
    static callOnce(func) {
        let called = false;
        return ((...args) => {
            if (!called) {
                called = true;
                return func(...args);
            }
        });
    }
}
Logger.linesMap = new Map();
Logger.colorEndDes = "\x1b[0m";
Logger.colorStartDes = (color) => `\x1b[${color}m`;
Logger.LOGW = (msg) => Logger.LOG(msg, LogColor.YELLOW);
Logger.LOGE = (msg) => Logger.LOG(msg, LogColor.RED);
Logger.LOGG = (msg) => Logger.LOG(msg, LogColor.C32);
Logger.LOGD = (msg) => Logger.LOG(msg, LogColor.C36);
Logger.LOGN = (msg) => Logger.LOG(msg, LogColor.C35);
Logger.LOGO = (msg) => Logger.LOG(msg, LogColor.C33);
Logger.LOGP = (msg) => Logger.LOG(msg, LogColor.C34);
Logger.LOGM = (msg) => Logger.LOG(msg, LogColor.C92);
Logger.LOGH = (msg) => Logger.LOG(msg, LogColor.C95);
Logger.LOGS = (msg) => Logger.LOG(msg, LogColor.C96);
Logger.LOGZ = (msg) => Logger.LOG(msg, LogColor.C90);
Logger.LOGLL = (msg) => Logger.LOG(msg, LogColor.C100);
Logger.LOGJSON = (obj, type = LogColor.C36, space = 1) => Logger.LOG(JSON.stringify(obj, null, space), type);
Logger.logL = console.log;
Logger.LOG = (str, type = LogColor.WHITE) => {
    switch (type) {
        case LogColor.WHITE:
            Logger.logL(str);
            break;
        case LogColor.RED:
            console.error(str);
            break;
        case LogColor.YELLOW:
            console.warn(str);
            break;
        default:
            Logger.logL("\x1b[" + type + "m" + str + "\x1b[0m");
            break;
    }
};
Logger.printLogColors = () => {
    let str = "123456789";
    Logger.logL(`\n${getLine(16)}  listLogColors  ${getLine(16)}`);
    for (let i = 30; i <= 37; i++) {
        Logger.logL(`\t\t${Logger.colorStartDes(i)} C${i}\t${str} ${Logger.colorEndDes}`);
    }
    Logger.logL(getLine(50));
    for (let i = 40; i <= 47; i++) {
        Logger.logL(`\t\t${Logger.colorStartDes(i)} C${i}\t${str} ${Logger.colorEndDes}`);
    }
    Logger.logL(getLine(50));
    for (let i = 90; i <= 97; i++) {
        Logger.logL(`\t\t${Logger.colorStartDes(i)} C${i}\t${str} ${Logger.colorEndDes}`);
    }
    Logger.logL(getLine(50));
    for (let i = 100; i <= 107; i++) {
        Logger.logL(`\t\t${Logger.colorStartDes(i)} C${i}\t${str} ${Logger.colorEndDes}`);
    }
    Logger.logL(getLine(50));
};
// log(chalk.red("this"), chalk.blue("is"), chalk.green("a"), chalk.yellow("test"))
// chalk.bold chalk.rgb 在 frida 这里不好使
// static logFormart = (...text: chalk.Chalk[] | string[]) => logL(...text)
Logger.getLine = (length, fillStr = "-") => {
    if (length == 0)
        return "";
    let key = length + "|" + fillStr;
    if (Logger.linesMap.get(key) != null)
        return Logger.linesMap.get(key);
    for (var index = 0, tmpRet = ""; index < length; index++)
        tmpRet += fillStr;
    Logger.linesMap.set(key, tmpRet);
    return tmpRet;
};
// build a text with color (use LOG to print)
Logger.getTextFormart = (text, color = LogColor.WHITE, fillStr = " ", length = -1, center = false) => {
    if (text == undefined)
        text = "";
    if (length == -1)
        length = text.length;
    let ret = Logger.colorStartDes(color);
    let fillLength = length - text.length;
    if (fillLength > 0) {
        let left = Math.floor(fillLength / 2);
        let right = fillLength - left;
        if (center) {
            left = right;
        }
        ret += getLine(left, fillStr) + text + getLine(right, fillStr);
    }
    else {
        ret += text;
    }
    ret += Logger.colorEndDes;
    return ret;
};
globalThis.log = Logger.LOG;
globalThis.logw = Logger.LOGW;
globalThis.loge = Logger.LOGE;
globalThis.logg = Logger.LOGG;
globalThis.logd = Logger.LOGD;
globalThis.logn = Logger.LOGN;
globalThis.logo = Logger.LOGO;
globalThis.logp = Logger.LOGP;
globalThis.logh = Logger.LOGH;
globalThis.logm = Logger.LOGM;
globalThis.logz = Logger.LOGZ;
globalThis.logs = Logger.LOGS;
globalThis.logl = Logger.LOGLL;
globalThis.LOGJSON = Logger.LOGJSON;
globalThis.getLine = Logger.getLine;
globalThis.printLogColors = Logger.printLogColors;
globalThis.newLine = (lines = 1) => Logger.LOG(getLine(lines, "\n"));
globalThis.LogColor = LogColor;
// globalThis.log = logFormart // alias log <= logFormart
✄
{"version":3,"file":"breaker.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/breaker/breaker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAKxC,MAAM,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAA;AAE1C,MAAM,OAAO;IACT,0BAA0B;IACnB,MAAM,CAAC,UAAU,CAAC,IAAmB,EAAE,WAAoB,iBAAiB;QAC/E,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC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AAI;YACnB,IAAI,OAAO,GAAa,EAAE,CAAA;YAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE;gBAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;YAC/D,IAAI,CAAC,GAAG,GAAG,CAAC,aAAa,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,EAAE,UAAU,MAAM;YACrB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,MAAM,EAAE,CAAC,CAAA;YAChC,IAAI,EAAE;gBAAE,IAAI,CAAC,iBAAiB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACpI,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
✄
import { HK_TYPE } from "../../utils.js";
const default_hook_type = HK_TYPE.OBJC_REP;
class Breaker {
    // ref function ptr => IMP
    static attachImpl(mPtr, hookType = default_hook_type) {
        objc_method.fromAddress(mPtr).hook(hookType);
    }
    //  ref Method => Method
    static attachMethod(method, bt = false, hookType = default_hook_type) {
        objc_method.fromMethod(method).hook(hookType, false, bt);
    }
    // -[Viber.AddFriendViewControllerInjectionImpl addressBook]
    static attachMethodString(hkStr, hookType = default_hook_type) {
        objc_method.fromString(hkStr).hook(hookType);
    }
    // ref Class / ObjC.Object
    static attachClass(mPtr, filterMethodNameStr = '', force = false) {
        if (typeof mPtr == "string" && mPtr.startsWith("0x"))
            mPtr = ptr(mPtr);
        const localPtr = checkPointer(mPtr);
        const localObj = new ObjC.Class(localPtr); // ref Class
        Breaker.itorMethod(localObj, (method, _impl) => {
            const methodName = `${ObjC.selectorAsString(method.selector)}`;
            if (methodName.includes(filterMethodNameStr))
                Breaker.attachMethod(method);
            // else logz(`${method.implementation} -> ${methodName} | Warn: filter method name`)
        });
    }
    static itorMethod(obj, callback) {
        obj.$ownMethods.forEach(m => {
            let method;
            let impl;
            try {
                method = obj[m];
                try {
                    impl = method.implementation;
                }
                catch (error) {
                    // impl = Hook_Status.getNewImplFromOCMethod(objc_method.fromMethod(method))!
                    throw error;
                }
            }
            catch (error) {
                const selector = call("NSSelectorFromString", allocOCString(m.substring(m.indexOf(' ') + 1)));
                const method_ptr = ObjC.api.class_getInstanceMethod(obj, selector);
                method = new ObjC.Object(method_ptr);
                impl = call("method_getImplementation", method);
            }
            callback(method, impl);
        });
    }
    static attachMethodsByFilter(filterName, filterClass = '', type = "objc") {
        if (filterName == undefined || filterName.length == 0)
            throw new Error('Need args[0] filterStr: string');
        let filter = filterName;
        if (filterClass != undefined && filterClass != '' && !filterName.includes("[")) {
            filter = `*[${filterClass} *${filterName}*]`;
        }
        else if (!filterName.includes("[")) {
            filter = `*[* *${filterName}*]`;
        }
        new ApiResolver(type).enumerateMatches(filter).forEach((item, index) => {
            try {
                // debug info
                // logd(`[${index}] \taddr:${item.address} offset:${md?.name}@${item.address.sub(md?.base!)} ${item.name} ObjM:${method.handle}`)
                Breaker.attachImpl(item.address);
            }
            catch (error) {
                loge(`${item.address} ${error}`);
            }
        });
    }
}
globalThis.b = (mPtr, bt = false) => {
    if (typeof mPtr == 'number')
        mPtr = ptr(mPtr);
    if (typeof mPtr == 'string') {
        if (mPtr.startsWith("0x"))
            mPtr = ptr(mPtr);
        else
            return Breaker.attachMethod(nameToMethod(mPtr), bt);
    }
    Breaker.attachMethod(new ObjC.Object(mPtr), bt);
};
globalThis.B = Breaker.attachClass;
globalThis.BF = Breaker.attachMethodsByFilter;
globalThis.ba = (mPtr, argC = 4, bt = false) => {
    mPtr = checkPointer(mPtr);
    Interceptor.attach(mPtr, {
        onEnter: function (args) {
            let argsStr = [];
            for (let i = 0; i < argC; i++)
                argsStr.push(args[i].toString());
            this.msg = (`Called -> ${mPtr} [ ${argsStr.join(', ')} ]`);
        },
        onLeave: function (retval) {
            logd(`${this.msg} => ${retval}`);
            if (bt)
                logz(`called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`);
        }
    });
};
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/breaker/include.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA"}
✄
import './breaker.js';
✄
{"version":3,"file":"cipher.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/cipher/cipher.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;wFAqBwF;AACxF,QAAQ;AACR,MAAM,aAAa,GAAC;IAChB,QAAQ,EAAC,KAAK;IACd,cAAc,EAAC,IAAI;IACnB,QAAQ,EAAC;QACL,QAAQ,EAAC,IAAI;QACb,eAAe,EAAC,GAAG;QACnB,YAAY,EAAC,KAAK;QAClB,KAAK,EAAC,IAAI;QACV,KAAK,EAAC,IAAI;QACV,MAAM,EAAC,IAAI;QACX,MAAM,EAAC,IAAI;QACX,KAAK,EAAC,IAAI;QACV,KAAK,EAAC,IAAI;QACV,UAAU,EAAC,IAAI;QACf,QAAQ,EAAC,EAAE;KACd;IACD,MAAM,EAAC;QACH,QAAQ,EAAC,IAAI;QACb,oBAAoB,EAAC,GAAG;QACxB,YAAY,EAAC,KAAK;QAClB,KAAK,EAAC,IAAI;QACV,KAAK,EAAC,IAAI;QACV,KAAK,EAAC,IAAI;QACV,MAAM,EAAC,IAAI;QACX,QAAQ,EAAC,IAAI;QACb,QAAQ,EAAC,IAAI;QACb,QAAQ,EAAC,IAAI;QACb,QAAQ,EAAC,IAAI;QACb,QAAQ,EAAC,EAAE;KACd;IACD,MAAM,EAAC;QACH,QAAQ,EAAC,IAAI;QACb,oBAAoB,EAAC,GAAG;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AAsB,EAAE,CAAC;SAC5B;KAEJ;AACL,CAAC,CAAC,EAAE,CAAC"}
✄
/*************************************************************************************
 * Name: frida-ios-cipher
 * OS: iOS
 * Author: @humenger
 * Source: https://github.com/humenger/frida-ios-cipher
 * Desc: Intercept all cryptography-related functions on iOS with Frida Api.
 * refs:https://opensource.apple.com/source/CommonCrypto/CommonCrypto-36064/CommonCrypto/CommonCryptor.h
 * refs:https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/CC_MD5.3cc.html#//apple_ref/doc/man/3cc/CC_MD5
 * refs:https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/CC_SHA.3cc.html#//apple_ref/doc/man/3cc/CC_SHA
 * refs:https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/CCCryptor.3cc.html#//apple_ref/doc/man/3cc/CCCryptor
 * refs:https://opensource.apple.com/source/CommonCrypto/CommonCrypto-55010/CommonCrypto/CommonKeyDerivation.h.auto.html
 * refs:https://www.cnblogs.com/cocoajin/p/6150203.html
 * refs:https://frida.re/docs/javascript-api/
 * refs:https://codeshare.frida.re/@xperylab/cccrypt-dump/
 * refs:https://github.com/federicodotta/Brida
 * refs:https://github.com/sensepost/objection/blob/master/agent/src/ios/crypto.ts
 * refs:https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60118.200.6/lib/CommonCryptor.c.auto.html
 * refs:https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60026/CommonCrypto/CommonCryptor.h.auto.html
 * refs:https://www.jianshu.com/p/8896ed432dff
 * refs:https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60118.200.6/lib/
 * refs:https://blog.csdn.net/q187543/article/details/103920969
 **************************************************************************************/
//config
const CIPHER_CONFIG = {
    "enable": false,
    "highlighting": true,
    "crypto": {
        "enable": true,
        "maxDataLength": 240,
        "printStack": false,
        "aes": true,
        "des": true,
        "3des": true,
        "cast": true,
        "rc4": true,
        "rc2": true,
        "blowfish": true,
        "filter": []
    },
    "hash": {
        "enable": true,
        "maxInputDataLength": 240,
        "printStack": false,
        "md2": true,
        "md4": true,
        "md5": true,
        "sha1": true,
        "sha224": true,
        "sha256": true,
        "sha384": true,
        "sha512": true,
        "filter": []
    },
    "hmac": {
        "enable": true,
        "maxInputDataLength": 240,
        "printStack": false,
        "sha1": true,
        "md5": true,
        "sha224": true,
        "sha256": true,
        "sha384": true,
        "sha512": true,
        "filter": []
    },
    "pbkdf": {
        "enable": true,
        "printStack": false,
        "filter": []
    }
};
//common
const COLORS = {
    "resetColor": CIPHER_CONFIG.highlighting ? "\x1b[0m" : "",
    "bold": CIPHER_CONFIG.highlighting ? "\x1b[1m" : "",
    "dim": CIPHER_CONFIG.highlighting ? "\x1b[2m" : "",
    "italic": CIPHER_CONFIG.highlighting ? "\x1b[3m" : "",
    "underline": CIPHER_CONFIG.highlighting ? "\x1b[4m" : "",
    "blink": CIPHER_CONFIG.highlighting ? "\x1b[5m" : "",
    "reverse": CIPHER_CONFIG.highlighting ? "\x1b[7m" : "",
    "hidden": CIPHER_CONFIG.highlighting ? "\x1b[8m" : "",
    "black": CIPHER_CONFIG.highlighting ? "\x1b[30m" : "",
    "red": CIPHER_CONFIG.highlighting ? "\x1b[31m" : "",
    "green": CIPHER_CONFIG.highlighting ? "\x1b[32m" : "",
    "yellow": CIPHER_CONFIG.highlighting ? "\x1b[33m" : "",
    "blue": CIPHER_CONFIG.highlighting ? "\x1b[34m" : "",
    "magenta": CIPHER_CONFIG.highlighting ? "\x1b[35m" : "",
    "cyan": CIPHER_CONFIG.highlighting ? "\x1b[36m" : "",
    "white": CIPHER_CONFIG.highlighting ? "\x1b[37m" : "",
    "bgBlack": CIPHER_CONFIG.highlighting ? "\x1b[40m" : "",
    "bgRed": CIPHER_CONFIG.highlighting ? "\x1b[41m" : "",
    "bgGreen": CIPHER_CONFIG.highlighting ? "\x1b[42m" : "",
    "bgYellow": CIPHER_CONFIG.highlighting ? "\x1b[43m" : "",
    "bgBlue": CIPHER_CONFIG.highlighting ? "\x1b[44m" : "",
    "bgMagenta": CIPHER_CONFIG.highlighting ? "\x1b[45m" : "",
    "bgCyan": CIPHER_CONFIG.highlighting ? "\x1b[46m" : "",
    "bgWhite": CIPHER_CONFIG.highlighting ? "\x1b[47m" : ""
};
const CC_MD2_DIGEST_LENGTH = 16;
const CC_MD4_DIGEST_LENGTH = 16;
const CC_MD5_DIGEST_LENGTH = 16;
const CC_SHA1_DIGEST_LENGTH = 20;
const CC_SHA224_DIGEST_LENGTH = 28;
const CC_SHA256_DIGEST_LENGTH = 32;
const CC_SHA384_DIGEST_LENGTH = 48;
const CC_SHA512_DIGEST_LENGTH = 64;
const CCOperation = {
    0: "kCCEncrypt",
    1: "kCCEncrypt",
    3: "kCCBoth" //Private Cryptor direction (op)
};
const CCAlgorithm = {
    0: "kCCAlgorithmAES",
    1: "kCCAlgorithmDES",
    2: "kCCAlgorithm3DES",
    3: "kCCAlgorithmCAST",
    4: "kCCAlgorithmRC4",
    5: "kCCAlgorithmRC2",
    6: "kCCAlgorithmBlowfish"
};
const CCOptions = {
    //options for block ciphers
    1: "kCCOptionPKCS7Padding",
    2: "kCCOptionECBMode"
    //stream ciphers currently have no options
};
const CCMode = {
    1: "kCCModeECB",
    2: "kCCModeCBC",
    3: "kCCModeCFB",
    4: "kCCModeCTR",
    5: "kCCModeF8",
    6: "kCCModeLRW",
    7: "kCCModeOFB",
    8: "kCCModeXTS",
    9: "kCCModeRC4",
    10: "kCCModeCFB8",
    11: "kCCModeGCM",
    12: "kCCModeCCM"
};
const CCPadding = {
    0: "ccNoPadding",
    1: "ccPKCS7Padding",
    12: "ccCBCCTS3" //Private Paddings
};
const CCModeOptions = {
    0x0001: "kCCModeOptionCTR_LE",
    0x0002: "kCCModeOptionCTR_BE"
};
const CCKeySize = {
    16: "kCCKeySizeAES128|kCCKeySizeMaxCAST",
    24: "kCCKeySizeAES192|kCCKeySize3DES",
    32: "kCCKeySizeAES256",
    8: "kCCKeySizeDES|kCCKeySizeMinBlowfish",
    5: "kCCKeySizeMinCAST",
    1: "kCCKeySizeMinRC4|kCCKeySizeMinRC2",
    512: "kCCKeySizeMaxRC4",
    128: "kCCKeySizeMaxRC2",
    56: "kCCKeySizeMaxBlowfish"
};
const CCHmacAlgorithm = {
    0: "kCCHmacAlgSHA1",
    1: "kCCHmacAlgMD5",
    2: "kCCHmacAlgSHA256",
    3: "kCCHmacAlgSHA384",
    4: "kCCHmacAlgSHA512",
    5: "kCCHmacAlgSHA224",
};
const CCHmacAlgorithmLength = {
    0: CC_SHA1_DIGEST_LENGTH,
    1: CC_MD5_DIGEST_LENGTH,
    2: CC_SHA256_DIGEST_LENGTH,
    3: CC_SHA384_DIGEST_LENGTH,
    4: CC_SHA512_DIGEST_LENGTH,
    5: CC_SHA224_DIGEST_LENGTH,
};
const CCPseudoRandomAlgorithm = {
    1: "kCCPRFHmacAlgSHA1",
    2: "kCCPRFHmacAlgSHA224",
    3: "kCCPRFHmacAlgSHA256",
    4: "kCCPRFHmacAlgSHA384",
    5: "kCCPRFHmacAlgSHA512",
};
const CCPBKDFAlgorithm = {
    2: "kCCPBKDF2"
};
// @ts-ignore
function print_arg(addr, len = 240) {
    try {
        if (addr == null)
            return "\n";
        return "\n" + (hexdump(addr, { length: len })) + "\n";
    }
    catch (e) {
        if (e instanceof Error) {
            console.error("print_arg error:", e.stack);
        }
        return addr + "\n";
    }
}
function pointerToInt(ptr) {
    try {
        if (ptr == null)
            return 0;
        return parseInt(ptr.toString());
    }
    catch (e) {
        if (e instanceof Error) {
            console.error("pointerToInt error:", e.stack);
        }
        return 0;
    }
}
function filterLog(msg, filter) {
    if (filter == null || filter.length == 0) {
        console.log(msg);
    }
    else {
        var hasFilter = false;
        for (let value of filter) {
            if (value == null || value.length == 0)
                continue;
            hasFilter = true;
            if (msg.indexOf(value) >= 0) {
                console.log(msg);
                return;
            }
        }
        if (!hasFilter) {
            console.log(msg);
        }
    }
}
function fixHexDump(hex) {
    // @ts-ignore
    var ret = "";
    const lines = hex.split("\n");
    for (const line of lines) {
        const parts = line.split("");
        if (parts.length <= 58) {
            parts.splice(parts.length, 0, '\n');
        }
        else {
            parts.splice(parts.length, 0, '|\n');
            parts.splice(59, 0, '|');
        }
        parts.splice(0, 2);
        ret += parts.join("");
    }
    return ret;
}
function commonCryptoInterceptor() {
    function checkCryptoAlgorithmEnable(algorithm) {
        switch (algorithm) {
            case 0:
                return CIPHER_CONFIG.crypto.aes;
            case 1:
                return CIPHER_CONFIG.crypto.des;
            case 2:
                return CIPHER_CONFIG.crypto["3des"];
            case 3:
                return CIPHER_CONFIG.crypto.cast;
            case 4:
                return CIPHER_CONFIG.crypto.rc4;
            case 5:
                return CIPHER_CONFIG.crypto.rc2;
            case 6:
                return CIPHER_CONFIG.crypto.blowfish;
            default:
                return true;
        }
    }
    //CCCryptorStatus CCCrypt(
    // 	CCOperation op,			/* kCCEncrypt, etc. */
    // 	CCAlgorithm alg,		/* kCCAlgorithmAES128, etc. */
    // 	CCOptions options,		/* kCCOptionPKCS7Padding, etc. */
    // 	const void *key,
    // 	size_t keyLength,
    // 	const void *iv,			/* optional initialization vector */
    // 	const void *dataIn,		/* optional per op and alg */
    // 	size_t dataInLength,
    // 	void *dataOut,			/* data RETURNED here */
    // 	size_t dataOutAvailable,
    // 	size_t *dataOutMoved);
    let func = Module.findExportByName("libSystem.B.dylib", "CCCrypt");
    if (func == null) {
        console.error("CCCrypt func is null");
        return;
    }
    Interceptor.attach(func, {
        onEnter: function (args) {
            this.enable = checkCryptoAlgorithmEnable(args[1].toInt32());
            if (!this.enable)
                return;
            this.log = "";
            this.log = this.log.concat(COLORS.green, "[*] ENTER CCCrypt", COLORS.resetColor);
            this.log = this.log.concat(COLORS.yellow, "[+] CCOperation: " + CCOperation[args[0].toInt32()], COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.yellow, "[+] CCAlgorithm: " + CCAlgorithm[args[1].toInt32()], COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.yellow, "[+] CCOptions: " + CCOptions[args[2].toInt32()], COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.yellow, "[+] KeySize: " + CCKeySize[args[4].toInt32()], COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.cyan, "[+] Key: \n" + print_arg(args[3], args[4].toInt32()), COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.cyan, "[+] IV: \n" + print_arg(args[5], 16), COLORS.resetColor, "\n");
            let dataInLength = pointerToInt(args[7]);
            let printLength = Math.min(dataInLength, CIPHER_CONFIG.crypto.maxDataLength);
            this.log = this.log.concat("[+] Data len: ", printLength, "/", dataInLength, "\n");
            this.log = this.log.concat("[+] Data : \n", "\n");
            this.log = this.log.concat(print_arg(args[6], printLength));
            this.dataOut = args[8];
            this.dataOutLength = args[10];
        },
        onLeave: function (retval) {
            if (!this.enable)
                return;
            let dataOutLen = pointerToInt(this.dataOutLength.readPointer());
            let printOutLen = Math.min(dataOutLen, CIPHER_CONFIG.crypto.maxDataLength);
            this.log = this.log.concat(COLORS.magenta, "[+] Data out len: ", printOutLen, "/", dataOutLen, "\n");
            this.log = this.log.concat("[+] Data out: \n", print_arg(this.dataOut, printOutLen), "\n", COLORS.resetColor);
            if (CIPHER_CONFIG.crypto.printStack) {
                this.log = this.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
            }
            this.log = this.log.concat(COLORS.green, "[*] EXIT CCCrypt", COLORS.resetColor, "\n");
            filterLog(this.log, CIPHER_CONFIG.crypto.filter);
        }
    });
    let cRefCache = {};
    //CCCryptorStatus CCCryptorCreate(CCOperation op, CCAlgorithm alg, CCOptions options, const void *key, size_t keyLength, const void *iv,CCCryptorRef *cryptorRef);
    let CCCryptorCreate = Module.findExportByName("libSystem.B.dylib", "CCCryptorCreate");
    if (CCCryptorCreate == null) {
        console.error("CCCryptorCreate func is null ");
        return;
    }
    Interceptor.attach(CCCryptorCreate, {
        onEnter: function (args) {
            this.params = [];
            for (let i = 0; i < 7; i++) {
                this.params.push(args[i]);
            }
        },
        onLeave: function (reval) {
            let model = {
                enable: checkCryptoAlgorithmEnable(this.params[1]),
                cRef: this.params[6].readPointer(),
                dataMap: [],
                dataOutMap: [],
                totalLen: 0,
                totalOutLen: 0,
                originalLen: 0,
                originalOutLen: 0,
                log: "",
                finish: false,
                CCAlgorithm: "",
                CCOperation: "",
                CCMode: "",
                CCKeySize: "",
                CCModeOptions: "",
                CCPadding: "",
                Key: "",
                Iv: "null",
                Tweak: "",
                TweakLen: "",
                NumRounds: ""
            };
            cRefCache[pointerToInt(model.cRef)] = model;
            if (!model.enable)
                return;
            model.log = model.log.concat(COLORS.green, "[*] ENTER CCCryptorCreate", COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCOperation: ", model.CCOperation = CCOperation[this.params[0].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCAlgorithm: " + CCAlgorithm[this.params[1].toInt32()], COLORS.resetColor, "\n");
            // model.log=model.log.concat(COLORS.yellow,"[+] CCOptions: " + CCOptions[this.options.toInt32()],COLORS.resetColor,"\n");
            model.log = model.log.concat(COLORS.cyan, "[+] Key len: ", model.CCKeySize = CCKeySize[this.params[4].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.cyan, "[+] Key: \n", model.Key = print_arg(this.params[3], pointerToInt(this.params[4])), COLORS.resetColor, "\n");
            if (pointerToInt(this.params[5]) != 0) {
                model.log = model.log.concat(COLORS.cyan, "[+] Iv:\n", model.Iv = print_arg(this.params[5], 16), COLORS.resetColor, "\n");
            }
            else {
                model.log = model.log.concat(COLORS.red, "[!] Iv: null", "\n", COLORS.resetColor);
            }
        }
    });
    //CCCryptorStatus CCCryptorCreateWithMode(
    //     CCOperation 	op,				/* kCCEncrypt, kCCEncrypt */
    //     CCMode			mode,
    //     CCAlgorithm		alg,
    //     CCPadding		padding,
    //     const void 		*iv,			/* optional initialization vector */
    //     const void 		*key,			/* raw key material */
    //     size_t 			keyLength,
    //     const void 		*tweak,			/* raw tweak material */  //for mode: XTS
    //     size_t 			tweakLength,
    //     int				numRounds,		/* 0 == default */
    //     CCModeOptions 	options,
    //     CCCryptorRef	*cryptorRef)	/* RETURNED */
    let CCCryptorCreateWithMode = Module.findExportByName("libSystem.B.dylib", "CCCryptorCreateWithMode");
    if (CCCryptorCreateWithMode == null) {
        console.error("CCCryptorCreateWithMode func is null ");
        return;
    }
    Interceptor.attach(CCCryptorCreateWithMode, {
        onEnter: function (args) {
            this.params = [];
            for (let i = 0; i < 12; i++) {
                this.params.push(args[i]);
            }
        },
        onLeave: function (reval) {
            let model = {
                enable: checkCryptoAlgorithmEnable(this.params[2]),
                cRef: ptr(0),
                dataMap: [],
                dataOutMap: [],
                totalLen: 0,
                totalOutLen: 0,
                originalLen: 0,
                originalOutLen: 0,
                log: "",
                finish: false,
                CCAlgorithm: "",
                CCOperation: "",
                CCMode: "",
                CCKeySize: "",
                CCModeOptions: "",
                CCPadding: "",
                Key: "",
                Iv: "null",
                Tweak: "",
                TweakLen: "",
                NumRounds: ""
            };
            try {
                model.cRef = this.params[11].readPointer();
            }
            catch (e) {
                console.log("Error: read CCCryptorRef failed:", e);
                return;
            }
            cRefCache[pointerToInt(model.cRef)] = model;
            if (!model.enable)
                return;
            model.log = model.log.concat(COLORS.green, "[*] ENTER CCCryptorCreateWithMode", COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCOperation: ", model.CCOperation = CCOperation[this.params[0].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCMode: ", model.CCMode = CCMode[this.params[1].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCAlgorithm: ", model.CCAlgorithm = CCAlgorithm[this.params[2].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCPadding: ", model.CCPadding = CCPadding[this.params[3].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.yellow, "[+] CCModeOptions: ", model.CCModeOptions = CCModeOptions[this.params[10].toInt32()], COLORS.resetColor, "\n");
            let tweakLen = this.params[8].toInt32();
            if (tweakLen > 0 && pointerToInt(this.params[7]) != 0) {
                model.log = model.log.concat(COLORS.cyan, "[+] tweak len: ", model.TweakLen = tweakLen, COLORS.resetColor, "\n");
                model.log = model.log.concat(COLORS.cyan, "[+] tweak: \n", model.Tweak = print_arg(this.params[7], pointerToInt(this.params[8])), COLORS.resetColor, "\n");
            }
            model.log = model.log.concat(COLORS.cyan, "[+] numRounds: ", model.NumRounds = this.params[9].toInt32(), COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.cyan, "[+] Key len: ", model.CCKeySize = CCKeySize[this.params[6].toInt32()], COLORS.resetColor, "\n");
            model.log = model.log.concat(COLORS.cyan, "[+] Key: \n", model.Key = print_arg(this.params[5], pointerToInt(this.params[6])), COLORS.resetColor, "\n");
            if (pointerToInt(this.params[4]) != 0) {
                model.log = model.log.concat(COLORS.cyan, "[+] Iv:\n", model.Iv = print_arg(this.params[4], 16), COLORS.resetColor, "\n");
            }
            else {
                model.log = model.log.concat(COLORS.red, "[!] Iv: null", "\n", COLORS.resetColor);
            }
        }
    });
    //CCCryptorStatus CCCryptorUpdate(CCCryptorRef cryptorRef, const void *dataIn,size_t dataInLength, void *dataOut, size_t dataOutAvailable,size_t *dataOutMoved);
    let CCCryptorUpdate = Module.findExportByName("libSystem.B.dylib", "CCCryptorUpdate");
    if (CCCryptorUpdate == null) {
        console.error("CCCryptorUpdate func is null");
        return;
    }
    Interceptor.attach(CCCryptorUpdate, {
        onEnter: function (args) {
            this.params = [];
            for (let i = 0; i < 6; i++) {
                this.params.push(args[i]);
            }
        },
        onLeave: function (retval) {
            let model = cRefCache[pointerToInt(this.params[0])];
            if (model == null) {
                model = {
                    enable: CIPHER_CONFIG.crypto.enable,
                    cRef: this.params[0],
                    dataMap: [],
                    dataOutMap: [],
                    totalLen: 0,
                    totalOutLen: 0,
                    originalLen: 0,
                    originalOutLen: 0,
                    log: "",
                    finish: false,
                    CCAlgorithm: "",
                    CCOperation: "",
                    CCMode: "",
                    CCKeySize: "",
                    CCModeOptions: "",
                    CCPadding: "",
                    Key: "",
                    Iv: "",
                    Tweak: "",
                    TweakLen: "",
                    NumRounds: ""
                };
                model.log = model.log.concat(COLORS.green, "[*] ENTER CCCryptorUpdate (note: Cannot be associated with an existing CCCryptorRef, so the data encryption parameters are unknown, However, a list of encryption instances that are currently still being processed can be provided here.)", COLORS.resetColor, "\n");
                model.log = model.log.concat(COLORS.blue, "[=] The list is as follows:", COLORS.resetColor, "\n");
                for (let cRefCacheKey in cRefCache) {
                    let value = cRefCache[cRefCacheKey];
                    if (value != null && !value.finish) {
                        model.log = model.log.concat(COLORS.cyan, "[+] CCCryptorRef: ", "" + value.cRef + "(pointer)", " dump:\n", COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : CCAlgorithm: ", value.CCAlgorithm, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : CCOperation: ", value.CCOperation, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : CCMode: ", value.CCMode, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : CCKeySize: ", value.CCKeySize, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : CCModeOptions: ", value.CCModeOptions, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : CCPadding: ", value.CCPadding, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : Key: ", value.Key, COLORS.resetColor, "\n");
                        model.log = model.log.concat(COLORS.yellow, "[+] : Iv: ", value.Iv, COLORS.resetColor, "\n");
                        if (parseInt(value.TweakLen) > 0) {
                            model.log = model.log.concat(COLORS.yellow, "[+] : TweakLen: ", value.TweakLen, COLORS.resetColor, "\n");
                            model.log = model.log.concat(COLORS.yellow, "[+] : Tweak: ", value.Tweak, COLORS.resetColor, "\n");
                        }
                        model.log = model.log.concat(COLORS.yellow, "[+] : NumRounds: ", value.NumRounds, COLORS.resetColor, "\n");
                    }
                }
                model.log = model.log.concat(COLORS.blue, "[=] End of list", COLORS.resetColor, "\n");
                cRefCache[pointerToInt(this.params[0])] = model;
            }
            if (!model.enable)
                return;
            model.originalLen += this.params[2].toInt32();
            let remainingSpace = CIPHER_CONFIG.crypto.maxDataLength - model.totalLen;
            let dataLen = pointerToInt(this.params[2]);
            if (dataLen > 0 && remainingSpace > 0) {
                let copyLength = Math.min(dataLen, remainingSpace);
                let tmpData = Memory.alloc(copyLength);
                Memory.copy(tmpData, this.params[1], copyLength);
                model.dataMap.push({ data: tmpData, len: copyLength });
                model.totalLen += copyLength;
            }
            let outRemainingSpace = CIPHER_CONFIG.crypto.maxDataLength - model.totalOutLen;
            let outLen = pointerToInt(this.params[5].readPointer());
            model.originalOutLen += outLen;
            if (outLen > 0 && outRemainingSpace > 0) {
                let copyLength = Math.min(outLen, outRemainingSpace);
                let tmpDataOut = Memory.alloc(copyLength);
                Memory.copy(tmpDataOut, this.params[3], copyLength);
                model.dataOutMap.push({ data: tmpDataOut, len: copyLength });
                model.totalOutLen += copyLength;
            }
        }
    });
    //CCCryptorStatus CCCryptorFinal(CCCryptorRef cryptorRef, void *dataOut,size_t dataOutAvailable, size_t *dataOutMoved);
    let CCCryptorFinal = Module.findExportByName("libSystem.B.dylib", "CCCryptorFinal");
    if (CCCryptorFinal == null) {
        console.error("CCCryptorFinal func is null");
        return;
    }
    Interceptor.attach(CCCryptorFinal, {
        onEnter: function (args) {
            this.params = [];
            for (let i = 0; i < 4; i++) {
                this.params.push(args[i]);
            }
        },
        onLeave: function (retval) {
            let model = cRefCache[pointerToInt(this.params[0])];
            if (model == null) {
                console.error("CCCryptorFinal model is null");
                return;
            }
            if (!model.enable)
                return;
            if (model.totalOutLen < CIPHER_CONFIG.crypto.maxDataLength) {
                let outRemainingSpace = CIPHER_CONFIG.crypto.maxDataLength - model.totalOutLen;
                let outLen = pointerToInt(this.params[3].readPointer());
                model.originalOutLen += outLen;
                if (outLen > 0 && outRemainingSpace > 0) {
                    let copyLength = Math.min(outLen, outRemainingSpace);
                    let tmpDataOut = Memory.alloc(copyLength);
                    Memory.copy(tmpDataOut, this.params[1], copyLength);
                    model.dataOutMap.push({ data: tmpDataOut, len: copyLength });
                    model.totalOutLen += copyLength;
                }
            }
            let totalData = Memory.alloc(model.totalLen);
            var offset = 0;
            model.dataMap.forEach(function (value) {
                Memory.copy(totalData.add(offset), value.data, value.len);
                offset += value.len;
            });
            let totalOutData = Memory.alloc(model.totalOutLen);
            var offsetOut = 0;
            model.dataOutMap.forEach(function (value) {
                Memory.copy(totalOutData.add(offsetOut), value.data, value.len);
                offsetOut += value.len;
            });
            model.log = model.log.concat("[+] Data len: " + model.totalLen + "/" + model.originalLen + "\n");
            model.log = model.log.concat("[+] Data : \n", print_arg(totalData, model.totalLen), "\n");
            model.log = model.log.concat(COLORS.magenta, "[+] Data out len: " + model.totalOutLen + "/" + model.originalOutLen + "\n");
            model.log = model.log.concat("[+] Data out: \n", print_arg(totalOutData, model.totalOutLen), "\n", COLORS.resetColor);
            if (CIPHER_CONFIG.crypto.printStack) {
                model.log = model.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
            }
            model.log = model.log.concat(COLORS.green, "[*] EXIT CCCryptorFinal ", COLORS.resetColor, "\n");
            model.finish = true;
            filterLog(model.log, CIPHER_CONFIG.crypto.filter);
        }
    });
}
function commonHashInterceptor(name, length) {
    let hash = Module.findExportByName("libSystem.B.dylib", name);
    if (hash == null) {
        console.error(name + " func is null");
        return;
    }
    Interceptor.attach(hash, {
        onEnter: function (args) {
            this.log = "";
            this.log = this.log.concat(COLORS.green, "[*] ENTER ", name, COLORS.resetColor, "\n");
            let dataLen = args[1].toInt32();
            let printLen = Math.min(dataLen, CIPHER_CONFIG.hash.maxInputDataLength);
            this.log = this.log.concat("[+] Data len: ", printLen, "/", dataLen, "\n");
            this.log = this.log.concat("[+] Data: \n", print_arg(args[0], printLen), "\n");
        },
        onLeave: function (reval) {
            this.log = this.log.concat(COLORS.magenta, "[+] Data out len: " + length, COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.magenta, "[+] Data out:\n", print_arg(reval, length), COLORS.resetColor, "\n");
            if (CIPHER_CONFIG.hash.printStack) {
                this.log = this.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
            }
            this.log = this.log.concat(COLORS.green, "[*] EXIT ", name, COLORS.resetColor, "\n");
            filterLog(this.log, CIPHER_CONFIG.hash.filter);
        }
    });
    (function () {
        let ctxCache = {};
        //CC_SHA1_Init(CC_SHA1_CTX *c);
        let init = Module.findExportByName("libSystem.B.dylib", name + "_Init");
        if (init == null) {
            console.error(name + "_Init func is null");
            return;
        }
        Interceptor.attach(init, {
            onEnter: function (args) {
                let model = { ctx: args[0], dataMap: [], totalLen: 0, originalLen: 0, log: "" };
                ctxCache[pointerToInt(args[0])] = model;
                model.log = model.log.concat(COLORS.green, "[*] ENTER " + name + "_Init\n", COLORS.resetColor);
            }
        });
        //CC_SHA1_Update(CC_SHA1_CTX *c, const void *data, CC_LONG len);
        let update = Module.findExportByName("libSystem.B.dylib", name + "_Update");
        if (update == null) {
            console.error(name + "_Update func is null");
            return;
        }
        Interceptor.attach(update, {
            onEnter: function (args) {
                let model = ctxCache[pointerToInt(args[0])];
                if (model == null) {
                    console.error("model is null");
                    return;
                }
                let len = pointerToInt(args[2]);
                let remainingSpace = CIPHER_CONFIG.hash.maxInputDataLength - model.totalLen;
                if (len > 0 && remainingSpace > 0) {
                    model.originalLen += len;
                    let copyLen = Math.min(len, remainingSpace);
                    let tmpData = Memory.alloc(copyLen);
                    Memory.copy(tmpData, args[1], copyLen);
                    model.dataMap.push({ data: tmpData, len: copyLen });
                    model.totalLen += copyLen;
                }
            }
        });
        //CC_SHA1_Final(unsigned char *md, CC_SHA1_CTX *c);
        let final = Module.findExportByName("libSystem.B.dylib", name + "_Final");
        if (final == null) {
            console.error(name + "_Final func is null");
            return;
        }
        Interceptor.attach(final, {
            onEnter: function (args) {
                this.mdSha = args[0];
                this.ctxSha = args[1];
            },
            onLeave: function (retval) {
                let model = ctxCache[pointerToInt(this.ctxSha)];
                if (model == null) {
                    console.error(name + "_Final model is null");
                    return;
                }
                if (model.totalLen <= 0) {
                    console.error("totalLen :", model.totalLen);
                    return;
                }
                let totalData = Memory.alloc(model.totalLen);
                var offset = 0;
                model.dataMap.forEach(function (value) {
                    Memory.copy(totalData.add(offset), value.data, value.len);
                    offset += value.len;
                });
                model.log = model.log.concat("[+] Data len: " + model.totalLen + "/" + model.originalLen + "\n");
                model.log = model.log.concat("[+] Data :\n");
                model.log = model.log.concat(print_arg(totalData, model.totalLen), "\n");
                if (pointerToInt(this.mdSha) !== 0) {
                    model.log = model.log.concat(COLORS.magenta, "[+] Data out len: " + length + "\n");
                    model.log = model.log.concat("[+] Data out:\n");
                    model.log = model.log.concat(print_arg(ptr(this.mdSha), length), "\n", COLORS.resetColor);
                }
                else {
                    model.log = model.log.concat(COLORS.red, "[!]: Data out: null\n", COLORS.resetColor);
                }
                if (CIPHER_CONFIG.hash.printStack) {
                    model.log = model.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
                }
                model.log = model.log.concat(COLORS.green, "[*] EXIT " + name + "_Final" + "\n", COLORS.resetColor);
                filterLog(model.log, CIPHER_CONFIG.hash.filter);
            }
        });
    })();
}
function commonHMACInterceptor() {
    function checkHMACAlgorithmEnable(algorithm) {
        switch (algorithm) {
            case 0:
                return CIPHER_CONFIG.hmac.sha1;
            case 1:
                return CIPHER_CONFIG.hmac.md5;
            case 2:
                return CIPHER_CONFIG.hmac.sha256;
            case 3:
                return CIPHER_CONFIG.hmac.sha384;
            case 4:
                return CIPHER_CONFIG.hmac.sha512;
            case 5:
                return CIPHER_CONFIG.hmac.sha224;
            default:
                return true;
        }
    }
    let name = "CCHmac";
    //void CCHmac(CCHmacAlgorithm algorithm, const void *key, size_t keyLength,const void *data, size_t dataLength, void *macOut);
    let hmac = Module.findExportByName("libSystem.B.dylib", name);
    if (hmac == null) {
        console.error(name + " func is null");
        return;
    }
    Interceptor.attach(hmac, {
        onEnter: function (args) {
            this.enable = checkHMACAlgorithmEnable(args[0].toInt32());
            if (!this.enable)
                return;
            this.mdLen = CCHmacAlgorithmLength[args[0].toInt32()];
            this.log = "";
            this.log = this.log.concat(COLORS.green, "[*] ENTER ", name, "\n");
            this.log = this.log.concat(COLORS.yellow, "[+] Algorithm: ", CCHmacAlgorithm[args[0].toInt32()], "\n", COLORS.resetColor);
            this.log = this.log.concat(COLORS.cyan, "[+] Key len: ", args[2].toInt32(), "\n");
            this.log = this.log.concat(COLORS.cyan, "[+] Key : \n", print_arg(args[1], args[2].toInt32()), "\n", COLORS.resetColor);
            let dataLen = args[4].toInt32();
            let printLen = Math.min(dataLen, CIPHER_CONFIG.hmac.maxInputDataLength);
            this.log = this.log.concat("[+] Data len: ", printLen, "/", dataLen, "\n");
            this.log = this.log.concat("[+] Data: \n", print_arg(args[3], printLen), "\n");
            this.macOut = args[5];
        },
        onLeave: function (reval) {
            if (!this.enable)
                return;
            this.log = this.log.concat(COLORS.magenta, "[+] Data out len: " + this.mdLen, COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.magenta, "[+] Data out:\n", print_arg(this.macOut, this.mdLen), COLORS.resetColor, "\n");
            if (CIPHER_CONFIG.hmac.printStack) {
                this.log = this.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
            }
            this.log = this.log.concat(COLORS.green, "[*] EXIT ", name, COLORS.resetColor, "\n");
            filterLog(this.log, CIPHER_CONFIG.hmac.filter);
        }
    });
    (function () {
        let ctxCache = {};
        //void
        //      CCHmacInit(CCHmacContext *ctx, CCHmacAlgorithm algorithm,
        //          const void *key, size_t keyLength);
        let init = Module.findExportByName("libSystem.B.dylib", name + "Init");
        if (init == null) {
            console.error(name + "Init func is null");
            return;
        }
        Interceptor.attach(init, {
            onEnter: function (args) {
                let model = { ctx: args[0], dataMap: [], totalLen: 0, originalLen: 0, log: "", mdLen: CCHmacAlgorithmLength[args[1].toInt32()], enable: checkHMACAlgorithmEnable(args[1].toInt32()) };
                ctxCache[pointerToInt(args[0])] = model;
                if (!model.enable)
                    return;
                model.log = model.log.concat(COLORS.green, "[*] ENTER " + name + "Init\n", COLORS.resetColor);
                model.log = model.log.concat(COLORS.yellow, "[+] Algorithm: " + CCHmacAlgorithm[args[1].toInt32()] + "\n", COLORS.resetColor);
                model.log = model.log.concat(COLORS.cyan, "[+] Key len: " + args[3].toInt32() + COLORS.resetColor + "\n");
                model.log = model.log.concat(COLORS.cyan, "[+] Key: \n" + print_arg(args[2], pointerToInt(args[3])) + "\n", COLORS.resetColor);
            }
        });
        //void
        //      CCHmacUpdate(CCHmacContext *ctx, const void *data, size_t dataLength);
        let update = Module.findExportByName("libSystem.B.dylib", name + "Update");
        if (update == null) {
            console.error(name + "Update func is null");
            return;
        }
        Interceptor.attach(update, {
            onEnter: function (args) {
                let model = ctxCache[pointerToInt(args[0])];
                if (model == null) {
                    console.error(name + "Update model is null");
                    return;
                }
                if (!model.enable)
                    return;
                let len = pointerToInt(args[2]);
                let remainingSpace = CIPHER_CONFIG.hmac.maxInputDataLength - model.totalLen;
                if (len > 0 && remainingSpace > 0) {
                    model.originalLen += len;
                    let copyLen = Math.min(len, remainingSpace);
                    let tmpData = Memory.alloc(copyLen);
                    Memory.copy(tmpData, args[1], copyLen);
                    model.dataMap.push({ data: tmpData, len: copyLen });
                    model.totalLen += copyLen;
                }
            }
        });
        //void
        //      CCHmacFinal(CCHmacContext *ctx, void *macOut);
        let final = Module.findExportByName("libSystem.B.dylib", name + "Final");
        if (final == null) {
            console.error(name + "Final func is null");
            return;
        }
        Interceptor.attach(final, {
            onEnter: function (args) {
                this.mdOut = args[1];
                this.ctx = args[0];
            },
            onLeave: function (retval) {
                let model = ctxCache[pointerToInt(this.ctx)];
                if (model == null) {
                    console.error(name + "Final model is null");
                    return;
                }
                if (!model.enable)
                    return;
                if (model.totalLen <= 0) {
                    console.error("totalLen :", model.totalLen);
                    return;
                }
                let totalData = Memory.alloc(model.totalLen);
                var offset = 0;
                model.dataMap.forEach(function (value) {
                    Memory.copy(totalData.add(offset), value.data, value.len);
                    offset += value.len;
                });
                model.log = model.log.concat("[+] Data len: " + model.totalLen + "/" + model.originalLen + "\n");
                model.log = model.log.concat("[+] Data :\n");
                model.log = model.log.concat(print_arg(totalData, model.totalLen), "\n");
                model.log = model.log.concat(COLORS.magenta, "[+] Data out len: " + model.mdLen + "\n");
                model.log = model.log.concat("[+] Data out:\n");
                model.log = model.log.concat(print_arg(ptr(this.mdOut), model.mdLen), "\n", COLORS.resetColor);
                if (CIPHER_CONFIG.hmac.printStack) {
                    model.log = model.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
                }
                model.log = model.log.concat(COLORS.green, "[*] EXIT " + name + "Final" + "\n", COLORS.resetColor);
                filterLog(model.log, CIPHER_CONFIG.hmac.filter);
            }
        });
    })();
}
//pbkdf
function commonPBKDFInterceptor() {
    //int
    // CCKeyDerivationPBKDF( CCPBKDFAlgorithm algorithm, const char *password, size_t passwordLen,
    //                       const uint8_t *salt, size_t saltLen,
    //                       CCPseudoRandomAlgorithm prf, uint rounds,
    //                       uint8_t *derivedKey, size_t derivedKeyLen)
    let CCKeyDerivationPBKDF = Module.findExportByName("libSystem.B.dylib", "CCKeyDerivationPBKDF");
    if (CCKeyDerivationPBKDF == null) {
        console.error("CCKeyDerivationPBKDF func is null");
        return;
    }
    Interceptor.attach(CCKeyDerivationPBKDF, {
        onEnter: function (args) {
            this.params = [];
            for (let i = 0; i < 9; i++) {
                this.params.push(args[i]);
            }
        },
        onLeave: function (reval) {
            var log = "";
            log = log.concat(COLORS.green, "[*] ENTER CCKeyDerivationPBKDF", COLORS.resetColor, "\n");
            log = log.concat(COLORS.yellow, "[+] Algorithm: ", CCPBKDFAlgorithm[this.params[0].toInt32()], "\n", COLORS.resetColor);
            log = log.concat(COLORS.yellow, "[+] PseudoRandomAlgorithm: ", CCPseudoRandomAlgorithm[this.params[5].toInt32()], "\n", COLORS.resetColor);
            log = log.concat(COLORS.cyan, "[+] Rounds: ", String(pointerToInt(this.params[6])), "\n", COLORS.resetColor);
            log = log.concat(COLORS.cyan, "[+] Password len: ", this.params[2].toInt32(), "\n");
            log = log.concat(COLORS.cyan, "[+] Password : \n", print_arg(this.params[1], this.params[2].toInt32()), "\n", COLORS.resetColor);
            log = log.concat(COLORS.cyan, "[+] Salt len: ", this.params[4].toInt32(), "\n");
            log = log.concat(COLORS.cyan, "[+] Salt : \n", print_arg(this.params[3], this.params[4].toInt32()), "\n", COLORS.resetColor);
            log = log.concat(COLORS.cyan, "[+] DerivedKey len: ", this.params[8].toInt32(), "\n");
            log = log.concat(COLORS.cyan, "[+] DerivedKey : \n", print_arg(this.params[7], this.params[8].toInt32()), "\n", COLORS.resetColor);
            if (CIPHER_CONFIG.pbkdf.printStack) {
                log = log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
            }
            log = log.concat(COLORS.green, "[*] EXIT CCKeyDerivationPBKDF", COLORS.resetColor, "\n");
            filterLog(log, CIPHER_CONFIG.pbkdf.filter);
        }
    });
    //uint
    // CCCalibratePBKDF(CCPBKDFAlgorithm algorithm, size_t passwordLen, size_t saltLen,
    //                  CCPseudoRandomAlgorithm prf, size_t derivedKeyLen, uint32_t msec)
    let CCCalibratePBKDF = Module.findExportByName("libSystem.B.dylib", "CCCalibratePBKDF");
    if (CCCalibratePBKDF == null) {
        console.error("CCCalibratePBKDF func is null");
        return;
    }
    Interceptor.attach(CCCalibratePBKDF, {
        onEnter: function (args) {
            this.log = "";
            this.log = this.log.concat(COLORS.green, "[*] ENTER CCCalibratePBKDF", COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.yellow, "[+] Algorithm: ", CCPBKDFAlgorithm[args[0].toInt32()], "\n", COLORS.resetColor);
            this.log = this.log.concat(COLORS.yellow, "[+] PseudoRandomAlgorithm: ", CCPseudoRandomAlgorithm[args[3].toInt32()], "\n", COLORS.resetColor);
            this.log = this.log.concat(COLORS.cyan, "[+] Password len: ", args[1].toInt32(), COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.cyan, "[+] Salt len: ", args[2].toInt32(), COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.cyan, "[+] DerivedKey len: ", args[4].toInt32(), COLORS.resetColor, "\n");
            this.log = this.log.concat(COLORS.cyan, "[+] Msec : ", pointerToInt(args[5]), COLORS.resetColor, "\n");
        },
        onLeave: function (reval) {
            this.log = this.log.concat(COLORS.cyan, "[+] IterNum : \n", pointerToInt(reval), COLORS.resetColor, "\n");
            if (CIPHER_CONFIG.pbkdf.printStack) {
                this.log = this.log.concat(COLORS.blue, "[+] stack:\n", Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n"), COLORS.resetColor, "\n");
            }
            this.log = this.log.concat(COLORS.green, "[*] EXIT CCCalibratePBKDF", COLORS.resetColor, "\n");
            filterLog(this.log, CIPHER_CONFIG.pbkdf.filter);
        }
    });
}
//start
(function () {
    if (!CIPHER_CONFIG.enable) {
        return;
    }
    if (CIPHER_CONFIG.crypto.enable) {
        commonCryptoInterceptor();
    }
    if (CIPHER_CONFIG.hash.enable) {
        if (CIPHER_CONFIG.hash.sha1) {
            //extern unsigned char *CC_SHA1(const void *data, CC_LONG len, unsigned char *md)
            commonHashInterceptor("CC_SHA1", 20);
        }
        if (CIPHER_CONFIG.hash.sha224) {
            //extern unsigned char *CC_SHA224(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_SHA224", 28);
        }
        if (CIPHER_CONFIG.hash.sha256) {
            //extern unsigned char *CC_SHA256(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_SHA256", 32);
        }
        if (CIPHER_CONFIG.hash.sha384) {
            //extern unsigned char *CC_SHA384(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_SHA384", 48);
        }
        if (CIPHER_CONFIG.hash.sha512) {
            //extern unsigned char *CC_SHA512(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_SHA512", 64);
        }
        if (CIPHER_CONFIG.hash.md2) {
            //extern unsigned char *CC_MD2(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_MD2", 16);
        }
        if (CIPHER_CONFIG.hash.md4) {
            //extern unsigned char *CC_MD4(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_MD4", 16);
        }
        if (CIPHER_CONFIG.hash.md5) {
            //extern unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned char *md);
            commonHashInterceptor("CC_MD5", 16);
        }
        if (CIPHER_CONFIG.hmac.enable) {
            commonHMACInterceptor();
        }
        if (CIPHER_CONFIG.pbkdf.enable) {
            commonPBKDFInterceptor();
        }
    }
})();
✄
{"version":3,"file":"FTMobileSDK.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/FTMobileSDK.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC1B,6DAA6D;IAC7D,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,oBAAoB,CAAC,CAAC,cAAc,EAAE;QAChG,OAAO,CAAC,IAAI;YACR,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,IAAI,CAAC,2EAA2E,SAAS,EAAE,CAAC,CAAA;QAEhG,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
✄
const test_FTMobileSDK = () => {
    // FTMobileSDK!-[FTUncaughtExceptionHandler handleException:]
    Interceptor.attach(ObjC.classes["FTUncaughtExceptionHandler"]["- handleException:"].implementation, {
        onEnter(args) {
            const exception = new ObjC.Object(args[2]);
            logw(`\nCalled FTMobileSDK!-[FTUncaughtExceptionHandler handleException:] \n\t${exception}`);
        }
    });
};
✄
{"version":3,"file":"LuaNativeBridge.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/LuaNativeBridge.ts"],"names":[],"mappings":"AACA,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAC9B,uDAAuD;IACvD,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,qCAAqC,CAAC,CAAC,cAAc,EAAE;QACtG,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;YAChD,IAAI,CAAC,4BAA4B,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,CAAA;YACtD,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChC,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
✄
const test_LuaNativeBridge = () => {
    // +[LuaNativeBridge callOC:withMethod:withJSONString:]
    Interceptor.attach(ObjC.classes["LuaNativeBridge"]["+ callOC:withMethod:withJSONString:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const json = new ObjC.Object(args[2]).toString();
            logw(`\nCalled LuaNativeBridge ${ins} ${sel} ${json}`);
            printBacktrace(this.context);
        }
    });
};
✄
{"version":3,"file":"NEHASDK.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/NEHASDK.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,GAAG,EAAE;IAEtB,mCAAmC;IACnC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC,cAAc,EAAE,IAAI,cAAc,CAAC,GAAG,EAAE;QACxG,IAAI,CAAC,qCAAqC,CAAC,CAAA;IAC/C,CAAC,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;AAEvC,CAAC,CAAA;AAED,gCAAgC;AAChC,iHAAiH;AACjH,4DAA4D;AAC5D,sCAAsC;AAEtC,iDAAiD;AACjD,iGAAiG;AACjG,sBAAsB;AACtB,oDAAoD;AACpD,mHAAmH;AACnH,QAAQ;AACR,KAAK"}
✄
const test_NEHASDK = () => {
    // // -[NEHASDK startWithSettings:]
    Interceptor.replace(ObjC.classes["NEHASDK"]["- startWithSettings:"].implementation, new NativeCallback(() => {
        logw(`\nCalled NEHASDK startWithSettings:`);
    }, "void", ["pointer", "pointer"]));
};
// -[NIMSDK registerWithOption:]
// Interceptor.replace(ObjC.classes["NIMSDK"]["- registerWithOption:"].implementation, new NativeCallback(() => {
//     logw(`\nCalled NIMSDK!-[NEHASDK startWithSettings:]`)
// }, "void", ["pointer", "pointer"]))
// NIMSDK!-[NIMPathManager createDirIfNotExists:]
// Interceptor.attach(ObjC.classes["NIMPathManager"]["- createDirIfNotExists:"].implementation, {
//     onEnter(args) {
//         const instance = new ObjC.Object(args[0])
//         logw(`\nCalled NIMSDK!-[NIMPathManager createDirIfNotExists:] ${instance}, ${asOcObjtoString(args[2])}`)
//     }
// })
✄
{"version":3,"file":"NSAlertController.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/NSAlertController.ts"],"names":[],"mappings":"AAAA,MAAM,kCAAkC,GAAG,GAAG,EAAE;IAE5C,mCAAmC;IACnC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC,CAAC,cAAc,EAAE;QAClF,OAAO,CAAC,IAAI;QACZ,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;QACjC,CAAC;KACJ,CAAC,CAAA;IAEF,+BAA+B;IAC/B,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,WAAW,CAAC,CAAC,cAAc,EAAE;QAC9E,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,IAAI,CAAC,8BAA8B,GAAG,EAAE,CAAC,CAAA;QAC7C,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,kCAAkC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACrE,CAAC;KACJ,CAAC,CAAA;AAEN,CAAC,CAAA"}
✄
const hook_NSAlertController_messageText = () => {
    // -[NSAlertController messageText]
    Interceptor.attach(ObjC.classes["NSAlertController"]["- messageText"].implementation, {
        onEnter(args) {
        },
        onLeave(retval) {
            logd(new ObjC.Object(retval));
        },
    });
    // -[UIAlertController message]
    Interceptor.attach(ObjC.classes["UIAlertController"]["- message"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            logw(`\nCalled UIAlertController ${ins}`);
        },
        onLeave(retval) {
            logw(`\nUIAlertController message => ${new ObjC.Object(retval)}`);
        }
    });
};
✄
{"version":3,"file":"NSFileManager.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/NSFileManager.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAEnC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,CAAC,cAAc,EAAE;QACpF,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACzC,OAAO,CAAC,IAAI,CAAC,0BAA0B,GAAG,IAAI,GAAG,sBAAsB,QAAQ,GAAG,CAAC,CAAA;QACvF,CAAC;KACJ,CAAC,CAAA;IAEF,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,CAAC,cAAc,EAAE,IAAI,cAAc,CAAC,UAAU,IAAI,EAAE,IAAI,EAAE,IAAI;QAClI,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACjC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;QACvC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACtC,IAAI,CAAC,0BAA0B,GAAG,IAAI,GAAG,sBAAsB,QAAQ,GAAG,CAAC,CAAA;IAC/E,CAAC,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;AAElD,CAAC,CAAA"}
✄
export const hook_NSFileManager = () => {
    Interceptor.attach(ObjC.classes["NSFileManager"]["- fileExistsAtPath:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const nsstring = new ObjC.Object(args[3]);
            console.warn(`\nCalled NSFileManager ${ins} ${sel} fileExistsAtPath:'${nsstring}'`);
        }
    });
    Interceptor.replace(ObjC.classes["NSFileManager"]["- fileExistsAtPath:"].implementation, new NativeCallback(function (arg0, arg1, arg2) {
        const ins = new ObjC.Object(arg0);
        const sel = ObjC.selectorAsString(arg1);
        const nsstring = new ObjC.Object(arg2);
        logw(`\nCalled NSFileManager ${ins} ${sel} fileExistsAtPath:'${nsstring}'`);
    }, "void", ["pointer", "pointer", "pointer"]));
};
✄
{"version":3,"file":"NSObject.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/NSObject.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,iGAAiG;IACjG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,4DAA4D,CAAC,CAAC,cAAc,EAAE;QACtH,OAAO,CAAC,IAAI;YACR,IAAI,CAAC,qCAAqC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;YACjM,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChC,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
✄
export const NSObject_onThread = () => {
    // -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:]
    Interceptor.attach(ObjC.classes["NSObject"]["- performSelector:onThread:withObject:waitUntilDone:modes:"].implementation, {
        onEnter(args) {
            logw(`\nCalled NSObject performSelector:${ObjC.selectorAsString(args[2])} onThread:${new ObjC.Object(args[3])} withObject:${new ObjC.Object(args[4])} waitUntilDone:${args[5]} modes:${args[6]}`);
            printBacktrace(this.context);
        }
    });
};
✄
{"version":3,"file":"NSProcessInfo.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/NSProcessInfo.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAEnC,+BAA+B;IAC/B,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC,cAAc,EAAE;QAC9E,OAAO,CAAC,MAAM;YACV,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,EAAE,CAAA;YACpD,IAAI,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,eAAe,CAAC,EAAE,CAAA;YACrD,IAAI,CAAC,oCAAoC,MAAM,UAAU,OAAO,EAAE,CAAC,CAAA;YACnE,OAAO,CAAC,uBAAuB,CAAC,CAAC,uBAAuB,CAAC,CAAA;YACzD,OAAO,CAAC,qBAAqB,CAAC,CAAC,uBAAuB,EAAE,kCAAkC,CAAC,CAAA;QAE/F,CAAC;KACJ,CAAC,CAAA;IAEF,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAA;IAG9C,+BAA+B;IAC/B,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC,cAAc,EAAE;QAC9E,OAAO,CAAC,MAAM;YACV,IAAI,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,EAAE,CAAA;YACxD,IAAI,CAAC,oCAAoC,MAAM,UAAU,OAAO,EAAE,CAAC,CAAA;YACnE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC5B,OAAO,CAAC,uBAAuB,CAAC,CAAC,uBAAuB,CAAC,CAAA;YACzD,8FAA8F;YAC9F,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YACvB,eAAe,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;KACJ,CAAC,CAAA;IAEF,+EAA+E;IAE/E,iDAAiD;IACjD,gHAAgH;IAChH,6BAA6B;IAC7B,6BAA6B;IAC7B,yGAAyG;IACzG,qFAAqF;IACrF,kDAAkD;IAClD,kCAAkC;IAClC,8BAA8B;IAC9B,2BAA2B;IAC3B,sHAAsH;IAGtH,kDAAkD;IAClD,gHAAgH;IAChH,8BAA8B;IAC9B,6BAA6B;IAC7B,yGAAyG;IACzG,sHAAsH;IACtH,2BAA2B;IAC3B,kCAAkC;IAClC,qFAAqF;IACrF,6BAA6B;IAC7B,iDAAiD;IACjD,sEAAsE;AAC1E,CAAC,CAAA"}
✄
export const hook_NSProcessInfo = () => {
    // +[NSProcessInfo processInfo]
    Interceptor.attach(ObjC.classes["NSProcessInfo"]["+ processInfo"].implementation, {
        onLeave(retval) {
            let env = new ObjC.Object(retval)["- environment"]();
            let env_mut = new ObjC.Object(env)["- mutableCopy"]();
            logd(`called NSProcessInfo.processInfo ${retval} | env:${env_mut}`);
            env_mut["- removeObjectForKey:"]("DYLD_INSERT_LIBRARIES");
            env_mut["- setObject:forKey:"]("DYLD_INSERT_LIBRARIES", "/usr/lib/substitute-loader.dylib");
        }
    });
    ObjC.classes["NSProcessInfo"]["+ processInfo"];
    // -[NSProcessInfo environment]
    Interceptor.attach(ObjC.classes["NSProcessInfo"]["- environment"].implementation, {
        onLeave(retval) {
            var env_mut = new ObjC.Object(retval)["- mutableCopy"]();
            logd(`called NSProcessInfo.processInfo ${retval} | env:${env_mut}`);
            printBacktrace(this.context);
            env_mut["- removeObjectForKey:"]("DYLD_INSERT_LIBRARIES");
            // env_mut["- setObject:forKey:"]("/usr/lib/substitute-loader.dylib", "DYLD_INSERT_LIBRARIES")
            retval.replace(env_mut);
            printDictionary(retval);
        }
    });
    // LOGJSON(Process.findModuleByAddress(DebugSymbol.fromName("getenv").address))
    // Key: __CF_USER_TEXT_ENCODING, Value: 0x1F5:0:0
    // Key: TMPDIR, Value: /private/var/mobile/Containers/Data/Application/DEB6BEC0-1A22-493D-95D2-A09FF71B8F7F/tmp/
    // Key: XPC_FLAGS, Value: 0x0
    // Key: SHELL, Value: /bin/sh
    // Key: HOME, Value: /private/var/mobile/Containers/Data/Application/DEB6BEC0-1A22-493D-95D2-A09FF71B8F7F
    // Key: XPC_SERVICE_NAME, Value: UIKitApplication:com.kldlz.ios.sqhd[a1a2][rb-legacy]
    // Key: PATH, Value: /usr/bin:/bin:/usr/sbin:/sbin
    // Key: CLASSIC_OVERRIDE, Value: 0
    // Key: LOGNAME, Value: mobile
    // Key: USER, Value: mobile
    // Key: CFFIXED_USER_HOME, Value: /private/var/mobile/Containers/Data/Application/DEB6BEC0-1A22-493D-95D2-A09FF71B8F7F
    // Key: PATH, Value: /usr/bin:/bin:/usr/sbin:/sbin
    // Key: TMPDIR, Value: /private/var/mobile/Containers/Data/Application/DEB6BEC0-1A22-493D-95D2-A09FF71B8F7F/tmp/
    // Key: LOGNAME, Value: mobile
    // Key: XPC_FLAGS, Value: 0x0
    // Key: HOME, Value: /private/var/mobile/Containers/Data/Application/DEB6BEC0-1A22-493D-95D2-A09FF71B8F7F
    // Key: CFFIXED_USER_HOME, Value: /private/var/mobile/Containers/Data/Application/DEB6BEC0-1A22-493D-95D2-A09FF71B8F7F
    // Key: USER, Value: mobile
    // Key: CLASSIC_OVERRIDE, Value: 0
    // Key: XPC_SERVICE_NAME, Value: UIKitApplication:com.kldlz.ios.sqhd[0d5f][rb-legacy]
    // Key: SHELL, Value: /bin/sh
    // Key: __CF_USER_TEXT_ENCODING, Value: 0x1F5:0:0
    // Key: DYLD_INSERT_LIBRARIES, Value: /usr/lib/substitute-loader.dylib
};
✄
{"version":3,"file":"SBIcon.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/SBIcon.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,GAAG,EAAE;IAErB,sCAAsC;IACtC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,mBAAmB,CAAC,CAAC,cAAc,EAAE;QACrF,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,IAAI,CAAC,6BAA6B,GAAG,IAAI,GAAG,EAAE,CAAC,CAAA;QACnD,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,yCAAyC,MAAM,EAAE,CAAC,CAAA;QAC3D,CAAC;KACJ,CAAC,CAAA;IAEF,iCAAiC;IACjC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,wBAAwB,CAAC,CAAC,cAAc,EAAE;QAChF,OAAO,CAAC,IAAI;YACR,MAAM,GAAG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AC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAA;YAC7H,GAAG,CAAC,IAAI,CAAC,CAAA;QACb,CAAC;KACJ,CAAC,CAAA;IAEF,mCAAmC;IACnC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAAC,cAAc,EAAE;QAClF,OAAO,CAAC,IAAI;YACR,IAAI,CAAC,qCAAqC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACxD,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,oCAAoC,MAAM,EAAE,CAAC,CAAA;QACtD,CAAC;KACJ,CAAC,CAAA;IAEF,oCAAoC;IACpC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,aAAa,CAAC,CAAC,cAAc,EAAE;QACnF,OAAO,CAAC,IAAI;YACR,OAAO,CAAC,IAAI,CAAC,sCAAsC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACjE,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;gBACxC,OAAO,CAAC,IAAI;oBACR,OAAO,CAAC,IAAI,CAAC,CAAA;gBACjB,CAAC;gBACD,UAAU;gBAEV,CAAC;aACJ,CAAC,CAAA;QACN,CAAC;KACJ,CAAC,CAAA;AAGN,CAAC,CAAA"}
✄
const test_SBIcon = () => {
    // -[SBIconController allowsUninstall]
    Interceptor.attach(ObjC.classes["SBIconController"]["- allowsUninstall"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            loge(`\nCalled SBIconController ${ins} ${sel}`);
        },
        onLeave(retval) {
            loge(`\nSBIconController allowsUninstall => ${retval}`);
        }
    });
    // -[SBIcon isUninstallSupported]
    Interceptor.attach(ObjC.classes["SBIcon"]["- isUninstallSupported"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            loge(`\nCalled SBIcon ${ins}`);
        },
        onLeave(retval) {
            loge(`\SBIcon isUninstallSupported => ${retval}`);
        }
    });
    // -[SBHIconManager removeIcon:0x2815e5680 options:0x1 completion:0x16d556400]
    Interceptor.attach(ObjC.classes["SBHIconManager"]["- removeIcon:options:completion:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            logd(`\nCalled SBHIconManager ${ins} ${args[2]} ${args[3]} ${args[4]}`);
            printBacktrace(this.context);
        }
    });
    // -[SBIconListModel icons]
    Interceptor.attach(ObjC.classes["SBIconListModel"]["- icons"].implementation, {
        onEnter(args) {
        },
        onLeave(retval) {
            // lfs(retval)   
            const arr = new ObjC.Object(retval);
            const c = Number.parseInt(arr["- count"]());
            let m = c;
            for (let i = 0; i < m; i++) {
                logw(arr["- objectAtIndex:"](i));
            }
        }
    });
    // -[MCRemoveProfileViewController initWithProfile:0x28063ce00]
    Interceptor.attach(ObjC.classes["MCRemoveProfileViewController"]["- initWithProfile:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            logd(`\nCalled MCRemoveProfileViewController ${ins} ${args[2]}`);
            printBacktrace(this.context);
        }
    });
    // -[MCInstallProfileViewController initWithProfile:0x283058fc0 viewMode:0x1]
    Interceptor.attach(ObjC.classes["MCInstallProfileViewController"]["- initWithProfile:viewMode:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            logd(`\nCalled MCInstallProfileViewController ${ins} ${args[2]} ${args[3]}`);
            printBacktrace(this.context);
        }
    });
    // -[MCInstallProfileViewController initWithInstallableProfileData:fromSource:]
    Interceptor.attach(ObjC.classes["MCInstallProfileViewController"]["- initWithInstallableProfileData:fromSource:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            logd(`\nCalled MCInstallProfileViewController ${ins} ${args[2]} ${args[3]}`);
            printBacktrace(this.context);
        }
    });
    // -[_UIContextMenuActionsListView setDelegate:0x109246440]
    Interceptor.attach(ObjC.classes["_UIContextMenuActionsListView"]["- setDelegate:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const setDelegate = new ObjC.Object(args[2]);
            logz(`\nCalled _UIContextMenuActionsListView ${ins} ${sel} \nsetDelegate:'${setDelegate}'`);
            // lfs(args[2])
        }
    });
    // -[SBBookmark iconCompleteUninstall:0x280aa2b80]
    Interceptor.attach(ObjC.classes["SBBookmark"]["- iconCompleteUninstall:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const s = new ObjC.Object(args[2]);
            logz(`\nCalled SBBookmark ${ins} ${sel} \iconCompleteUninstall:'${s}'`);
            let logs = `called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`;
            log(logs);
        }
    });
    // -[SBIconListModel numberOfIcons]
    Interceptor.attach(ObjC.classes["SBIconListModel"]["- numberOfIcons"].implementation, {
        onEnter(args) {
            logw(`SBIconListModel numberOfIcons ins ${args[0]}`);
        },
        onLeave(retval) {
            logw(`SBIconListModel numberOfIcons => ${retval}`);
        }
    });
    // -[SBRootFolderWithDock todayList]
    Interceptor.attach(ObjC.classes["SBRootFolderWithDock"]["- todayList"].implementation, {
        onEnter(args) {
            console.warn(`SBRootFolderWithDock todayList ins ${args[0]}`);
        },
        onLeave(retval) {
            ObjC.choose(ObjC.classes["SBBookmarkIcon"], {
                onMatch(item) {
                    LOGJSON(item);
                },
                onComplete() {
                }
            });
        }
    });
};
✄
{"version":3,"file":"SpringBoard.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/SpringBoard.ts"],"names":[],"mappings":"AAAA,0JAA0J;AAC1J,MAAM,OAAO,GAAG,GAAE,EAAE;IAEhB,wCAAwC;IACxC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,iBAAiB,CAAC,CAAC,cAAc,EAAE;QACvF,OAAO,CAAC,IAAI;YACR,IAAI,CAAC,iCAAiC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACrE,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC/C,CAAC;KACJ,CAAC,CAAA;IAEF,mDAAmD;IACnD,qDAAqD;IACrD,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC,cAAc,CAAC,CAAC,cAAc,EAAE;QACpG,OAAO,CAAC,IAAI;YACR,IAAI,CAAC,iDAAiD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACrF,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC/C,CAAC;KACJ,CAAC,CAAA;AAEN,CAAC,CAAA"}
✄
// /Users/lzy/Library/Developer/Xcode/iOS DeviceSupport/iPhone10,4 14.3 (18C66)/Symbols/System/Library/PrivateFrameworks/SplashBoard.framework/SplashBoard
const test_sb = () => {
    // -[XBLaunchStateRequest urlSchemeName]
    Interceptor.attach(ObjC.classes["XBLaunchStateRequest"]["- urlSchemeName"].implementation, {
        onEnter(args) {
            logd(`\nCalled XBLaunchStateRequest ${new ObjC.Object(args[0])}`);
        },
        onLeave(retval) {
            logd(`Returned ${new ObjC.Object(retval)}`);
        }
    });
    // frida-trace -U -p 12211 -m "*[XBApplication* *]"
    // -[XBApplicationLaunchCompatibilityInfo bundlePath]
    Interceptor.attach(ObjC.classes["XBApplicationLaunchCompatibilityInfo"]["- bundlePath"].implementation, {
        onEnter(args) {
            logd(`\nCalled XBApplicationLaunchCompatibilityInfo ${new ObjC.Object(args[0])}`);
        },
        onLeave(retval) {
            logd(`Returned ${new ObjC.Object(retval)}`);
        }
    });
};
✄
{"version":3,"file":"UITextField.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/UITextField.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,GAAE,EAAE;IAEzB,+BAA+B;IAC/B,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAA;IAC9E,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,CAAC,cAAc,EAAE;QAC9E,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,IAAI,CAAC,wBAAwB,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC,CAAA;YAExE,gBAAgB;YAChB,IAAI,CAAC,kBAAkB,GAAG,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAA;YAChD,IAAI,GAAG,CAAC,eAAe,CAAC,EAAE,IAAI,IAAI,EAAE;gBAChC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAA;gBACnD,kBAAkB;gBAClB,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,KAAK,CAAC,CAAA;aAC7D;QACL,CAAC;KACJ,CAAC,CAAA;IAEF,iDAAiD;IACjD,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,gCAAgC,CAAC,CAAC,cAAc,EAAE;QAC7F,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,IAAI,CAAC,wBAAwB,GAAG,IAAI,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACtG,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,CAAC,YAAY,MAAM,EAAE,CAAC,CAAA;QAC9B,CAAC;KACJ,CAAC,CAAA;IAEF,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,gCAAgC,CAAC,CAAC,cAAc,EAAE,IAAI,cAAc,CAC/G,UAAU,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM;QAChC,IAAI,CAAC,wBAAwB,IAAI,IAAI,GAAG,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC,CAAA;QAC/D,OAAO,GAAG,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;AAEpE,CAAC,CAAA"}
✄
const test_UITextField = () => {
    // -[UITextField textInputView]
    Module.load("/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore");
    Interceptor.attach(ObjC.classes["UITextField"]["- textInputView"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            logd(`\nCalled UITextField ${ins} ${sel} ${ins["- textInputTraits"]()}`);
            // - placeholder
            logw(`placeholder -> ${ins["- placeholder"]()}`);
            if (ins["- placeholder"]() == "密码") {
                ins["- textInputTraits"]()["- setKeyboardType:"](0);
                // secureTextEntry
                ins["- textInputTraits"]()["- setSecureTextEntry:"](false);
            }
        }
    });
    // noCopyTextField - canPerformAction:withSender:
    Interceptor.attach(ObjC.classes["UITextField"]["- canPerformAction:withSender:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            loge(`\nCalled UITextField ${ins} ${sel} ${asOcSELtoString(args[2])} ${new ObjC.Object(args[3])}`);
        },
        onLeave(retval) {
            logd(`Returned ${retval}`);
        }
    });
    Interceptor.replace(ObjC.classes["UITextField"]["- canPerformAction:withSender:"].implementation, new NativeCallback(function (self, sel, action, sender) {
        logd(`\nCalled UITextField ${self} ${sel} ${action} ${sender}`);
        return ptr(0);
    }, 'pointer', ['pointer', 'pointer', 'pointer', 'pointer']));
};
✄
{"version":3,"file":"getenv.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/getenv.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,GAAG,EAAE;IACrB,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAE,EAAE;QACzD,OAAO,CAAC,IAAI;YACR,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;YAC/B,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;YACZ,IAAI,CAAC,IAAI,uBAAuB,EAAE;gBAC9B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAA;aACjB;QACL,CAAC;QACD,OAAO,CAAC,MAAM;YACV,IAAI,IAAI,CAAC,EAAE,EAAE;gBACT,IAAI,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAA;gBAC1C,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBAC5B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;aACvB;YACD,IAAI,CAAC,mBAAmB,IAAI,CAAC,GAAG,OAAO,MAAM,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;QACtG,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
✄
const test_getenv = () => {
    Interceptor.attach(Module.findExportByName(null, "getenv"), {
        onEnter(args) {
            const s = args[0].readCString();
            this.msg = s;
            if (s == "DYLD_INSERT_LIBRARIES") {
                this.md = true;
            }
        },
        onLeave(retval) {
            if (this.md) {
                loge(`<= DYLD_INSERT_LIBRARIES ${retval}`);
                printBacktrace(this.context);
                retval.replace(NULL);
            }
            logd(`called getenv ( ${this.msg} => ${retval} | ${retval.isNull() ? "" : retval.readCString()})`);
        },
    });
};
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/include.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AACzB,OAAO,kBAAkB,CAAA;AACzB,OAAO,sBAAsB,CAAA;AAC7B,OAAO,eAAe,CAAA;AACtB,OAAO,cAAc,CAAA;AACrB,OAAO,kBAAkB,CAAA;AACzB,OAAO,wBAAwB,CAAA;AAC/B,OAAO,aAAa,CAAA;AACpB,OAAO,oBAAoB,CAAA;AAC3B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AACpB,OAAO,eAAe,CAAA"}
✄
import './SpringBoard.js';
import './UITextField.js';
import './LuaNativeBridge.js';
import './NSObject.js';
import './NEHASDK.js';
import './FTMobileSDK.js';
import './NSAlertController.js';
import './SBIcon.js';
import './NSFileManager.js';
import './NSProcessInfo.js';
import './getenv.js';
import './pthread_.js';
✄
{"version":3,"file":"pthread_.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/exp/pthread_.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAE9B,mGAAmG;IACnG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC5D,IAAI,CAAC,yBAAyB,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACjE,IAAI,IAAI,GAAG,iBAAiB,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAA;QACpH,GAAG,CAAC,IAAI,CAAC,CAAA;IACb,CAAC,CAAC,CAAA;IAEF,eAAe;IACf,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,cAAc,CAAE,EAAE;QAC/D,OAAO,CAAC,IAAI;YACR,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACxB,IAAI,CAAC,MAAM,OAAO,CAAC,kBAAkB,EAAE,sCAAsC,QAAQ,EAAE,CAAC,CAAA;QAC5F,CAAC;KACJ,CAAC,CAAA;AAEN,CAAC,CAAA"}
✄
export const hook_pthread_ = () => {
    // pthread_create(thread=0x283bada28, attr=0x283bad9e8, start_routine=0x184a3316c, arg=0x281fcbf00)
    A(Module.getExportByName(null, "pthread_create"), (args, ctx) => {
        logd(`called pthread_create ${DebugSymbol.fromAddress(args[2])}`);
        let logs = `called from:\n${Thread.backtrace(ctx, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`;
        log(logs);
    });
    // pthread_exit
    Interceptor.attach(Module.findExportByName(null, "pthread_exit"), {
        onEnter(args) {
            const exitCode = args[0];
            logw(`\n[${Process.getCurrentThreadId()}] Called pthread_exit \n\texitCode:${exitCode}`);
        }
    });
};
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/foundation/include.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AACnB,OAAO,eAAe,CAAA"}
✄
import './nslog.js';
import './nsbundle.js';
✄
{"version":3,"file":"nsbundle.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/foundation/nsbundle.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,GAAE,EAAE;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAA;AACpF,CAAC,CAAA;AAMD,UAAU,CAAC,oBAAoB,GAAG,oBAAoB,CAAA"}
✄
// NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
const get_BundleIdentifier = () => {
    return ObjC.classes["NSBundle"]["mainBundle"]()["bundleIdentifier"]().toString();
};
globalThis.get_BundleIdentifier = get_BundleIdentifier;
export {};
✄
{"version":3,"file":"nslog.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/foundation/nslog.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,GAAG,EAAE;IACjB,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAC9D,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC,0BAA0B,CAAC,CAAA;IAErD,WAAW,CAAC,MAAM,CAAC,OAAQ,EAAE;QACzB,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA,CAAC,WAAW;YAC3D,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;YAC5C,IAAI,QAAQ,GAAG,EAAE,CAAA;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACnC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;gBAC9B,QAAQ,IAAI,IAAI,CAAA;aACnB;YACD,IAAI,CAAC,UAAU,GAAG,MAAM,QAAQ,EAAE,CAAC,CAAA;QACvC,CAAC;KACJ,CAAC,CAAA;IAEF,sCAAsC;IACtC,yEAAyE;IACzE,gCAAgC;IAChC,wCAAwC;IACxC,yCAAyC;IACzC,QAAQ;IACR,KAAK;AACT,CAAC,CAAA;AAMD,UAAU,CAAC,OAAO,GAAG,OAAO,CAAA"}
✄
const B_NSLOG = () => {
    const address = Module.findExportByName("Foundation", "NSLog");
    if (!address)
        return loge("NSLog address not found!");
    Interceptor.attach(address, {
        onEnter(args) {
            const fmt = new ObjC.Object(args[0]).toString(); // NSString
            const count_args = fmt.split("%").length - 1;
            let args_str = '';
            for (let i = 1; i < count_args + 1; i++) {
                args_str += args[i].toString();
                args_str += ', ';
            }
            logd(`NSLog: ${fmt} | ${args_str}`);
        }
    });
    // if NSLog not working, enable this ↓
    // Interceptor.attach(Module.findExportByName("Foundation", "NSLogv")!, {
    //     onEnter: function(args) {
    //         logd("[*] NSLogv was called")
    //         logd(new ObjC.Object(args[0]))
    //     }
    // })
};
globalThis.B_NSLOG = B_NSLOG;
export {};
✄
{"version":3,"file":"NSOperationQueue.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/NSOperationQueue.ts"],"names":[],"mappings":"AAMA,UAAU,CAAC,qBAAqB,GAAG,GAAG,EAAE;IAEpC,+DAA+D;IAC/D,yDAAyD;IACzD,oCAAoC;IACpC,8CAA8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G,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC5H,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA"}
✄
globalThis.hook_NSOperationQueue = () => {
    // ------------------------------------------------------------
    // Name                    ->      addOperationWithBlock:
    // NumberOfArguments       ->      3
    // TypeEncoding            ->      v24@0:8@?16
    // ObjectMethod            ->      0x1f2029400
    // Implementation          ->      0x1b1289c0c | 0x54c0c
    // ReturnType
    //         ret:            v - void
    // ArgumentTypes
    //         args[0]:        @ - object
    //         args[1]:        : - selector
    //         args[2]:        @? - block
    // [NSOperationQueue addOperationWithBlock:]
    Interceptor.attach(ObjC.classes["NSOperationQueue"]["- addOperationWithBlock:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const blk = new ObjC.Block(args[2]);
            console.warn(`-[NSOperationQueue addOperationWithBlock] ${ins} ${sel} ${blk} @ ${args[2]}`);
            logz(`called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`);
        }
    });
    // [NSOperationQueue addOperation:]
    Interceptor.attach(ObjC.classes["NSOperationQueue"]["- addOperation:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const blk = new ObjC.Block(args[2]);
            console.warn(`-[NSOperationQueue addOperation] ${ins} ${sel} ${blk} @ ${args[2]}`);
            logz(`called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`);
        }
    });
    // ------------------------------------------------------------
    // Name                    ->      mainQueue
    // NumberOfArguments       ->      2
    // TypeEncoding            ->      @16@0:8
    // ObjectMethod            ->      0x1f202a2c8
    // Implementation          ->      0x1b1244e10 | 0xfe10
    // ReturnType
    //         ret:            @ - object
    // ArgumentTypes
    //         args[0]:        @ - object
    //         args[1]:        : - selector
    // [NSOperationQueue mainQueue]
    Interceptor.attach(ObjC.classes["NSOperationQueue"]["+ mainQueue"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            this.msg = `-[NSOperationQueue mainQueue] ${ins} ${sel}`;
        },
        onLeave(retval) {
            let msgL = this.msg;
            logd(`${new ObjC.Object(retval)} = ${msgL}`);
            logz(`called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`);
        },
    });
};
export {};
✄
{"version":3,"file":"NSURLSession.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/NSURLSession.ts"],"names":[],"mappings":"AAAA,UAAU,CAAC,YAAY,GAAG,CAAC,iBAA0B,IAAI,EAAE,EAAE;IACzD,IAAI,IAAI,CAAC,SAAS,EAAE;QAChB,IAAI;YACA,6BAA6B;YAC7B,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;YAC/C,6DAA6D;YAC7D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;YAE/C,8DAA8D;YAC9D,MAAM,yCAAyC,GAAG,YAAY,CAAC,0CAA0C,CAAC,CAAC,cAAc,CAAC;YAC1H,IAAI,yCAAyC,EAAE;gBAC3C,WAAW,CAAC,MAAM,CAAC,yCAAyC,EAAE;oBAC1D,OAAO,EAAE,UAAS,IAAI;wBAClB,IAAI,CAAC,mEAAmE,CAAC,CAAC;wBAC1E,8CAA8C;wBAC9C,qEAAqE;wBACrE,uCAAuC;wBACvC,0CAA0C;wBAE1C,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,8BAA8B;wBAExE,wBAAwB;wBACxB,IAAI;4BACA,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;4BACrC,MAA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CAAuC,CAAC,CAAC;KACjD;AAEL,CAAC,CAAA"}
✄
globalThis.hook_network = (printBackTrace = true) => {
    if (ObjC.available) {
        try {
            // Get the NSURLSession class
            const NSURLSession = ObjC.classes.NSURLSession;
            // Get the NSURLRequest class (to inspect the request object)
            const NSURLRequest = ObjC.classes.NSURLRequest;
            // Hook -[NSURLSession dataTaskWithRequest:completionHandler:]
            const dataTaskWithRequest_completionHandler_ptr = NSURLSession["- dataTaskWithRequest:completionHandler:"].implementation;
            if (dataTaskWithRequest_completionHandler_ptr) {
                Interceptor.attach(dataTaskWithRequest_completionHandler_ptr, {
                    onEnter: function (args) {
                        logw(`[+] -[NSURLSession dataTaskWithRequest:completionHandler:] called`);
                        // args[0] is the self (NSURLSession instance)
                        // args[1] is the selector (- dataTaskWithRequest:completionHandler:)
                        // args[2] is the NSURLRequest instance
                        // args[3] is the completion handler Block
                        const request = new ObjC.Object(args[2]); // Get the NSURLRequest object
                        // Print request details
                        try {
                            const url = request.URL().toString();
                            const method = request.HTTPMethod().toString();
                            const headers = request.allHTTPHeaderFields(); // NSDictionary
                            logd(`  URL: ${url}`);
                            logd(`  Method: ${method}`);
                            logd(`  Headers: ${headers}`); // Prints NSDictionary description
                            // Optional: Print HTTP body (be cautious with large bodies)
                            // const httpBody = request.HTTPBody(); // NSData
                            // if (!httpBody.isNull()) {
                            //     const bodyLength = httpBody.length();
                            //     logd(`  HTTP Body Length: ${bodyLength}`);
                            //     if (bodyLength > 0) {
                            //         const bodyBytes = Memory.readByteArray(httpBody.bytes(), Math.min(bodyLength, 128)); // Print first 128 bytes
                            //         logo("  HTTP Body (first 128 bytes hex):");
                            //         logz(hexdump(bodyBytes, { offset: 0, length: Math.min(bodyLength, 128), header: true, ansi: false }));
                            //         // Attempt to convert to string (if it's text data)
                            //         // try {
                            //         //     const bodyString = Memory.readUtf8String(httpBody.bytes(), Math.min(bodyLength, 512)); // Read up to 512 bytes as UTF8 string
                            //         //     logz(`  HTTP Body (string): ${bodyString}`);
                            //         // } catch (e) {
                            //         //     loge("  Error reading HTTP body as string:" + e);
                            //         // }
                            //     }
                            // }
                        }
                        catch (e) {
                            loge("  Error inspecting NSURLRequest:" + e);
                        }
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                    }
                    // No onLeave needed for this hook, as we are interested in the request creation
                });
                logd("[+] Successfully hooked -[NSURLSession dataTaskWithRequest:completionHandler:]");
            }
            else {
                logw("[-] Could not find implementation for -[NSURLSession dataTaskWithRequest:completionHandler:].");
            }
            // Optional: Hook other NSURLSession data task creation methods if needed
            // -[NSURLSession dataTaskWithURL:completionHandler:]
            // -[NSURLSession dataTaskWithRequest:]
            // -[NSURLSession dataTaskWithURL:]
            // Optional: Hook NSURLSessionTask resume method to see when the task starts
            const NSURLSessionTask = ObjC.classes.NSURLSessionTask;
            const resume_ptr = NSURLSessionTask["- resume"].implementation;
            if (resume_ptr) {
                Interceptor.attach(resume_ptr, {
                    onEnter: function (args) {
                        logw(`[+] -[NSURLSessionTask resume] called`);
                        // args[0] is the self (NSURLSessionTask instance)
                        // args[1] is the selector (- resume)
                        const task = new ObjC.Object(args[0]);
                        try {
                            const originalRequest = task.originalRequest(); // NSURLRequest
                            if (!originalRequest.isNull()) {
                                const url = originalRequest.URL().toString();
                                logd(`  Task URL: ${url}`);
                            }
                        }
                        catch (e) {
                            loge("  Error getting task original request:" + e);
                        }
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                    }
                });
                logd("[+] Successfully hooked -[NSURLSessionTask resume]");
            }
            else {
                logw("[-] Could not find implementation for -[NSURLSessionTask resume].");
            }
        }
        catch (e) {
            loge("[-] Error hooking network methods:" + e);
        }
    }
    else {
        loge("[-] Objective-C runtime not available");
    }
};
export {};
✄
{"version":3,"file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C;iBAAM;gBACH,IAAI,CAAC,mEAAmE,CAAC,CAAC;aAC7E;YAGD,qEAAqE;YACrE,qDAAqD;YACrD,mBAAmB;YACnB,sCAAsC;YACtC,oCAAoC;YACpC,4CAA4C;YAC5C,2EAA2E;YAC3E,+GAA+G;YAC/G,+DAA+D;YAC/D,yFAAyF;YACzF,YAAY;YACZ,UAAU;YACV,wDAAwD;YACxD,WAAW;YACX,iDAAiD;YACjD,IAAI;YAEJ,mDAAmD;YACnD,kBAAkB;YAClB,qCAAqC;YACrC,oCAAoC;YACpC,4CAA4C;YAC5C,gEAAgE;YAChE,oFAAoF;YACpF,YAAY;YACZ,UAAU;YACV,uDAAuD;YACvD,WAAW;YACX,gDAAgD;YAChD,IAAI;SAGP;aAAM;YACH,IAAI,CAAC,+EAA+E,CAAC,CAAC;SACzF;KAEJ;IAAC,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,qCAAqC,GAAG,CAAC,CAAC,CAAC;KACnD;AAEL,CAAC,CAAA"}
✄
globalThis.hook_socket_io = (printBackTrace = true) => {
    try {
        // Find the module where socket functions are located
        // Usually in libSystem.dylib or libc.dylib
        const module = Process.findModuleByName("libsystem_c.dylib");
        if (module) {
            logd(`[+] Found C standard library module: ${module.name}`);
            // Hook send
            const send_ptr = module.getExportByName("send");
            if (send_ptr) {
                Interceptor.attach(send_ptr, {
                    onEnter: function (args) {
                        logw(`[+] send called`);
                        // args[0] is int sockfd (socket file descriptor)
                        // args[1] is const void *buf (buffer to send)
                        // args[2] is size_t len (number of bytes to send)
                        // args[3] is int flags
                        const sockfd = args[0].toInt32();
                        const buf = args[1];
                        const len = args[2].toInt32();
                        const flags = args[3].toInt32();
                        logd(`  Socket FD: ${sockfd}`);
                        logd(`  Buffer address: ${buf}`);
                        logd(`  Length: ${len}`);
                        logd(`  Flags: ${flags}`);
                        // Optional: Print data being sent
                        if (!buf.isNull() && len > 0) {
                            try {
                                // const dataBytes = buf.readByteArray(Math.min(len, 128)); // Print first 128 bytes
                                logo("  Data sent (first 128 bytes hex):");
                                logz(hexdump(buf, { offset: 0, length: Math.min(len, 128), header: true, ansi: false }));
                                // Attempt to convert to string (if it's text data)
                                // try {
                                //     const dataString = Memory.readUtf8String(buf, Math.min(len, 512)); // Read up to 512 bytes as UTF8 string
                                //     logz(`  Data sent (string): ${dataString}`);
                                // } catch (e) {
                                //     loge("  Error reading data sent as string:" + e);
                                // }
                            }
                            catch (e) {
                                loge("  Error reading data sent:" + e);
                            }
                        }
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                    }
                    // onLeave can be used to check the return value (bytes sent)
                });
                logd("[+] Successfully hooked send");
            }
            else {
                logw("[-] Could not find symbol _send. Check module name or symbol.");
            }
            // Hook recv
            const recv_ptr = module.getExportByName("recv");
            if (recv_ptr) {
                Interceptor.attach(recv_ptr, {
                    onEnter: function (args) {
                        logw(`[+] recv called`);
                        // args[0] is int sockfd (socket file descriptor)
                        // args[1] is void *buf (buffer to receive into)
                        // args[2] is size_t len (buffer size)
                        // args[3] is int flags
                        const sockfd = args[0].toInt32();
                        const buf = args[1];
                        const len = args[2].toInt32();
                        const flags = args[3].toInt32();
                        logd(`  Socket FD: ${sockfd}`);
                        logd(`  Buffer address: ${buf}`);
                        logd(`  Buffer size: ${len}`);
                        logd(`  Flags: ${flags}`);
                        // We can't print the received data in onEnter, as it hasn't been read yet.
                        // We'll print it in onLeave.
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                        // Store buf address for onLeave
                        this.buf = buf;
                    },
                    onLeave: function (retval) {
                        // retval is the number of bytes received, or -1 on error
                        const bytesReceived = retval.toInt32();
                        logd(`[+] recv returned: ${bytesReceived} bytes`);
                        // Print received data if successful
                        if (bytesReceived > 0 && this.buf && !this.buf.isNull()) {
                            try {
                                const dataBytes = this.buf.readByteArray(Math.min(bytesReceived, 128)); // Print first 128 bytes
                                logo("  Data received (first 128 bytes hex):");
                                logz(hexdump(dataBytes, { offset: 0, length: Math.min(bytesReceived, 128), header: true, ansi: false }));
                                // Attempt to convert to string (if it's text data)
                                // try {
                                //     const dataString = Memory.readUtf8String(this.buf, Math.min(bytesReceived, 512)); // Read up to 512 bytes as UTF8 string
                                //     logz(`  Data received (string): ${dataString}`);
                                // } catch (e) {
                                //     loge("  Error reading data received as string:" + e);
                                // }
                            }
                            catch (e) {
                                loge("  Error reading data received:" + e);
                            }
                        }
                        logz("--------------------");
                    }
                });
                logd("[+] Successfully hooked recv");
            }
            else {
                logw("[-] Could not find symbol _recv. Check module name or symbol.");
            }
            // Hook sendto (for UDP)
            const sendto_ptr = module.getExportByName("sendto");
            if (sendto_ptr) {
                Interceptor.attach(sendto_ptr, {
                    onEnter: function (args) {
                        logw(`[+] sendto called`);
                        // args[0] is int sockfd
                        // args[1] is const void *buf
                        // args[2] is size_t len
                        // args[3] is int flags
                        // args[4] is const struct sockaddr *dest_addr
                        // args[5] is socklen_t addrlen
                        const sockfd = args[0].toInt32();
                        const buf = args[1];
                        const len = args[2].toInt32();
                        const flags = args[3].toInt32();
                        const dest_addr = args[4];
                        const addrlen = args[5].toInt32();
                        logd(`  Socket FD: ${sockfd}`);
                        logd(`  Buffer address: ${buf}`);
                        logd(`  Length: ${len}`);
                        logd(`  Flags: ${flags}`);
                        logd(`  Destination address address: ${dest_addr}`);
                        logd(`  Address length: ${addrlen}`);
                        // Optional: Print destination address details (requires parsing sockaddr structure)
                        if (!dest_addr.isNull() && addrlen >= 2) { // Minimum size for sockaddr_in/sockaddr_in6
                            try {
                                const sa_family = dest_addr.readU16(); // sa_family_t
                                logd(`  Address Family: ${sa_family === 2 ? 'AF_INET' : (sa_family === 30 ? 'AF_INET6' : 'Unknown')}`);
                                if (sa_family === 2 && addrlen >= 16) { // sockaddr_in
                                    const sin_port = dest_addr.add(2).readU16(); // Port is at offset 2
                                    // const sin_addr = dest_addr.add(4).readByteArray(4); // IP address is at offset 4
                                    // logd(`  Destination Port (AF_INET): ${socket.ntohs(sin_port)}`); // Convert network byte order to host byte order
                                    // logd(`  Destination IP (AF_INET): ${sin_addr.join('.')}`); // Simple representation
                                }
                                else if (sa_family === 30 && addrlen >= 28) { // sockaddr_in6
                                    const sin6_port = dest_addr.add(2).readU16(); // Port is at offset 2
                                    // IPv6 address is at offset 8, 16 bytes
                                    const sin6_addr = dest_addr.add(8).readByteArray(16);
                                    //  logd(`  Destination Port (AF_INET6): ${socket.ntohs(sin6_port)}`);
                                    // More complex to represent IPv6 hex string
                                }
                            }
                            catch (e) {
                                loge("  Error parsing destination address:" + e);
                            }
                        }
                        // Optional: Print data being sent (same as send)
                        if (!buf.isNull() && len > 0) {
                            try {
                                // const dataBytes = buf.readByteArray(Math.min(len, 128)); // Print first 128 bytes
                                logo("  Data sent (first 128 bytes hex):");
                                logz(hexdump(buf, { offset: 0, length: Math.min(len, 128), header: true, ansi: false }));
                            }
                            catch (e) {
                                loge("  Error reading data sent:" + e);
                            }
                        }
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                    }
                    // onLeave can be used to check the return value (bytes sent)
                });
                logd("[+] Successfully hooked sendto");
            }
            else {
                logw("[-] Could not find symbol _sendto. Check module name or symbol.");
            }
            // Hook recvfrom (for UDP)
            const recvfrom_ptr = module.getExportByName("recvfrom");
            if (recvfrom_ptr) {
                Interceptor.attach(recvfrom_ptr, {
                    onEnter: function (args) {
                        logw(`[+] recvfrom called`);
                        // args[0] is int sockfd
                        // args[1] is void *buf
                        // args[2] is size_t len
                        // args[3] is int flags
                        // args[4] is struct sockaddr *src_addr
                        // args[5] is socklen_t *addrlen
                        const sockfd = args[0].toInt32();
                        const buf = args[1];
                        const len = args[2].toInt32();
                        const flags = args[3].toInt32();
                        const src_addr = args[4]; // Pointer to sockaddr structure
                        const addrlen_ptr = args[5]; // Pointer to socklen_t
                        logd(`  Socket FD: ${sockfd}`);
                        logd(`  Buffer address: ${buf}`);
                        logd(`  Buffer size: ${len}`);
                        logd(`  Flags: ${flags}`);
                        logd(`  Source address address: ${src_addr}`);
                        logd(`  Address length pointer: ${addrlen_ptr}`);
                        // We can't print the received data or source address in onEnter.
                        // We'll print them in onLeave.
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                        // Store buf address, src_addr address, and addrlen_ptr for onLeave
                        this.buf = buf;
                        this.src_addr = src_addr;
                        this.addrlen_ptr = addrlen_ptr;
                    },
                    onLeave: function (retval) {
                        // retval is the number of bytes received, or -1 on error
                        const bytesReceived = retval.toInt32();
                        logd(`[+] recvfrom returned: ${bytesReceived} bytes`);
                        // Print received data if successful
                        if (bytesReceived > 0 && this.buf && !this.buf.isNull()) {
                            try {
                                const dataBytes = this.buf.readByteArray(Math.min(bytesReceived, 128)); // Print first 128 bytes
                                logo("  Data received (first 128 bytes hex):");
                                logz(hexdump(dataBytes, { offset: 0, length: Math.min(bytesReceived, 128), header: true, ansi: false }));
                            }
                            catch (e) {
                                loge("  Error reading data received:" + e);
                            }
                        }
                        // Print source address if successful and address buffer was provided
                        if (bytesReceived >= 0 && this.src_addr && !this.src_addr.isNull() && this.addrlen_ptr && !this.addrlen_ptr.isNull()) {
                            try {
                                const addrlen = this.addrlen_ptr.readU32(); // Read the actual address length written by recvfrom
                                if (addrlen >= 2) {
                                    const sa_family = this.src_addr.readU16();
                                    logd(`  Source Address Family: ${sa_family === 2 ? 'AF_INET' : (sa_family === 30 ? 'AF_INET6' : 'Unknown')}`);
                                    if (sa_family === 2 && addrlen >= 16) { // sockaddr_in
                                        const sin_port = this.src_addr.add(2).readU16();
                                        const sin_addr = this.src_addr.add(4).readByteArray(4);
                                        // logd(`  Source Port (AF_INET): ${socket.ntohs(sin_port)}`);
                                        logd(`  Source IP (AF_INET): ${sin_addr.join('.')}`);
                                    }
                                    else if (sa_family === 30 && addrlen >= 28) { // sockaddr_in6
                                        const sin6_port = this.src_addr.add(2).readU16();
                                        const sin6_addr = this.src_addr.add(8).readByteArray(16);
                                        // logd(`  Source Port (AF_INET6): ${socket.ntohs(sin6_port)}`);
                                        // More complex to represent IPv6 hex string
                                    }
                                }
                            }
                            catch (e) {
                                loge("  Error parsing source address:" + e);
                            }
                        }
                        logz("--------------------");
                    }
                });
                logd("[+] Successfully hooked recvfrom");
            }
            else {
                logw("[-] Could not find symbol _recvfrom. Check module name or symbol.");
            }
            // Optional: Hook write and read as they can also be used for sockets
            // const write_ptr = module.getExportByName("write");
            // if (write_ptr) {
            //     Interceptor.attach(write_ptr, {
            //         onEnter: function(args) {
            //             const fd = args[0].toInt32();
            //             // You need to determine if this file descriptor is a socket
            //             // This is complex and might require hooking socket creation functions (socket, accept, connect)
            //             // and keeping track of socket file descriptors.
            //             // If you can determine it's a socket, you can print data similar to send.
            //         }
            //     });
            //     logd("[+] Successfully hooked write (optional)");
            // } else {
            //     logw("[-] Could not find symbol _write.");
            // }
            // const read_ptr = module.getExportByName("read");
            // if (read_ptr) {
            //     Interceptor.attach(read_ptr, {
            //         onEnter: function(args) {
            //             const fd = args[0].toInt32();
            //             // Similar to write, determine if fd is a socket.
            //             // If it is, store buffer for onLeave and print data similar to recv.
            //         }
            //     });
            //     logd("[+] Successfully hooked read (optional)");
            // } else {
            //     logw("[-] Could not find symbol _read.");
            // }
        }
        else {
            loge("[-] Could not find C standard library module (libSystem.dylib or libc.dylib).");
        }
    }
    catch (e) {
        loge("[-] Error hooking socket functions:" + e);
    }
};
export {};
✄
{"version":3,"file":"UILabel.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/UILabel.ts"],"names":[],"mappings":"AAMA,UAAU,CAAC,YAAY,GAAG,GAAG,EAAE;IAE3B,sBAAsB;IACtB,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,cAAc,EAAE;QACrE,OAAO,CAAC,IAAI;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACzC,OAAO,CAAC,IAAI,CAAC,sBAAsB,GAAG,IAAI,GAAG,KAAK,QAAQ,GAAG,CAAC,CAAA;YAC9D,IAAI,CAAC,iBAAiB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC5H,CAAC;KACJ,CAAC,CAAA;AAEN,CAAC,CAAA"}
✄
globalThis.hook_UILabel = () => {
    // -[UILabel setText:]
    Interceptor.attach(ObjC.classes["UILabel"]["- setText:"].implementation, {
        onEnter(args) {
            const ins = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            const nsstring = new ObjC.Object(args[2]);
            console.warn(`-[UILabel setText] ${ins} ${sel} '${nsstring}'`);
            logz(`called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`);
        }
    });
};
export {};
✄
{"version":3,"file":"dialog.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/dialog.ts"],"names":[],"mappings":"AAAA,UAAU,CAAC,WAAW,GAAG,CAAC,iBAA0B,IAAI,EAAE,EAAE;IACxD,IAA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IAAI,CAAC,CAAC,CAAA;gCACjG,IAAI,CAAC,sBAAsB,CAAC,CAAA;6BAC/B;yBACJ;oBACL,CAAC;iBACJ,CAAC,CAAA;gBACF,IAAI,CAAC,8GAA8G,CAAC,CAAA;aACvH;iBAAM;gBACH,IAAI,CAAC,uGAAuG,CAAC,CAAA;aAChH;SAGJ;QAAC,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,8CAA8C,GAAG,CAAC,CAAC,CAAA;SAC3D;KACJ;SAAM;QACH,IAAI,CAAC,uCAAuC,CAAC,CAAA;KAChD;AAEL,CAAC,CAAA"}
✄
globalThis.hook_dialog = (printBackTrace = true) => {
    if (ObjC.available) {
        try {
            // Get the UIAlertController class
            const UIAlertController = ObjC.classes.UIAlertController;
            // Hook +[UIAlertController alertControllerWithTitle:message:preferredStyle:]
            const alertControllerWithTitle_ptr = UIAlertController["+ alertControllerWithTitle:message:preferredStyle:"].implementation;
            if (alertControllerWithTitle_ptr) {
                Interceptor.attach(alertControllerWithTitle_ptr, {
                    onEnter: function (args) {
                        logw(`[+] +[UIAlertController alertControllerWithTitle:message:preferredStyle:] called`);
                        // args[0] is the self (UIAlertController class)
                        // args[1] is the selector (+ alertControllerWithTitle:message:preferredStyle:)
                        // args[2] is the title (NSString)
                        // args[3] is the message (NSString)
                        // args[4] is the preferredStyle (UIAlertControllerStyle, an integer)
                        const title = new ObjC.Object(args[2]).toString();
                        const message = new ObjC.Object(args[3]).toString();
                        const preferredStyle = args[4].toInt32(); // 0 for ActionSheet, 1 for Alert
                        logw(`  Title: "${title}"`);
                        logd(`  Message: "${message}"`);
                        logd(`  Preferred Style: ${preferredStyle === 0 ? 'ActionSheet' : (preferredStyle === 1 ? 'Alert' : 'Unknown')}`);
                        if (printBackTrace) {
                            logo("Call Stack:");
                            logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                            logz("--------------------");
                        }
                    }
                });
                logd("[+] Successfully hooked +[UIAlertController alertControllerWithTitle:message:preferredStyle:]");
            }
            else {
                logw("[-] Could not find implementation for +[UIAlertController alertControllerWithTitle:message:preferredStyle:].");
            }
            // Optional: Hook -[UIViewController presentViewController:animated:completion:]
            // This hooks when the alert is actually presented
            const UIViewController = ObjC.classes.UIViewController;
            const presentViewController_ptr = UIViewController["- presentViewController:animated:completion:"].implementation;
            if (presentViewController_ptr) {
                Interceptor.attach(presentViewController_ptr, {
                    onEnter: function (args) {
                        // args[0] is the presenting UIViewController instance
                        // args[1] is the selector (- presentViewController:animated:completion:)
                        // args[2] is the viewControllerToPresent (UIViewController instance)
                        const viewControllerToPresent = new ObjC.Object(args[2]);
                        // Check if the presented view controller is a UIAlertController
                        if (viewControllerToPresent.isKindOfClass_(UIAlertController)) {
                            logw(`[+] -[UIViewController presentViewController:animated:completion:] called to present a UIAlertController`);
                            // You can get the title and message from the UIAlertController instance here
                            const title = viewControllerToPresent.title().toString();
                            const message = viewControllerToPresent.message().toString();
                            logd(`  Alert Title: "${title}"`);
                            logd(`  Alert Message: "${message}"`);
                            if (printBackTrace) {
                                logo("Call Stack:");
                                logz(Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n'));
                                logd("--------------------");
                            }
                        }
                    }
                });
                logd("[+] Successfully hooked -[UIViewController presentViewController:animated:completion:] for UIAlertController");
            }
            else {
                logw("[-] Could not find implementation for -[UIViewController presentViewController:animated:completion:].");
            }
        }
        catch (e) {
            loge("[-] Error hooking UIAlertController methods:" + e);
        }
    }
    else {
        loge("[-] Objective-C runtime not available");
    }
};
export {};
✄
{"version":3,"file":"dump.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/dump.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAEvC,IAAI,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAI,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAI,QAAQ,GAAG,UAAU,CAAC;AAC1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AG,GAAG,EAAE,CAAC,CAAC,CAAC;SAC9C;QACD,GAAG,IAAI,OAAO,CAAC;KAClB;IAED,IAAI,cAAc,IAAI,CAAC,CAAC,EAAE;QACtB,IAAI,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACjB,KAAM,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;QAC1C,KAAM,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC1B,KAAM,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACrC,KAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;KACvD;IAED,KAAM,CAAC,OAAO,CAAC,CAAC;IAChB,KAAM,CAAC,UAAU,CAAC,CAAC;IACnB,OAAO,UAAU,CAAA;AACrB,CAAC;AASD,UAAU,CAAC,UAAU,GAAG,UAAU,CAAA;AAClC,UAAU,CAAC,SAAS,GAAG,SAAS,CAAA"}
✄
Module.ensureInitialized('Foundation');
var FAT_MAGIC = 0xcafebabe;
var FAT_CIGAM = 0xbebafeca;
var MH_MAGIC = 0xfeedface;
var MH_CIGAM = 0xcefaedfe;
var MH_MAGIC_64 = 0xfeedfacf;
var MH_CIGAM_64 = 0xcffaedfe;
var LC_SEGMENT = 0x1;
var LC_SEGMENT_64 = 0x19;
var LC_ENCRYPTION_INFO = 0x21;
var LC_ENCRYPTION_INFO_64 = 0x2C;
var O_RDONLY = 0;
var O_WRONLY = 1;
var O_RDWR = 2;
var O_CREAT = 512;
var SEEK_SET = 0;
var SEEK_CUR = 1;
var SEEK_END = 2;
function allocStr(str) {
    return Memory.allocUtf8String(str);
}
function putStr(addr, str) {
    addr.writeUtf8String(str);
}
function getByteArr(addr, l) {
    addr.writeByteArray(l);
}
function getU8(addr) {
    return addr.readU8();
}
function putU8(addr, n) {
    addr.writeU8(n);
}
function getU16(addr) {
    return addr.readU16();
}
function putU16(addr, n) {
    addr.writeU16(n);
}
function getU32(addr) {
    return addr.readU32();
}
function putU32(addr, n) {
    addr.writeU32(n);
}
function getU64(addr) {
    return addr.readU64();
}
function putU64(addr, n) {
    addr.writeU64(n);
}
function getPt(addr) {
    return addr.readPointer();
}
function putPt(addr, n) {
    addr.writePointer(n);
}
function malloc(size) {
    return Memory.alloc(size);
}
function getExportFunction(type, name, ret, args) {
    var nptr;
    nptr = Module.findExportByName(null, name);
    if (nptr === null) {
        console.log("cannot find " + name);
        // return null;
        return () => { };
    }
    else {
        if (type === "f") {
            var funclet = new NativeFunction(nptr, ret, args);
            if (typeof funclet === "undefined") {
                console.log("parse error " + name);
                // return null;
                return () => { };
            }
            return funclet;
        }
        else if (type === "d") {
            var datalet = nptr.readPointer();
            if (typeof datalet === "undefined") {
                console.log("parse error " + name);
                // return null;
                return () => { };
            }
            return datalet;
        }
    }
}
var NSSearchPathForDirectoriesInDomains = getExportFunction("f", "NSSearchPathForDirectoriesInDomains", "pointer", ["int", "int", "int"]);
var wrapper_open = getExportFunction("f", "open", "int", ["pointer", "int", "int"]);
var read = getExportFunction("f", "read", "int", ["int", "pointer", "int"]);
var write = getExportFunction("f", "write", "int", ["int", "pointer", "int"]);
var lseek = getExportFunction("f", "lseek", "int64", ["int", "int64", "int"]);
var close = getExportFunction("f", "close", "int", ["int"]);
var remove = getExportFunction("f", "remove", "int", ["pointer"]);
var access = getExportFunction("f", "access", "int", ["pointer", "int"]);
var dlopen = getExportFunction("f", "dlopen", "pointer", ["pointer", "int"]);
function loadAllDynamicLibrary(app_path) {
    var defaultManager = ObjC.classes.NSFileManager.defaultManager();
    var errorPtr = Memory.alloc(Process.pointerSize);
    errorPtr.writePointer(NULL);
    var filenames = defaultManager.contentsOfDirectoryAtPath_error_(app_path, errorPtr);
    for (var i = 0, l = filenames.count(); i < l; i++) {
        var file_name = filenames.objectAtIndex_(i);
        var file_path = app_path.stringByAppendingPathComponent_(file_name);
        if (file_name.hasSuffix_(".framework")) {
            var bundle = ObjC.classes.NSBundle.bundleWithPath_(file_path);
            if (bundle.isLoaded()) {
                console.log("[frida-ios-dump]: " + file_name + " has been loaded. ");
            }
            else {
                if (bundle.load()) {
                    console.log("[frida-ios-dump]: Load " + file_name + " success. ");
                }
                else {
                    console.log("[frida-ios-dump]: Load " + file_name + " failed. ");
                }
            }
        }
        else if (file_name.hasSuffix_(".bundle") ||
            file_name.hasSuffix_(".momd") ||
            file_name.hasSuffix_(".strings") ||
            file_name.hasSuffix_(".appex") ||
            file_name.hasSuffix_(".app") ||
            file_name.hasSuffix_(".lproj") ||
            file_name.hasSuffix_(".storyboardc")) {
            continue;
        }
        else {
            var isDirPtr = Memory.alloc(Process.pointerSize);
            isDirPtr.writePointer(NULL);
            defaultManager.fileExistsAtPath_isDirectory_(file_path, isDirPtr);
            if (isDirPtr.readPointer().toInt32() == 1) {
                loadAllDynamicLibrary(file_path);
            }
            else {
                if (file_name.hasSuffix_(".dylib")) {
                    var is_loaded = 0;
                    for (var j = 0; j < modules.length; j++) {
                        if (modules[j].path.indexOf(file_name) != -1) {
                            is_loaded = 1;
                            console.log("[frida-ios-dump]: " + file_name + " has been dlopen.");
                            break;
                        }
                    }
                    if (!is_loaded) {
                        if (dlopen(allocStr(file_path.UTF8String()), 9)) {
                            console.log("[frida-ios-dump]: dlopen " + file_name + " success. ");
                        }
                        else {
                            console.log("[frida-ios-dump]: dlopen " + file_name + " failed. ");
                        }
                    }
                }
            }
        }
    }
}
function open(pathname, flags, mode) {
    if (typeof pathname == "string") {
        pathname = allocStr(pathname);
    }
    return wrapper_open(pathname, flags, mode);
}
function getDocumentDir() {
    var NSDocumentDirectory = 9;
    var NSUserDomainMask = 1;
    var npdirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, 1);
    return new ObjC.Object(npdirs).objectAtIndex_(0).toString();
}
function swap32(value) {
    value = pad(value.toString(16), 8);
    var result = "";
    for (var i = 0; i < value.length; i = i + 2) {
        result += value.charAt(value.length - i - 2);
        result += value.charAt(value.length - i - 1);
    }
    return parseInt(result, 16);
}
function pad(str, n) {
    return Array(n - str.length + 1).join("0") + str;
}
var modules = null;
function getAllAppModules() {
    modules = new Array();
    var tmpmods = Process.enumerateModules();
    for (var i = 0; i < tmpmods.length; i++) {
        if (tmpmods[i].path.indexOf(".app") != -1) {
            modules.push(tmpmods[i]);
        }
    }
    return modules;
}
export function dumpAllMd() {
    modules = getAllAppModules();
    var app_path = ObjC.classes.NSBundle.mainBundle().bundlePath();
    loadAllDynamicLibrary(app_path);
    // start dump
    modules = getAllAppModules();
    for (var i = 0; i < modules.length; i++) {
        console.log("start dump " + modules[i].path);
        var result = dumpModule(modules[i].path);
        send({ dump: result, path: modules[i].path });
    }
}
export function dumpModule(name) {
    if (modules == null) {
        modules = getAllAppModules();
    }
    var targetmod = null;
    for (var i = 0; i < modules.length; i++) {
        if (modules[i].path.indexOf(name) != -1) {
            targetmod = modules[i];
            break;
        }
    }
    if (targetmod == null) {
        console.log("Cannot find module");
        return;
    }
    var modbase = modules[i].base;
    var modsize = modules[i].size;
    var newmodname = modules[i].name;
    var newmodpath = getDocumentDir() + "/" + newmodname + ".fid";
    var oldmodpath = modules[i].path;
    if (!access(allocStr(newmodpath), 0)) {
        remove(allocStr(newmodpath));
    }
    var fmodule = open(newmodpath, O_CREAT | O_RDWR, 0);
    var foldmodule = open(oldmodpath, O_RDONLY, 0);
    if (fmodule == -1 || foldmodule == -1) {
        console.log("Cannot open file" + newmodpath);
        return;
    }
    var is64bit = false;
    var size_of_mach_header = 0;
    var magic = getU32(modbase);
    var cur_cpu_type = getU32(modbase.add(4));
    var cur_cpu_subtype = getU32(modbase.add(8));
    if (magic == MH_MAGIC || magic == MH_CIGAM) {
        is64bit = false;
        size_of_mach_header = 28;
    }
    else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
        is64bit = true;
        size_of_mach_header = 32;
    }
    var BUFSIZE = 4096;
    var buffer = malloc(BUFSIZE);
    read(foldmodule, buffer, BUFSIZE);
    var fileoffset = 0;
    var filesize = 0;
    magic = getU32(buffer);
    if (magic == FAT_CIGAM || magic == FAT_MAGIC) {
        var off = 4;
        var archs = swap32(getU32(buffer.add(off)));
        for (var i = 0; i < archs; i++) {
            var cputype = swap32(getU32(buffer.add(off + 4)));
            var cpusubtype = swap32(getU32(buffer.add(off + 8)));
            if (cur_cpu_type == cputype && cur_cpu_subtype == cpusubtype) {
                fileoffset = swap32(getU32(buffer.add(off + 12)));
                filesize = swap32(getU32(buffer.add(off + 16)));
                break;
            }
            off += 20;
        }
        if (fileoffset == 0 || filesize == 0)
            return;
        lseek(fmodule, 0, SEEK_SET);
        lseek(foldmodule, fileoffset, SEEK_SET);
        for (var i = 0; i < filesize / BUFSIZE; i++) {
            read(foldmodule, buffer, BUFSIZE);
            write(fmodule, buffer, BUFSIZE);
        }
        if (filesize % BUFSIZE) {
            read(foldmodule, buffer, filesize % BUFSIZE);
            write(fmodule, buffer, filesize % BUFSIZE);
        }
    }
    else {
        var readLen = 0;
        lseek(foldmodule, 0, SEEK_SET);
        lseek(fmodule, 0, SEEK_SET);
        while (readLen = read(foldmodule, buffer, BUFSIZE)) {
            write(fmodule, buffer, readLen);
        }
    }
    var ncmds = getU32(modbase.add(16));
    var off = size_of_mach_header;
    var offset_cryptid = -1;
    var crypt_off = 0;
    var crypt_size = 0;
    var segments = [];
    for (var i = 0; i < ncmds; i++) {
        var cmd = getU32(modbase.add(off));
        var cmdsize = getU32(modbase.add(off + 4));
        if (cmd == LC_ENCRYPTION_INFO || cmd == LC_ENCRYPTION_INFO_64) {
            offset_cryptid = off + 16;
            crypt_off = getU32(modbase.add(off + 8));
            crypt_size = getU32(modbase.add(off + 12));
        }
        off += cmdsize;
    }
    if (offset_cryptid != -1) {
        var tpbuf = malloc(8);
        putU64(tpbuf, 0);
        lseek(fmodule, offset_cryptid, SEEK_SET);
        write(fmodule, tpbuf, 4);
        lseek(fmodule, crypt_off, SEEK_SET);
        write(fmodule, modbase.add(crypt_off), crypt_size);
    }
    close(fmodule);
    close(foldmodule);
    return newmodpath;
}
globalThis.dumpModule = dumpModule;
globalThis.dumpAllMd = dumpAllMd;
✄
{"version":3,"file":"dyld.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/dyld.ts"],"names":[],"mappings":"AAAA,UAAU,CAAC,aAAa,GAAG,GAAG,EAAE;IAC5B,8BAA8B;IAC9B,kFAAkF;IAClF,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChD,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAED,UAAU,CAAC,wBAAwB,GAAG,GAAG,EAAE;IAEvC,IAAI,CAAC,gBAAgB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;IAElC,oBAAoB;IACpB,CAAC,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACvE,IAAI,CAAC,KAAK,OAAO,CAAC,kBAAkB,EAAE,oCAAoC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC1F,IAAI,CAAC,iBAAiB,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACnH,CAAC,CAAC,CAAA;IAEF,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;Q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C,CAAA;AAED,UAAU,CAAC,6CAA6C,GAAG,GAAG,EAAE;IAC5D,sLAAsL;IACtL,uLAAuL;IACvL,CAAC,CAAC,MAAM,CAAC,sCAAsC,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3E,IAAI,CAAC,4DAA4D,IAAI,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,iBAAiB,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IACrI,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAED,UAAU,CAAC,kBAAkB,GAAG,CAAC,IAAc,EAAE,EAAE;IAE/C,uBAAuB;IACvB,mEAAmE;IACnE,qDAAqD;IACrD,4DAA4D;IAC5D,kDAAkD;IAClD,8DAA8D;IAC9D,yEAAyE;IACzE,4CAA4C;IAC5C,KAAK;IAEL,mDAAmD;IACnD,MAAM,uBAAuB,GAAG,WAAW,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC,OAAO,CAAA;IACjG,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAC,uBAAuB,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IACnG,uBAAuB,CAAC,IAAI,cAAc,CAAC,UAAU,MAAM,EAAE,KAAK;QAC9D,IAAI,CAAC,qCAAqC,MAAM,IAAI,KAAK,EAAE,CAAC,CAAA;QAC5D,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACnB,OAAO,IAAI,CAAA;IACf,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;AAC1C,CAAC,CAAA"}
✄
globalThis.hook_dyld_log = () => {
    // dyld::log(char const*, ...)
    // logd(`getSym("dyld::log","dyld") = ${getSym("dyld::log", "dyld")![0].address}`)
    A(getSym("dyld::log", "dyld")[0].address, (args) => {
        logd(`dyld::log ${args[0].readCString()}`);
    });
};
globalThis.hook_dyld_get_image_name = () => {
    logw(`MAIN Process ${Process.id}`);
    // _dyld_image_count
    A(getSym("_dyld_image_count", "dyld")[0].address, undefined, (ret, ctx) => {
        logd(`[ ${Process.getCurrentThreadId()} ] \tcalled _dyld_image_count -> ${ret.toInt32()}`);
        logz(`called from:\n${Thread.backtrace(ctx, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\t\n')}\n`);
    });
    Interceptor.attach(getSym("_dyld_get_image_name", "dyld")[0].address, {
        onEnter(args) {
            this.msg = `_dyld_get_image_name( ${args[0]} | ${args[0].toInt32()} )`;
            this.index = args[0].toInt32();
        },
        onLeave(retval) {
            let mm = (`${retval} = ${this.msg}\t<-\t${retval.readCString()}`);
            let mm1 = mm.toLowerCase();
            if (this.index == 0 || mm1.includes("libsubstrate") || mm.includes("CepheiUI") || mm1.includes("substrate")
                || mm1.includes("substitute-loader.dylib") || mm1.includes("libsubstitute.0.dylib") || mm1.includes("libsubstrate.dylib")
                || mm1.includes("FridaAgent") || mm1.includes("FlyJB2.dylib") || mm1.includes("HideJB.dylib")
                || mm1.includes("Cephei") || mm1.includes("CepheiUI") || mm1.includes("zzzzzzzzzNotifyChroot.dylib")
                || mm1.includes("zzzzLiberty.dylib") || mm1.includes("Cephei") || mm1.includes("Cephei")) {
                const newStr = Memory.allocUtf8String(retval.readCString().replace("substrate", "sub").replace("stitute", "sub"));
                retval.replace(newStr);
                logw(mm + " | modify to " + retval.readCString());
                logz(`called from:\n${Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`);
            }
            else {
                logd(mm);
            }
        }
    });
};
// hook __mod_init_funcs
globalThis.hook_dyld_mod_init_funcs = (offset) => {
    logd(`called hook_dyld_mod_init_funcs | offset: ${findOffset()}`);
    // src/ImageLoaderMachO.cpp
    // void ImageLoaderMachO::doModInitFunctions(const LinkContext& context)
    // func(context.argc, context.argv, context.envp, context.apple, &context.programVars);
    function findOffset() {
        const addr = getSym("ImageLoaderMachO::doModInitFunctions", "dyld")[0].address;
        let maxInsItor = 200;
        let current = Instruction.parse(addr);
        const addr_helper = getSym("_ZN4dyld17gLibSystemHelpersE", "dyld")[0].address;
        while (--maxInsItor > 0) {
            // logw(`${current.address} ${current.address.sub(md?.base!)} ${current}`)
            if (current.mnemonic == "blr") {
                // loge(`${current.address} ${current.address.sub(md?.base!)} ${current}`)
                // check
                // 0x1042bf2c0 0x172c0 blr x24
                // 0x1042bf2c4 0x172c4 cbnz x22, #0x1042bf2ec
                // 0x1042bf2c8 0x172c8 adrp x8, #0x104314000
                // 0x1042bf2cc 0x172cc add x8, x8, #0x3c8
                const next_1 = Instruction.parse(current.next);
                const next_2 = Instruction.parse(next_1.next);
                const next_3 = Instruction.parse(next_2.next);
                if (next_2.mnemonic == "adrp" && next_3.mnemonic == "add") {
                    const v_2 = Number(next_2.operands.filter(i => i.type == "imm")[0].value);
                    const v_3 = Number(next_3.operands.filter(i => i.type == "imm")[0].value);
                    if (addr_helper.equals(v_2 + v_3))
                        return current.address;
                }
            }
            current = Instruction.parse(current.next);
        }
        return NULL;
    }
    const nopCall = new NativeCallback(() => {
        logd("nop call 'KSAdSDK!registerDyldCallback'");
    }, "void", []);
    // var first = true
    A(offset != undefined ? offset : findOffset(), (_args, ctx) => {
        const x24L = ctx.x24;
        const debuginfo = DebugSymbol.fromAddress(x24L).toString();
        logd(`call init -> ${x24L} | ${debuginfo}`);
        // if (debuginfo.includes("KSAdSDK!registerDyldCallback")) {
        //     (ctx as Arm64CpuContext).x24 = nopCall
        // }
        if (debuginfo.includes("Unity")) {
            sleep(100);
        }
        // A(x24L, (args)=>{logz(`Enter ${x24L}`)}, (ret)=>{logz(`Leave ${x24L}`)})
        // if(debuginfo.includes("MinShengCreditCard") && first) {
        //     first = false
        //     nopSysCall("MinShengCreditCard",true)
        // }
        // Interceptor.attach(x24L, {
        //     onEnter(args) {
        //         logz(`Enter ${x24L}`)
        //         Stalker.follow(Process.getCurrentThreadId(), {
        //             events: {
        //                 call: false,
        //                 // ret: false,
        //                 // exec: true,
        //                 // block: false,
        //                 // compile: false,
        //             },
        //             transform: function (iterator: StalkerArm64Iterator | StalkerArmIterator) {
        //                 let instruction = iterator.next()!
        //                 do {
        //                     let msg = `${DebugSymbol.fromAddress(instruction?.address as NativePointer)} ${instruction}`
        //                     if (instruction.toString().includes("svc")) {
        //                         loge(`${msg}`)
        //                         sleep(3)
        //                     } else {
        //                         logz(`${msg}`)
        //                     }
        //                     iterator.keep()
        //                 } while ((instruction = iterator.next()!) !== null)
        //             }
        //         })
        //     },
        //     onLeave(retval) {
        //         logz(`Leave ${x24L}`)
        //         Stalker.unfollow(Process.getCurrentThreadId())
        //     }
        // })
        // if (debuginfo.includes("UnityFramework") || debuginfo.includes("UnityFramework!0x12") || debuginfo.includes("UnityFramework!0xfc")) {
        // Stalker.follow(Process.getCurrentThreadId(), {
        //     events: {
        //         compile: true
        //     },
        //     onReceive: function (events) {
        //         const bbs = Stalker.parse(events, {
        //             stringify: false,
        //             annotate: false
        //         });
        //         logd("↓ Stalker trace ↓\n")
        //         logd(bbs.flat().map(item => DebugSymbol.fromAddress(ptr(item as unknown as string))).join('\n'));
        //     }
        // })
    });
};
// do __mod_init_funcs in this function ↓
globalThis.hook_dyld_doModInitFunctions = () => {
    // getInstallPath
    const sym_getInstallPath = getSym("getInstallPath", "dyld")[0].address;
    const func_getInstallPath = new NativeFunction(sym_getInstallPath, "pointer", ["pointer"]);
    // _ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
    // void ImageLoaderMachO::doModInitFunctions(const LinkContext& context)
    A(getSym("doModInitFunctions", "dyld")[0].address, (args) => {
        const installPath = func_getInstallPath(args[0]).readCString();
        logd(`Enter doModInitFunctions ImageLoaderMachO:${args[0]} LinkContext&:${args[1]}`);
        logw(`\t-> ${installPath}`);
        // hex(args[1])
    }, () => {
        logd(`Exit doModInitFunctions\n`);
    });
};
globalThis.hook_dyld_ImageLoader_findExportedSymbol = () => {
    // const ImageLoader::Symbol* ImageLoaderMachO::findExportedSymbol(const char* name, bool searchReExports, const char* thisPath, const ImageLoader** foundIn) const
    A(getSym("ImageLoaderMachO::findExportedSymbol", "dyld")[0].address, (args, _ctx, pv) => {
        pv.set('pv', `ImageLoaderMachO::findExportedSymbol( INS:${args[0]}, name=${args[1].readCString()}, searchReExports=${args[2]}, thisPath=${args[3].readCString()}, foundIn=${args[4]} )`);
    }, (retval, _ctx, pv) => {
        logd(`Sym*:${retval} = ${pv.get('pv')}`);
    });
};
globalThis.hook_dyld_ImageLoader_recursiveInitialization = () => {
    // 0x104401ed8 => ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&)
    // void recursiveInitialization(const LinkContext& context, mach_port_t this_thread, const char* pathToInitialize, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&);
    A(getSym("ImageLoader::recursiveInitialization", "dyld")[0].address, (args) => {
        logd(`called ImageLoader::recursiveInitialization( ImageLoader:${args[0]}, context:${args[1]}, this_thread:${args[2].toInt32()}`);
    });
};
globalThis.dyld_register_func = (func) => {
    // struct mach_header {
    //     uint32_t    magic;        /* mach magic number identifier */
    //     int32_t        cputype;    /* cpu specifier */
    //     int32_t        cpusubtype;    /* machine specifier */
    //     uint32_t    filetype;    /* type of file */
    //     uint32_t    ncmds;        /* number of load commands */
    //     uint32_t    sizeofcmds;    /* the size of all the load commands */
    //     uint32_t    flags;        /* flags */
    // };
    // const struct mach_header *header, intptr_t slide
    const addr_dyld_register_func = DebugSymbol.fromName("_dyld_register_func_for_add_image").address;
    const func_dyld_register_func = new NativeFunction(addr_dyld_register_func, "pointer", ['pointer']);
    func_dyld_register_func(new NativeCallback(function (header, slide) {
        logd(`_dyld_register_func_for_add_image ${header} ${slide}`);
        func(header, slide);
        return NULL;
    }, "pointer", ["pointer", "pointer"]));
};
export {};
✄
{"version":3,"file":"hooks.js","sourceRo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vB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;IACnE,IAAI,CAAC,yBAAyB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IAE7C,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA,EAAE;QACb,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE;YAC1B,OAAO,CAAC,IAAI;gBACR,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;gBACnD,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;gBACpC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,UAAU,GAAG,SAAS,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;gBAC9E,IAAI,CAAC,KAAK,QAAQ,CAAC,OAAO,OAAO,QAAQ,CAAC,UAAU,OAAO,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC,CAAA;YACvH,CAAC;SACJ,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AAEN,CAAC,CAAA;AAED,UAAU,CAAC,aAAa,GAAG,GAAE,EAAE;IAC3B,IAAI,CAAC,MAAM,CAAC,CAAA;AAChB,CAAC,CAAA"}
✄
globalThis.hooks = () => {
    const ptracePtr = Module.findExportByName(null, "ptrace");
    Interceptor.replace(ptracePtr, new NativeCallback(function () {
        logd("[*] Ptrace called and replaced");
        return 0;
    }, "int", []));
    const sysctlPtr = Module.findExportByName(null, "__sysctl");
    Interceptor.replace(sysctlPtr, new NativeCallback(function () {
        logd("[*] Sysctl called and replaced");
        return 0;
    }, "int", []));
};
// read_plist_file("/path/to/file/filename.plist")
globalThis.read_plist_file = (file_location) => {
    const dict = ObjC.classes.NSMutableDictionary;
    logd("[*] Read Plist File: " + file_location);
    logd("[*] File Contents:");
    logd(dict.alloc().initWithContentsOfFile_(file_location).toString());
};
//Credit: Objection (https://github.com/sensepost/objection/blob/master/objection/commands/ios/nsuserdefaults.py)
globalThis.read_NSUserDefaults = () => {
    logw("[*] Started: Read NSUserDefaults PLIST file");
    if (ObjC.available) {
        try {
            const NSUserDefaults = ObjC.classes.NSUserDefaults;
            const NSDictionary = NSUserDefaults.alloc().init().dictionaryRepresentation();
            logd(NSDictionary.toString());
        }
        catch (err) {
            logw("[!] Exception: " + err);
        }
    }
    else {
        logw("Objective-C Runtime is not available!");
    }
    logw("[*] Completed: Read NSUserDefaults PLIST file");
};
globalThis.hook_initialize = () => {
    const items = new ApiResolver("objc").enumerateMatches("+[* initialize]");
    logw(`GOT +[* initialize] | size: ${items.length}`);
    items.forEach(v => {
        Interceptor.attach(v.address, {
            onEnter(args) {
                const debugSym = DebugSymbol.fromAddress(v.address);
                const obj = new ObjC.Object(args[0]);
                logd(`called ${v.name} ( ins:${obj}, sel:${ObjC.selectorAsString(args[1])} )`);
                logz(`\t${debugSym.address} -> ${debugSym.moduleName} -> ${DebugSymbol.fromAddress(obj.$class.handle).moduleName}`);
            },
        });
    });
};
globalThis.hook_load = () => {
    const items = new ApiResolver("objc").enumerateMatches("+[* load]");
    logw(`GOT +[* load] | size: ${items.length}`);
    items.forEach(v => {
        Interceptor.attach(v.address, {
            onEnter(args) {
                const debugSym = DebugSymbol.fromAddress(v.address);
                const obj = new ObjC.Object(args[0]);
                logd(`called ${v.name} ( ins:${obj}, sel:${ObjC.selectorAsString(args[1])} )`);
                logz(`\t${debugSym.address} -> ${debugSym.moduleName} -> ${DebugSymbol.fromAddress(obj.$class.handle).moduleName}`);
            },
        });
    });
};
globalThis.hook_dispatch = () => {
    logw(`TODO`);
};
export {};
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/include.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA;AAClB,OAAO,cAAc,CAAA;AACrB,OAAO,uBAAuB,CAAA;AAC9B,OAAO,cAAc,CAAA;AACrB,OAAO,YAAY,CAAA;AACnB,OAAO,cAAc,CAAA;AACrB,OAAO,WAAW,CAAA;AAClB,OAAO,aAAa,CAAA;AACpB,OAAO,mBAAmB,CAAA;AAC1B,OAAO,aAAa,CAAA"}
✄
import './dyld.js';
import './libdyld.js';
import './NSOperationQueue.js';
import './UILabel.js';
import './hooks.js';
import './libobjc.js';
import './dump.js';
import './dialog.js';
import './NSURLSession.js';
import './Socket.js';
✄
{"version":3,"file":"libdyld.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/hooks/libdyld.ts"],"names":[],"mappings":"AAAA,UAAU,CAAC,WAAW,GAAG,CAAC,MAA2B,EAAE,iBAAuB,KAAK,EAAE,EAAE;IACnF,gDAAgD;IAChD,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE;QACrD,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;YAAE,OAAM;QACxB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;QAClC,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC1D,IAAI,cAAc;YAAE,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IACjJ,CAAC,EAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,EAAE;QAClB,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAA;QAC9B,IAAI,CAAC,GAAG,MAAM,MAAM,GAAG,EAAE,CAAC,CAAA;QAC1B,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAC;YAC1B,sHAAsH;YACtH,mGAAmG;YACnG,oBAAoB;YACpB,8BAA8B;YAE9B,SAAS;YACT,8EAA8E;YAC9E,oCAAoC;YAEpC,gBAAgB;YAChB,0DAA0D;YAC1D,mGAAmG;YACnG,oBAAoB;YACpB,8BAA8B;SACjC;IACL,CAAC,CACJ,CAAA;AACL,CAAC,CAAA"}
✄
globalThis.hook_dlopen = (onCall, printBackTrace = false) => {
    // void* dlopen(const char* filename, int flag);
    A(DebugSymbol.fromName("dlopen").address, (args, ctx, pv) => {
        if (args[0].isNull())
            return;
        const name = args[0].readCString();
        pv.set("msg", `dlopen ( ${args[0]} ${name}, ${args[1]} )`);
        if (printBackTrace)
            logw('dlopen called from:\n' + Thread.backtrace(ctx, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n') + '\n');
    }, (retval, _ctx, pv) => {
        const msg = `${pv.get("msg")}`;
        logd(`${retval} = ${msg}`);
        if (msg.includes("CFNetwork")) {
            // Interceptor.replace(Process.findModuleByName("TuanjieFramework")!.base.add(0x4AD380), new NativeCallback((arg) => {
            //     logw(`\n[${Process.getCurrentThreadId()}] Called TuanjieFramework!0x4AD380 \n\targs:${arg}`)
            //     return ptr(0)
            // }, "pointer", ["pointer"]))
            // 3A3F20
            // let addr = Process.findModuleByName("TuanjieFramework")!.base.add(0x3A2274)
            // // new Arm64Writer(addr).putRet()
            // // sub_3A2274
            // Interceptor.replace(addr, new NativeCallback((arg) => {
            //     logw(`\n[${Process.getCurrentThreadId()}] Called TuanjieFramework!0x3A2274 \n\targs:${arg}`)
            //     return ptr(0)
            // }, "pointer", ["pointer"]))
        }
    });
};
export {};
✄
{"version":3,"file":"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AAG,CAAC,SAAS,CAAC,EAAE,IAAI,cAAc,CAAC,GAAG,EAAE;oBACnE,IAAI,CAAC,kBAAkB,CAAC,CAAA;gBAC5B,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;aAGlB;QACL,CAAC;KACJ,CAAC,CAAA;AAEN,CAAC,CAAA"}
✄
globalThis.hook_load_images = () => {
    // DebugSymbol.fromName("load_images")
    // {
    //     "base": "0x1b14fc000",
    //     "name": "libobjc.A.dylib",
    //     "path": "/usr/lib/libobjc.A.dylib",
    //     "size": 221184
    // }
    Interceptor.attach(DebugSymbol.fromName("load_images").address, {
        onEnter(args) {
            const name = args[0].readCString();
            logd(`Called load_images( ${args[0]} -> ${args[0].readCString()} )`);
            if (name?.includes("UnityFramework")) {
                // showInfo()
                // saveModule("UnityFramework")
                // dumpModule("UnityFramework")
                // dumpAllMd()
                // Interceptor.replace(ObjC.classes.WindShareData["- initUserAgent"].implementation, new NativeCallback(() => {
                //     logd("nop initUserAgent")
                // }, "void", []))
                // // UnityFramework!-[BDASignalManager preGetCachedData]
                // Interceptor.replace(ObjC.classes.BDASignalManager["- preGetCachedData"].implementation, new NativeCallback(() => {
                //     logd("nop BDASignalManager preGetCachedData")
                // }, "void", []))
                // +[RMColdLaunchMonitor load]
                Interceptor.replace(ObjC.classes.RMColdLaunchMonitor["+ load"].implementation, new NativeCallback(() => {
                    logd("nop RMColdLaunchMonitor load");
                }, "void", []));
                const base = Process.findModuleByName("UnityFramework");
                LOGJSON(base);
                // 176C290                 EXPORT InitFunc_595
                // Interceptor.replace(base!.base.add(0x176C290), new NativeCallback(() => {
                //     logd("nop InitFunc_595")
                // }, "void", []))
                Interceptor.replace(base.base.add(0x1675d0c), new NativeCallback(() => {
                    logd("nop InitFunc_595");
                }, "void", []));
            }
        }
    });
};
export {};
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/include.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,mBAAmB,CAAA;AAC1B,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,kBAAkB,CAAA"}
✄
import "./cipher/cipher.js";
import './info/include.js';
import './foundation/include.js';
import './jailbreak/include.js';
import './service/include.js';
import './breaker/include.js';
import './lang/include.js';
import './hooks/include.js';
import './memory/include.js';
import './exp/include.js';
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/info/include.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA;AAClB,OAAO,WAAW,CAAA"}
✄
import './info.js';
import './itor.js';
✄
{"version":3,"file":"info.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/info/info.ts"],"names":[],"mappings":"AAEA,sCAAsC;AACtC,+BAA+B;AAC/B,oBAAoB;AACpB,2GAA2G;AAC3G,6CAA6C;AAE7C,SAAS,aAAa,CAAC,KAAc;IACjC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACf,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;IAChD,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;IAChD,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;IAChD,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;KAAE;IAAC,OAAO,GAAG,EAAE;QAAE,IAAI,KAAK,EAAE;YAAE,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG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AO,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9D,OAAO,EAAE,CAAA;AACb,CAAC,CAAA;AASD,UAAU,CAAC,QAAQ,GAAG,CAAC,YAAqB,KAAK,EAAE,EAAE;IACjD,YAAY,CAAC,aAAa,CAAC,CAAA;IAC3B,YAAY,CAAC,qBAAqB,CAAC,CAAA;IACnC,YAAY,CAAC,YAAY,CAAC,CAAA;IAC1B,YAAY,CAAC,kBAAkB,CAAC,CAAA;IAChC,gCAAgC;IAChC,YAAY,CAAC,+BAA+B,CAAC,CAAA;IAC7C,YAAY,CAAC,sBAAsB,CAAC,CAAA;IACpC,IAAI,SAAS,EAAE;QACX,YAAY,CAAC,qCAAqC,CAAC,CAAA;QACnD,YAAY,CAAC,qCAAqC,CAAC,CAAA;KACtD;AACL,CAAC,CAAA;AAED,wCAAwC;AACxC,kDAAkD;AAClD,UAAU,CAAC,kBAAkB,GAAG,GAAG,EAAE;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,CAAA;IACpF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;KAC3D;AACL,CAAC,CAAA"}
✄
//Script for iOS app's static analysis
//Author: Interference Security
//Twitter: xploresec
//Source: https://github.com/interference-security/frida-scripts/blob/master/iOS/ios-app-static-analysis.js
//Credits: Frida CodeShare Projects and MobSF
function app_meta_info(DEBUG) {
    console.log("");
    console.warn("--------------------------------");
    console.warn("|     App Meta Information     |");
    console.warn("--------------------------------");
    try {
        console.log("Bundle Name: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleName").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Display Name: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleDisplayName").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Executable Name: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleExecutable").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Bundle Identifier: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleIdentifier").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Info Dictionary Version: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleInfoDictionaryVersion").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Numeric Version: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleNumericVersion").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Short Version: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleShortVersionString").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Bundle Version: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleVersion").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Minimum OS Version: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("MinimumOSVersion").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Bundle Package Type: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundlePackageType").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("BuildMachineOSBuild: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("BuildMachineOSBuild").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("Development Region: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleDevelopmentRegion").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("iPhone Environment Required: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("LSRequiresIPhoneOS").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
}
function xcode_build_meta_info(DEBUG) {
    console.log("");
    console.warn("--------------------------------");
    console.warn("| Xcode Build Meta Information |");
    console.warn("--------------------------------");
    try {
        console.log("DTCompiler: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTCompiler").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTPlatformBuild: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTPlatformBuild").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTPlatformName: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTPlatformName").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTPlatformVersion: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTPlatformVersion").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTSDKBuild: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTSDKBuild").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTSDKName: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTSDKName").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTXcode: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTXcode").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    try {
        console.log("DTXcodeBuild: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("DTXcodeBuild").toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
    //try { console.log("NSAppTransportSecurity: " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").toString())
}
function app_env_info(DEBUG) {
    console.log("");
    console.warn("-----------------------------------");
    console.warn("|     Application Environment     |");
    console.warn("-----------------------------------");
    var mainBundlePath = String(ObjC.classes.NSBundle.mainBundle());
    mainBundlePath = mainBundlePath.substring(0, mainBundlePath.indexOf(">"));
    mainBundlePath = mainBundlePath.substring(mainBundlePath.indexOf("<") + 1);
    console.log("App Bundle Path    : " + mainBundlePath);
    //Credit: https://github.com/iddoeldor/frida-snippets#find-ios-application-uuid
    var mainBundleContainerPathIdentifier = "";
    var bundleIdentifier = String(ObjC.classes.NSBundle.mainBundle().objectForInfoDictionaryKey_('CFBundleIdentifier'));
    var path_prefix = "/var/mobile/Containers/Data/Application/";
    var plist_metadata = "/.com.apple.mobile_container_manager.metadata.plist";
    var folders = ObjC.classes.NSFileManager.defaultManager().contentsOfDirectoryAtPath_error_(path_prefix, NULL);
    for (var i = 0, l = folders.count(); i < l; i++) {
        var uuid = folders.objectAtIndex_(i);
        var metadata = path_prefix + uuid + plist_metadata;
        var dict = ObjC.classes.NSMutableDictionary.alloc().initWithContentsOfFile_(metadata);
        var enumerator = dict.keyEnumerator();
        var key;
        while ((key = enumerator.nextObject()) !== null) {
            if (key == 'MCMMetadataIdentifier') {
                var appId = String(dict.objectForKey_(key));
                if (appId.indexOf(bundleIdentifier) != -1) {
                    mainBundleContainerPathIdentifier = uuid;
                    break;
                }
            }
        }
    }
    console.log("App Container Path : /var/mobile/Containers/Data/Application/" + mainBundleContainerPathIdentifier + "/");
}
function raw_app_info_plist(DEBUG) {
    console.log("");
    console.warn("--------------------------------");
    console.warn("|  Raw Contents of Info.plist  |");
    console.warn("--------------------------------");
    try {
        console.log(ObjC.classes.NSBundle.mainBundle().infoDictionary().toString());
    }
    catch (err) {
        if (DEBUG) {
            console.error("[!] Error: " + err);
        }
    }
}
function show_url_scheme(DEBUG) {
    console.log("");
    console.warn("--------------------------------");
    console.warn("|         URL Schemes          |");
    console.warn("--------------------------------");
    var nsDictionary = ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleURLTypes");
    if (nsDictionary == null) {
        console.log("[*] URL scheme not defined by app");
        return;
    }
    nsDictionary = nsDictionary.objectAtIndex_(0);
    var dictKeys = nsDictionary.allKeys();
    for (var i = 0; i < dictKeys.count(); i++) {
        if (dictKeys.objectAtIndex_(i) == "CFBundleURLSchemes") {
            var urlSchemesString = "";
            var nsArray = nsDictionary.objectForKey_("CFBundleURLSchemes");
            for (var i = 0; i < nsArray.count(); i++) {
                urlSchemesString = urlSchemesString + nsArray.objectAtIndex_(i).toString() + ", ";
            }
            urlSchemesString = urlSchemesString.substr(0, urlSchemesString.length - 2);
            console.log("URL Schemes : " + urlSchemesString);
        }
        else if (dictKeys.objectAtIndex_(i) == "CFBundleURLName") {
            var key = dictKeys.objectAtIndex_(i);
            var value = nsDictionary.objectForKey_(key);
            console.log("URL Scheme Name : " + value);
        }
        else if (dictKeys.objectAtIndex_(i) == "CFBundleURLIconFile") {
            var key = dictKeys.objectAtIndex_(i);
            var value = nsDictionary.objectForKey_(key);
            console.log("URL Icon File : " + value);
        }
        else if (dictKeys.objectAtIndex_(i) == "CFBundleTypeRole") {
            var key = dictKeys.objectAtIndex_(i);
            var value = nsDictionary.objectForKey_(key);
            console.log("App's Role : " + value);
        }
        else {
            var key = dictKeys.objectAtIndex_(i);
            var value = nsDictionary.objectForKey_(key);
            console.log(key + " : " + value);
        }
    }
}
function protected_resources_permissions(DEBUG) {
    console.log("");
    console.warn("-----------------------------------");
    console.warn("|Protected Resources / Permissions|");
    console.warn("-----------------------------------");
    console.warn("Source: https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources");
    var dictKeys = ObjC.classes.NSBundle.mainBundle().infoDictionary().allKeys();
    var permissionListArray = ["NSBluetoothAlwaysUsageDescription", "NSBluetoothPeripheralUsageDescription", "NSCalendarsUsageDescription", "NSRemindersUsageDescription", "NSCameraUsageDescription", "NSMicrophoneUsageDescription", "NSContactsUsageDescription", "NSFaceIDUsageDescription", "NSDesktopFolderUsageDescription", "NSDocumentsFolderUsageDescription", "NSDownloadsFolderUsageDescription", "NSNetworkVolumesUsageDescription", "NSRemovableVolumesUsageDescription", "NSFileProviderPresenceUsageDescription", "NSFileProviderDomainUsageDescription", "NSHealthClinicalHealthRecordsShareUsageDescription", "NSHealthShareUsageDescription", "NSHealthUpdateUsageDescription", "NSHealthRequiredReadAuthorizationTypeIdentifiers", "NSHomeKitUsageDescription", "NSLocationAlwaysAndWhenInUseUsageDescription", "NSLocationUsageDescription", "NSLocationWhenInUseUsageDescription", "NSLocationAlwaysUsageDescription", "NSAppleMusicUsageDescription", "NSMotionUsageDescription", "NFCReaderUsageDescription", "NSPhotoLibraryAddUsageDescription", "NSPhotoLibraryUsageDescription", "NSAppleScriptEnabled", "NSAppleEventsUsageDescription", "NSSystemAdministrationUsageDescription", "ITSAppUsesNonExemptEncryption", "ITSEncryptionExportComplianceCode", "NSSiriUsageDescription", "NSSpeechRecognitionUsageDescription", "NSVideoSubscriberAccountUsageDescription", "UIRequiresPersistentWiFi"];
    var permissionListNameDict = {
        "NSBluetoothAlwaysUsageDescription": "Privacy - Bluetooth Always Usage Description",
        "NSBluetoothPeripheralUsageDescription": "Privacy - Bluetooth Peripheral Usage Description",
        "NSCalendarsUsageDescription": "Privacy - Calendars Usage Description",
        "NSRemindersUsageDescription": "Privacy - Reminders Usage Description",
        "NSCameraUsageDescription": "Privacy - Camera Usage Description",
        "NSMicrophoneUsageDescription": "Privacy - Microphone Usage Description",
        "NSContactsUsageDescription": "Privacy - Contacts Usage Description",
        "NSFaceIDUsageDescription": "Privacy - Face ID Usage Description",
        "NSDesktopFolderUsageDescription": "Privacy - Desktop Folder Usage Description",
        "NSDocumentsFolderUsageDescription": "Privacy - Documents Folder Usage Description",
        "NSDownloadsFolderUsageDescription": "Privacy - Downloads Folder Usage Description",
        "NSNetworkVolumesUsageDescription": "Privacy - Network Volumes Usage Description",
        "NSRemovableVolumesUsageDescription": "Privacy - Removable Volumes Usage Description",
        "NSFileProviderPresenceUsageDescription": "Privacy - File Provider Presence Usage Description",
        "NSFileProviderDomainUsageDescription": "Privacy - Access to a File Provider Domain Usage Description",
        "NSHealthClinicalHealthRecordsShareUsageDescription": "Privacy - Health Records Usage Description",
        "NSHealthShareUsageDescription": "Privacy - Health Share Usage Description",
        "NSHealthUpdateUsageDescription": "Privacy - Health Update Usage Description",
        "NSHealthRequiredReadAuthorizationTypeIdentifiers": "The clinical record data types that your app must get permission to read.",
        "NSHomeKitUsageDescription": "Privacy - HomeKit Usage Description",
        "NSLocationAlwaysAndWhenInUseUsageDescription": "Privacy - Location Always and When In Use Usage Description",
        "NSLocationUsageDescription": "Privacy - Location Usage Description",
        "NSLocationWhenInUseUsageDescription": "Privacy - Location When In Use Usage Description",
        "NSLocationAlwaysUsageDescription": "Privacy - Location Always Usage Description",
        "NSAppleMusicUsageDescription": "Privacy - Media Library Usage Description",
        "NSMotionUsageDescription": "Privacy - Motion Usage Description",
        "NFCReaderUsageDescription": "Privacy - NFC Scan Usage Description",
        "NSPhotoLibraryAddUsageDescription": "Privacy - Photo Library Additions Usage Description",
        "NSPhotoLibraryUsageDescription": "Privacy - Photo Library Usage Description",
        "NSAppleScriptEnabled": "Scriptable",
        "NSAppleEventsUsageDescription": "Privacy - AppleEvents Sending Usage Description",
        "NSSystemAdministrationUsageDescription": "Privacy - System Administration Usage Description",
        "ITSAppUsesNonExemptEncryption": "App Uses Non-Exempt Encryption",
        "ITSEncryptionExportComplianceCode": "App Encryption Export Compliance Code",
        "NSSiriUsageDescription": "Privacy - Siri Usage Description",
        "NSSpeechRecognitionUsageDescription": "Privacy - Speech Recognition Usage Description",
        "NSVideoSubscriberAccountUsageDescription": "Privacy - Video Subscriber Account Usage Description",
        "UIRequiresPersistentWiFi": "Application uses Wi-Fi"
    };
    var permissionListDetailDict = {
        "NSBluetoothAlwaysUsageDescription": "A message that tells the user why the app needs access to Bluetooth",
        "NSBluetoothPeripheralUsageDescription": "A message that tells the user why the app is requesting the ability to connect to Bluetooth peripherals",
        "NSCalendarsUsageDescription": "A message that tells the user why the app is requesting access to the user’s calendar data",
        "NSRemindersUsageDescription": "A message that tells the user why the app is requesting access to the user’s reminders",
        "NSCameraUsageDescription": "A message that tells the user why the app is requesting access to the device’s camera",
        "NSMicrophoneUsageDescription": "A message that tells the user why the app is requesting access to the device’s microphone",
        "NSContactsUsageDescription": "A message that tells the user why the app is requesting access to the user’s contacts",
        "NSFaceIDUsageDescription": "A message that tells the user why the app is requesting the ability to authenticate with Face ID",
        "NSDesktopFolderUsageDescription": "A message that tells the user why the app needs access to the user’s Desktop folder",
        "NSDocumentsFolderUsageDescription": "A message that tells the user why the app needs access to the user’s Documents folder",
        "NSDownloadsFolderUsageDescription": "A message that tells the user why the app needs access to the user’s Downloads folder",
        "NSNetworkVolumesUsageDescription": "A message that tells the user why the app needs access to files on a network volume",
        "NSRemovableVolumesUsageDescription": "A message that tells the user why the app needs access to files on a removable volume",
        "NSFileProviderPresenceUsageDescription": "A message that tells the user why the app needs to be informed when other apps access files that it manages",
        "NSFileProviderDomainUsageDescription": "A message that tells the user why the app needs access to files managed by a file provider",
        "NSHealthClinicalHealthRecordsShareUsageDescription": "A message to the user that explains why the app requested permission to read clinical records",
        "NSHealthShareUsageDescription": "A message to the user that explains why the app requested permission to read samples from the HealthKit store",
        "NSHealthUpdateUsageDescription": "A message to the user that explains why the app requested permission to save samples to the HealthKit store",
        "NSHealthRequiredReadAuthorizationTypeIdentifiers": "The clinical record data types that your app must get permission to read",
        "NSHomeKitUsageDescription": "A message that tells the user why the app is requesting access to the user’s HomeKit configuration data",
        "NSLocationAlwaysAndWhenInUseUsageDescription": "A message that tells the user why the app is requesting access to the user’s location information at all times",
        "NSLocationUsageDescription": "A message that tells the user why the app is requesting access to the user’s location information",
        "NSLocationWhenInUseUsageDescription": "A message that tells the user why the app is requesting access to the user’s location information while the app is running in the foreground",
        "NSLocationAlwaysUsageDescription": "A message that tells the user why the app is requesting access to the user's location at all times",
        "NSAppleMusicUsageDescription": "A message that tells the user why the app is requesting access to the user’s media library",
        "NSMotionUsageDescription": "A message that tells the user why the app is requesting access to the device’s accelerometer",
        "NFCReaderUsageDescription": "A message that tells the user why the app is requesting access to the device’s NFC hardware",
        "NSPhotoLibraryAddUsageDescription": "A message that tells the user why the app is requesting write-only access to the user’s photo library",
        "NSPhotoLibraryUsageDescription": "A message that tells the user why the app is requesting access to the user’s photo library",
        "NSAppleScriptEnabled": "A Boolean value indicating whether AppleScript is enabled",
        "NSAppleEventsUsageDescription": "A message that tells the user why the app is requesting the ability to send Apple events",
        "NSSystemAdministrationUsageDescription": "A message in macOS that tells the user why the app is requesting to manipulate the system configuration",
        "ITSAppUsesNonExemptEncryption": "A Boolean value indicating whether the app uses encryption",
        "ITSEncryptionExportComplianceCode": "The export compliance code provided by App Store Connect for apps that require it",
        "NSSiriUsageDescription": "A message that tells the user why the app is requesting to send user data to Siri",
        "NSSpeechRecognitionUsageDescription": "A message that tells the user why the app is requesting to send user data to Apple’s speech recognition servers",
        "NSVideoSubscriberAccountUsageDescription": "A message that tells the user why the app is requesting access to the user’s TV provider account",
        "UIRequiresPersistentWiFi": "A Boolean value indicating whether the app requires a Wi-Fi connection"
    };
    for (var i = 0; i < permissionListArray.length; i++) {
        try {
            if (dictKeys.containsObject_(permissionListArray[i])) {
                console.log("Resource : " + permissionListArray[i]);
                console.log("Name     : " + permissionListNameDict[permissionListArray[i]]);
                console.log("Details  : " + permissionListDetailDict[permissionListArray[i]]);
                console.log("Value    : " + ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_(permissionListArray[i]).toString());
                console.log("");
            }
        }
        catch (err) {
            if (DEBUG) {
                console.error("[!] Error: " + err);
            }
        }
    }
}
function app_transport_security(DEBUG) {
    console.log("");
    console.warn("-----------------------------------");
    console.warn("| App Transport Security Settings |");
    console.warn("-----------------------------------");
    console.warn("Source: https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity");
    var dictKeys = ObjC.classes.NSBundle.mainBundle().infoDictionary().allKeys();
    if (dictKeys.containsObject_("NSAppTransportSecurity")) {
        console.log("[*] Issue: Found 'NSAppTransportSecurity' defined in Info.plist file");
        console.log("[*] Detail: A description of changes made to the default security for HTTP connections");
        console.log("");
        var atsDictKeys = ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").allKeys();
        for (var i = 0; i < atsDictKeys.count(); i++) {
            if (atsDictKeys.objectAtIndex_(i) == "NSAllowsArbitraryLoads") {
                if (ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSAllowsArbitraryLoads").toString() == "1") {
                    console.log("[*] Issue: ATS restrictions dsiabled for all network connections by setting 'NSAllowsArbitraryLoads' to True");
                    console.log("[*] Detail: A Boolean value indicating whether App Transport Security restrictions are disabled for all network connections");
                    console.log("[*] Description: Setting this key's value to YES disables App Transport Security (ATS) restrictions for all domains not specified in the NSExceptionDomains dictionary. Disabling ATS means that unsecured HTTP connections are allowed. HTTPS connections are also allowed, and are still subject to default server trust evaluation. However, extended security checks—like requiring a minimum Transport Layer Security (TLS) protocol version—are disabled. In iOS 10 and later, the value of the NSAllowsArbitraryLoads key is ignored and the default value of NO is used instead — if any of the following keys are present in app's Information Property List file: NSAllowsArbitraryLoadsForMedia, NSAllowsArbitraryLoadsInWebContent, NSAllowsLocalNetworking.");
                    console.log("");
                }
            }
            if (atsDictKeys.objectAtIndex_(i) == "NSAllowsArbitraryLoadsForMedia") {
                if (ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSAllowsArbitraryLoadsForMedia").toString() == "1") {
                    console.log("[*] Issue: ATS restrictions disabled for requests made using the AV Foundation framework by setting 'NSAllowsArbitraryLoadsForMedia' to True");
                    console.log("[*] Detail: A Boolean value indicating whether all App Transport Security restrictions are disabled for requests made using the AV Foundation framework");
                    console.log("[*] Description: Setting this key's value to disables App Transport Security restrictions for media loaded using the AVFoundation framework, without affecting URLSession connections. Domains specified in the NSExceptionDomains dictionary aren't affected by this key's value. In iOS 10 and later, if this key is included with any value, then App Transport Security ignores the value of the NSAllowsArbitraryLoads key, instead using that key's default value of NO.");
                    console.log("");
                }
            }
            if (atsDictKeys.objectAtIndex_(i) == "NSAllowsArbitraryLoadsInWebContent") {
                if (ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSAllowsArbitraryLoadsInWebContent").toString() == "1") {
                    console.log("[*] Issue: ATS restrictions disabled for requests made from webviews by setting 'NSAllowsArbitraryLoadsInWebContent' to True");
                    console.log("[*] Detail: A Boolean value indicating whether all App Transport Security restrictions are disabled for requests made from web views");
                    console.log("[*] Description: Setting this key's value to YES to exempt app's web views from App Transport Security restrictions without affecting URLSession connections. Domains specified in the NSExceptionDomains dictionary aren't affected by this key's value. A web view is an instance of any of the following classes: WKWebView and UIWebView. In iOS 10 and later, if this key is included with any value, then App Transport Security ignores the value of the NSAllowsArbitraryLoads key, instead using that key's default value of NO.");
                    console.log("");
                }
            }
            if (atsDictKeys.objectAtIndex_(i) == "NSAllowsLocalNetworking") {
                if (ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSAllowsLocalNetworking").toString() == "1") {
                    console.log("[*] Issue: Allowed Loading of Local Resources by setting 'NSAllowsLocalNetworking' to True");
                    console.log("[*] Detail: A Boolean value indicating whether to allow loading of local resources.");
                    console.log("[*] Description: In iOS 9, App Transport Security (ATS) disallows connections to unqualified domains, .local domains, and IP addresses. Exceptions can be added for unqualified domains and .local domains in the NSExceptionDomains dictionary, but can’t add numerical IP addresses. Instead use NSAllowsArbitraryLoads when you want to load directly from an IP address. In iOS 10 later, ATS allows all three of these connections by default, so an exception is no longer needed for any of them. However, if compatibility with older versions of the OS is to be maintained, set both of the NSAllowsArbitraryLoads and NSAllowsLocalNetworking keys to YES.");
                    console.log("");
                }
            }
            if (atsDictKeys.objectAtIndex_(i) == "NSExceptionDomains") {
                console.log("[*] Issue: Found 'NSExceptionDomains' defined inside 'NSAppTransportSecurity' in Info.plist file");
                console.log("[*] Detail: Custom configurations for App Transport Security named domains");
                console.log("");
                /*var atsExceptionDomainsDict = ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSExceptionDomains")
                var atsExceptionDomainsDictKeys = ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSExceptionDomains").allKeys()
                for( var i = 0; i<atsExceptionDomainsDictKeys.count(); i++)
                {
                    console.log("Domain Name : " + atsExceptionDomainsDict)
                    if(ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("NSAppTransportSecurity").objectForKey_("NSAllowsArbitraryLoads").toString() == "1")
                    {
                        console.log("[*] Issue: ")
                        console.log("[*] Detail: ")
                        console.log("[*] Description: ")
                        console.log("")
                    }
                }*/
            }
        }
    }
}
function classes_potential_jailbreak_detection(DEBUG) {
    console.log("");
    console.warn("---------------------------------------------");
    console.warn("| Classes for potential jailbreak detection |");
    console.warn("---------------------------------------------");
    for (var className in ObjC.classes) {
        if (ObjC.classes.hasOwnProperty(className)) {
            var classNameLower = className.toLowerCase();
            if (classNameLower.indexOf("jailbreak") != -1 || classNameLower.indexOf("jailbroke") != -1) {
                console.log(className);
                var methods = ObjC.classes[className].$ownMethods;
                for (var i = 0; i < methods.length; i++) {
                    console.log("\t" + methods[i]);
                }
                console.log("");
            }
        }
    }
}
function methods_potential_jailbreak_detection(DEBUG) {
    console.log("");
    console.warn("---------------------------------------------");
    console.warn("| Methods for potential jailbreak detection |");
    console.warn("---------------------------------------------");
    new ApiResolver("objc").enumerateMatches("*[* *JailBreak*]").forEach(i => LOGJSON(i));
    new ApiResolver("objc").enumerateMatches("*[* *jailBreak*]").forEach(i => LOGJSON(i));
    new ApiResolver("objc").enumerateMatches("*[* *jailbreak*]").forEach(i => LOGJSON(i));
    new ApiResolver("objc").enumerateMatches("*[* *jailbroke*]").forEach(i => LOGJSON(i));
    // for (var className in ObjC.classes) {
    //     if (ObjC.classes.hasOwnProperty(className)) {
    //         var foundMethods = []
    //         var j = 0
    //         var methods = ObjC.classes[className].$ownMethods
    //         for (var i = 0; i < methods.length; i++) {
    //             var methodNameLowerCase = methods[i].toLowerCase()
    //             if (methodNameLowerCase.indexOf("jailbreak") != -1 || methodNameLowerCase.indexOf("jailbroke") != -1) {
    //                 foundMethods[j] = methods[i]
    //                 j++
    //             }
    //         }
    //         if (foundMethods.length > 0) {
    //             console.log(className)
    //             for (var i = 0; i < foundMethods.length; i++) {
    //                 console.log("\t" + foundMethods[i])
    //             }
    //             console.log("")
    //         }
    //     }
    // }
}
globalThis.appid = ObjC.classes.NSBundle.mainBundle().infoDictionary().objectForKey_("CFBundleIdentifier").toString();
globalThis.dbg = () => {
    newLine();
    logw(`${Process.id} ${Process.getCurrentThreadId()} ${appid}`);
    logz(`debugserver -x backboard 0.0.0.0:1235 ${Process.mainModule.path}`);
    logz(`debugserver -x backboard 0.0.0.0:1235 -a ${Process.id}`);
    newLine();
};
globalThis.showInfo = (jailbreak = false) => {
    setImmediate(app_meta_info);
    setImmediate(xcode_build_meta_info);
    setImmediate(app_env_info);
    setImmediate(raw_app_info_plist);
    // setImmediate(show_url_scheme)
    setImmediate(protected_resources_permissions);
    setImmediate(app_transport_security);
    if (jailbreak) {
        setImmediate(classes_potential_jailbreak_detection);
        setImmediate(methods_potential_jailbreak_detection);
    }
};
//Twitter: https://twitter.com/xploresec
//GitHub: https://github.com/interference-security
globalThis.show_binarycookies = () => {
    const cookies = ObjC.classes.NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies();
    for (let i = 0; i < cookies.count(); i++) {
        console.log((cookies['- objectAtIndex:'](i)).toString());
    }
};
export {};
✄
{"version":3,"file":"itor.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/info/itor.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAmB,KAAK,EAAE,eAAwB,KAAK,EAAE,EAAE;IAEnF,MAAM,OAAO,GAAG,2BAA2B,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IACpE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,EAAE,CAAC,CAAC,CAAA;IACzH,MAAM,UAAU,GAAG,aAAa,YAAY,EAAE,CAAA;IAC9C,IAAI,CAAC,WAAW,OAAO,CAAC,UAAU,CAAC,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,OAAO,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC,CAAA;IAC9G,IAAI,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAA;IAEpC,OAAO,CAAC,gBAAgB,EAAE;SACrB,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,2BAA2B,CAAC,GAAG,CAAC,IA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E,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;IAEtH,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACjD,IAAI,UAAU,GAAkB,IAAI,KAAK,EAAE,CAAA;IAC3C,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IAEpB,IAAI;QACA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;QAC9E,UAAU,GAAG,IAAI,KAAK,CAAS,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;QAClD,IAAI,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;YAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE;gBACzC,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAA;gBACtE,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;aACpD;YACD,IAAI,CAAC,QAAQ,CAAC,CAAA;SACjB;KACJ;IAAC,MAAM,GAAG;IAEX,OAAO,UAAU,CAAA;AACrB,CAAC;AAED,UAAU,CAAC,CAAC,GAAG,WAAW,CAAA"}
✄
export const list_images = (showAll = false, countMethods = false) => {
    const arrMain = getClassNameArrayFromMdPath(Process.mainModule.path);
    const methodsCount = arrMain.map(clsName => ObjC.classes[clsName].$methods.length).reduce((sum, count) => sum + count, 0);
    const methodsMsg = `| METHODS:${methodsCount}`;
    loge(`[ - ] \t${Process.mainModule.base} -> ${Process.mainModule.name} | CLS:${arrMain.length} ${methodsMsg}`);
    logz(`\t${Process.mainModule.path}`);
    Process.enumerateModules()
        .map(_md => { return { md: _md, arr: getClassNameArrayFromMdPath(_md.path) }; })
        .filter(item => showAll ? true : item.arr.length != 0)
        .forEach((item, index) => {
        let methodsMsg = ``;
        if (countMethods) {
            const methodsCount = item.arr.map(clsName => ObjC.classes[clsName].$methods.length).reduce((sum, count) => sum + count, 0);
            methodsMsg = `| METHODS:${methodsCount}`;
        }
        logd(`[ ${index} ] \t${item.md.base} -> ${item.md.name} | CLS:${item.arr.length} ${methodsMsg}`);
        logz(`\t${item.md.path}`);
    });
};
function getClassNameArrayFromMdPath(path) {
    const free_addr = Module.findExportByName(null, 'free');
    const free = new NativeFunction(free_addr, 'void', ['pointer']);
    const objc_copyClassNamesForImage_addr = Module.findExportByName(null, 'objc_copyClassNamesForImage');
    const copyClassNamesForImage = new NativeFunction(objc_copyClassNamesForImage_addr, 'pointer', ['pointer', 'pointer']);
    const tempMem = Memory.alloc(Process.pointerSize);
    let classNames = new Array();
    tempMem.writeUInt(0);
    try {
        const pClasses = copyClassNamesForImage(Memory.allocUtf8String(path), tempMem);
        classNames = new Array(tempMem.readUInt());
        if (pClasses.readUInt() != 0) {
            for (var i = 0; i < tempMem.readUInt(); i++) {
                const pClassName = pClasses.add(i * Process.pointerSize).readPointer();
                classNames.push(`${pClassName.readUtf8String()}`);
            }
            free(pClasses);
        }
    }
    catch { }
    return classNames;
}
globalThis.i = list_images;
✄
{"version":3,"file":"enum.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/jailbreak/enum.ts"],"names":[],"mappings":"AAAA,GAAG;AACH,KAAK;AACL,0BAA0B;AAC1B,MAAM;AACN,uEAAuE;AACvE,uEAAuE;AACvE,qEAAqE;AACrE,0EAA0E;AAC1E,gEAAgE;AAChE,mEAAmE;AACnE,oEAAoE;AACpE,2EAA2E;AAC3E,2EAA2E;AAC3E,iEAAiE;AACjE,qEAAqE;AACrE,yEAAyE;AACzE,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,4EAA4E;AAC5E,qEAAqE;AACrE,iFAAiF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,+DAA+D;AAC/D,gFAAgF;AAChF,sEAAsE;AACtE,qEAAqE;AACrE,+DAA+D;AAC/D,kEAAkE;AAClE,2DAA2D;AAC3D,8EAA8E;AAE9E,MAAM,CAAN,IAAY,QAWX;AAXD,WAAY,QAAQ;IAChB,mDAAc,CAAA;IACd,+CAAY,CAAA;IACZ,2CAAU,CAAA;IACV,6CAAW,CAAA;IACX,6CAAW,CAAA;IACX,iDAAa,CAAA;IACb,2CAAU,CAAA;IACV,qDAAe,CAAA;IACf,+CAAY,CAAA;IACZ,iDAAa,CAAA;AACjB,CAAC,EAXW,QAAQ,KAAR,QAAQ,QAWnB"}
✄
// 
// /*
//  * CTL_KERN identifiers
//  */
// #define KERN_OSTYPE              1      /* string: system version */
// #define KERN_OSRELEASE           2      /* string: system release */
// #define KERN_OSREV               3      /* int: system revision */
// #define KERN_VERSION             4      /* string: compile time info */
// #define KERN_MAXVNODES           5      /* int: max vnodes */
// #define KERN_MAXPROC             6      /* int: max processes */
// #define KERN_MAXFILES            7      /* int: max open files */
// #define KERN_ARGMAX              8      /* int: max arguments to exec */
// #define KERN_SECURELVL           9      /* int: system security level */
// #define KERN_HOSTNAME           10      /* string: hostname */
// #define KERN_HOSTID             11      /* int: host identifier */
// #define KERN_CLOCKRATE          12      /* struct: struct clockrate */
// #define KERN_VNODE              13      /* struct: vnode structures */
// #define KERN_PROC               14      /* struct: process entries */
// #define KERN_FILE               15      /* struct: file entries */
// #define KERN_PROF               16      /* node: kernel profiling info */
// #define KERN_POSIX1             17      /* int: POSIX.1 version */
// #define KERN_NGROUPS            18      /* int: # of supplemental group ids */
// #define KERN_JOB_CONTROL        19      /* int: is job control available */
// #define KERN_SAVED_IDS          20      /* int: saved set-user/group-ID */
// #define KERN_BOOTTIME           21      /* struct: time kernel was booted */
// #define KERN_NISDOMAINNAME      22      /* string: YP domain name */
// #define KERN_DOMAINNAME         KERN_NISDOMAINNAME
// #define KERN_MAXPARTITIONS      23      /* int: number of partitions/disk */
// #define KERN_KDEBUG             24      /* int: kernel trace points */
// #define KERN_UPDATEINTERVAL     25      /* int: update process sleep time */
// #define KERN_OSRELDATE          26      /* int: OS release date */
// #define KERN_NTP_PLL            27      /* node: NTP PLL control */
// #define KERN_BOOTFILE           28      /* string: name of booted kernel */
// #define KERN_MAXFILESPERPROC    29      /* int: max open files per proc */
// #define KERN_MAXPROCPERUID      30      /* int: max processes per uid */
// #define KERN_DUMPDEV            31      /* dev_t: device to dump on */
// #define KERN_IPC                32      /* node: anything related to IPC */
// #define KERN_DUMMY              33      /* unused */
// #define KERN_PS_STRINGS 34      /* int: address of PS_STRINGS */
// #define KERN_USRSTACK32 35      /* int: address of USRSTACK */
// #define KERN_LOGSIGEXIT 36      /* int: do we log sigexit procs? */
// #define KERN_SYMFILE            37      /* string: kernel symbol filename */
// #define KERN_PROCARGS           38
// /* 39 was KERN_PCSAMPLES... now obsolete */
// #define KERN_NETBOOT            40      /* int: are we netbooted? 1=yes,0=no */
// /* 41 was KERN_PANICINFO : panic UI information (deprecated) */
// #define KERN_SYSV               42      /* node: System V IPC information */
// #define KERN_AFFINITY           43      /* xxx */
// #define KERN_TRANSLATE          44      /* xxx */
// #define KERN_CLASSIC            KERN_TRANSLATE  /* XXX backwards compat */
// #define KERN_EXEC               45      /* xxx */
// #define KERN_CLASSICHANDLER     KERN_EXEC /* XXX backwards compatibility */
// #define KERN_AIOMAX             46      /* int: max aio requests */
// #define KERN_AIOPROCMAX         47      /* int: max aio requests per process */
// #define KERN_AIOTHREADS         48      /* int: max aio worker threads */
// #ifdef __APPLE_API_UNSTABLE
// #define KERN_PROCARGS2          49
// #endif /* __APPLE_API_UNSTABLE */
// #define KERN_COREFILE           50      /* string: corefile format string */
// #define KERN_COREDUMP           51      /* int: whether to coredump at all */
// #define KERN_SUGID_COREDUMP     52      /* int: whether to dump SUGID cores */
// #define KERN_PROCDELAYTERM      53      /* int: set/reset current proc for delayed termination during shutdown */
// #define KERN_SHREG_PRIVATIZABLE 54      /* int: can shared regions be privatized ? */
// /* 55 was KERN_PROC_LOW_PRI_IO... now deprecated */
// #define KERN_LOW_PRI_WINDOW     56      /* int: set/reset throttle window - milliseconds */
// #define KERN_LOW_PRI_DELAY      57      /* int: set/reset throttle delay - milliseconds */
// #define KERN_POSIX              58      /* node: posix tunables */
// #define KERN_USRSTACK64         59      /* LP64 user stack query */
// #define KERN_NX_PROTECTION      60      /* int: whether no-execute protection is enabled */
// #define KERN_TFP                61      /* Task for pid settings */
// #define KERN_PROCNAME           62      /* setup process program  name(2*MAXCOMLEN) */
// #define KERN_THALTSTACK         63      /* for compat with older x86 and does nothing */
// #define KERN_SPECULATIVE_READS  64      /* int: whether speculative reads are disabled */
// #define KERN_OSVERSION          65      /* for build number i.e. 9A127 */
// #define KERN_SAFEBOOT           66      /* are we booted safe? */
// /*	67 was KERN_LCTX (login context) */
// #define KERN_RAGEVNODE          68
// #define KERN_TTY                69      /* node: tty settings */
// #define KERN_CHECKOPENEVT       70      /* spi: check the VOPENEVT flag on vnodes at open time */
// #define KERN_THREADNAME         71      /* set/get thread name */
// #define KERN_MAXID              72      /* number of valid kern ids */
export var CTL_KERN;
(function (CTL_KERN) {
    CTL_KERN[CTL_KERN["KERN_SECURELVL"] = 9] = "KERN_SECURELVL";
    CTL_KERN[CTL_KERN["KERN_HOSTNAME"] = 10] = "KERN_HOSTNAME";
    CTL_KERN[CTL_KERN["KERN_HOSTID"] = 11] = "KERN_HOSTID";
    CTL_KERN[CTL_KERN["KERN_CLOCKRATE"] = 12] = "KERN_CLOCKRATE";
    CTL_KERN[CTL_KERN["KERN_VNODE"] = 13] = "KERN_VNODE";
    CTL_KERN[CTL_KERN["KERN_PROC"] = 14] = "KERN_PROC";
    CTL_KERN[CTL_KERN["KERN_FILE"] = 15] = "KERN_FILE";
    CTL_KERN[CTL_KERN["KERN_PROF"] = 16] = "KERN_PROF";
    CTL_KERN[CTL_KERN["KERN_POSIX1"] = 17] = "KERN_POSIX1";
    CTL_KERN[CTL_KERN["KERN_NGROUPS"] = 18] = "KERN_NGROUPS";
    //...
})(CTL_KERN || (CTL_KERN = {}));
// 第一个name数组可以包含以下
// #define CTL_UNSPEC      0               /* unused */
// #define CTL_KERN        1               /* "high kernel": proc, limits */
// #define CTL_VM          2               /* virtual memory */
// #define CTL_VFS         3               /* file system, mount type is next */
// #define CTL_NET         4               /* network, see socket.h */
// #define CTL_DEBUG       5               /* debugging parameters */
// #define CTL_HW          6               /* generic cpu/io */
// #define CTL_MACHDEP     7               /* machine dependent */
// #define CTL_USER        8               /* user-level */
// #define CTL_MAXID       9               /* number of valid top-level ids */
export var CTLT_YPE;
(function (CTLT_YPE) {
    CTLT_YPE[CTLT_YPE["CTL_UNSPEC"] = 0] = "CTL_UNSPEC";
    CTLT_YPE[CTLT_YPE["CTL_KERN"] = 1] = "CTL_KERN";
    CTLT_YPE[CTLT_YPE["CTL_VM"] = 2] = "CTL_VM";
    CTLT_YPE[CTLT_YPE["CTL_VFS"] = 3] = "CTL_VFS";
    CTLT_YPE[CTLT_YPE["CTL_NET"] = 4] = "CTL_NET";
    CTLT_YPE[CTLT_YPE["CTL_DEBUG"] = 5] = "CTL_DEBUG";
    CTLT_YPE[CTLT_YPE["CTL_HW"] = 6] = "CTL_HW";
    CTLT_YPE[CTLT_YPE["CTL_MACHDEP"] = 7] = "CTL_MACHDEP";
    CTLT_YPE[CTLT_YPE["CTL_USER"] = 8] = "CTL_USER";
    CTLT_YPE[CTLT_YPE["CTL_MAXID"] = 9] = "CTL_MAXID";
})(CTLT_YPE || (CTLT_YPE = {}));
✄
{"version":3,"file":"hooks.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/jailbreak/hooks.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,MAAM,IAAI,GAAY,IAAI,CAAA,CAAC,aAAa;AAExC,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAW,EAAE;IACnD,kCAAkC;IAClC,MAAM,OAAO,GAAG;QACZ,yBAAyB;QACzB,gB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AAI,KAAK,IAAI,IAAI,CAAC,CAAA;QACvC,CAAC;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAED,wBAAwB;AACxB,6CAA6C;AAC7C,0EAA0E;AAC1E,qCAAqC;AACrC,kCAAkC;AAClC,+CAA+C;AAC/C,4CAA4C;AAC5C,kEAAkE;AAClE,qEAAqE;AACrE,6DAA6D;AAC7D,aAAa;AACb,uCAAuC;AACvC,8EAA8E;AAC9E,YAAY;AACZ,SAAS;AACT,WAAW;AACX,oDAAoD;AACpD,IAAI"}
✄
// import { CTLT_YPE } from "./enum"
const SLOG = true; // simple log
const checkIfContainJbPaths = (str) => {
    // The string that may be detected
    const JbPaths = [
        "/Applications/Cydia.app",
        "/usr/sbin/sshd",
        "/bin/bash",
        "/etc/apt",
        "/Library/MobileSubstrate",
        "/User/Applications/",
        "/private/var/lib/apt/",
        "/private/var/lib/cydia/",
        "substitute",
        "substrate",
        "CepheiUI"
    ];
    return JbPaths.some(item => str.includes(item));
};
export const hook_stat = () => {
    logd("hook stat & lstat");
    // int stat(const char *, struct stat *)
    // 成功返回 0  失败返回 -1
    // #define __DARWIN_STRUCT_STAT64 { \
    // 	dev_t		st_dev;                 /* [XSI] ID of device containing file */ \ 设备编号
    // 	mode_t		st_mode;                /* [XSI] Mode of file (see below) */ \  文件类型及权限
    // 	nlink_t		st_nlink;               /* [XSI] Number of hard links */ \ 硬链接数量
    // 	__darwin_ino64_t st_ino;                /* [XSI] File serial number */ \ inode 编号
    // 	uid_t		st_uid;                 /* [XSI] User ID of the file */ \ 拥有者的用户 ID
    // 	gid_t		st_gid;                 /* [XSI] Group ID of the file */ \ 拥有者的组 ID
    // 	dev_t		st_rdev;                /* [XSI] Device ID */ \
    // 	__DARWIN_STRUCT_STAT64_TIMES \
    // 	off_t		st_size;                /* [XSI] file size, in bytes */ \ 文件大小（以字节为单位）
    // 	blkcnt_t	st_blocks;              /* [XSI] blocks allocated for file */ \
    // 	blksize_t	st_blksize;             /* [XSI] optimal blocksize for I/O */ \
    // 	__uint32_t	st_flags;               /* user defined flags for file */ \
    // 	__uint32_t	st_gen;                 /* file generation number */ \
    // 	__int32_t	st_lspare;              /* RESERVED: DO NOT USE! */ \
    // 	__int64_t	st_qspare[2];           /* RESERVED: DO NOT USE! */ \
    // }
    const addr = Module.findExportByName("libsystem_kernel.dylib", "stat");
    Interceptor.attach(addr, {
        onEnter(args) {
            this.disp = `stat ( '${args[0].readCString()}', ${args[1]} )`;
        },
        onLeave(retval) {
            if (checkIfContainJbPaths(this.disp)) {
                loge(`${retval} <= ${this.disp}`);
                retval.replace(ptr(-1));
            }
            else {
                if (!SLOG)
                    logd(`${retval} <= ${this.disp}`);
            }
        }
    });
    // int     lstat(const char *, struct stat *) __DARWIN_INODE64(lstat);
    const addr2 = Module.findExportByName("libsystem_kernel.dylib", "lstat");
    Interceptor.attach(addr2, {
        onEnter(args) {
            this.disp = `lstat ( '${args[0].readCString()}', ${args[1]} )`;
        },
        onLeave(retval) {
            if (checkIfContainJbPaths(this.disp)) {
                loge(`${retval} <= ${this.disp}`);
                retval.replace(ptr(-1));
            }
            else {
                if (!SLOG)
                    logd(`${retval} <= ${this.disp}`);
            }
        }
    });
};
const hook_NSString_IsEqualToString = () => {
    logd("hook NSString_IsEqualToString");
    const addr = ptr(ObjC.classes["NSString"]["- isEqualToString:"].implementation);
    Interceptor.attach(addr, {
        onEnter(args) {
            logw("NSString - isEqualToString");
            let thiz = new ObjC.Object(args[0]);
            let SEL = ObjC.selectorAsString(args[1]);
            let str = new ObjC.Object(args[1]).toString();
            this.disp = `${thiz} ${SEL} ${str}`;
        },
        onLeave(retval) {
            if (checkIfContainJbPaths(this.disp)) {
                loge(`${retval} <= ${this.disp}`);
            }
            else {
                if (!SLOG)
                    logd(`${retval} <= ${this.disp}`);
            }
        }
    });
};
// dladdr
const hook_dladdr = () => {
    const addr = Module.findExportByName("libsystem_kernel.dylib", "dladdr");
    Interceptor.attach(addr, {
        onEnter(args) {
            // typedef struct dl_info {
            //         const char      *dli_fname;     /* Pathname of shared object */
            //         void            *dli_fbase;     /* Base address of shared object */
            //         const char      *dli_sname;     /* Name of nearest symbol */
            //         void            *dli_saddr;     /* Address of nearest symbol */
            // } Dl_info;
            this.disp = `dladdr ( ${args[0]}, ${args[1]} )`;
        },
        onLeave(retval) {
            if (checkIfContainJbPaths(this.disp)) { }
        }
    });
};
// hook isDebugged
// 校验当前进程是否为调试模式，hook sysctl方法可以绕过
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
// Thanks to https://developer.apple.com/library/archive/qa/qa1361/_index.html
// sysctl 是一个用于查询和设置内核参数的系统调用。它主要用于获取或更改系统信息，例如 CPU 类型、内存大小，以及其他系统级别的配置
// int sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, const void *newp, size_t newlen);
// 成功返回 0 失败返回 -1
/**
 * IMPL ↓
 * BOOL isDebugged()
{
    int junk;
    int mib[4];
    struct kinfo_proc info;
    size_t size;
    info.kp_proc.p_flag = 0; // 指向存储查询结果的缓冲区的指针,如果只是想设置系统参数,设置为NULL
    mib[0] = CTL_KERN;  // 整数数组，用于指定要查询或设置的系统参数 0x4
    mib[1] = KERN_PROC;
    mib[2] = KERN_PROC_PID;
    mib[3] = getpid();
    size = sizeof(info);
    junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
    assert(junk == 0);
    return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
}
 */
// Process.enumerateModules()
//     .forEach(module => {
//         module.enumerateSymbols()
//         .forEach(symbol => {
//             if (symbol.name.includes("sysctl") && !symbol.address.isNull()) {
//                 logd(`${symbol.address} <= ${symbol.name}`)
//             }
//         })
//     })
const hook_isDebugged = () => {
    logd("hook sysctl | isDebugged");
    let addr_sysctl = Module.findExportByName("libsystem_c.dylib", "sysctl");
    // addr_sysctl = DebugSymbol.fromName("sysctl").address <- 这里被坑了 重名符号 返回的是最后一个
    // DebugSymbol.fromName("sysctl")
    // {
    //     "address": "0x101214e30",
    //     "column": 0,
    //     "fileName": "",
    //     "lineNumber": 0,
    //     "moduleName": "dyld",
    //     "name": "sysctl"
    // }
    Interceptor.attach(addr_sysctl, {
        onEnter(args) {
            // junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
            // int sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, const void *newp, size_t newlen);
            this.disp = `  ( name=${args[0]}, namelen=${args[1]}, oldp=${args[2]}, oldlenp=${args[3]}, newp=${args[4]}, newlen${args[5]} )`;
            let tmp = '';
            for (let i = 0; i < args[1].toInt32(); i++) { // int* ++
                // if (i == 0) {
                //     tmp += `${CTLT_YPE[args[0].readInt()].toString()} | `
                // } else {
                tmp += `${[args[0].add(i).readInt()].toString()} | `;
                // }
            }
            this.disp1 = tmp.substring(0, tmp.length - 3);
            this.info = args[2];
        },
        onLeave(retval) {
            logd(`${retval} <= ${this.disp}`);
            logz(`\t${this.disp1}`);
            // struct kinfo_proc {
            // struct  extern_proc kp_proc;                    /* proc structure */
            // struct  eproc {
            // 	struct  proc *e_paddr;          /* address of proc */
            // 	struct  session *e_sess;        /* session pointer */
            // 	struct  _pcred e_pcred;         /* process credentials */
            // 由上可见就是第一个结构体
            // struct extern_proc {
            // 	union {
            // 		struct {
            // 			struct  proc *__p_forw; /* Doubly-linked run/sleep queue. */
            // 			struct  proc *__p_back;
            // 		} p_st1;
            // 		struct timeval __p_starttime;   /* process start time */
            // 	} p_un;
            // #define p_forw p_un.p_st1.__p_forw
            // #define p_back p_un.p_st1.__p_back
            // #define p_starttime p_un.__p_starttime
            // 	struct  vmspace *p_vmspace;     /* Address space. */
            // 	struct  sigacts *p_sigacts;     /* Signal actions, state (PROC ONLY). */
            // 	int     p_flag;                 /* P_* flags. */
            // (lldb) p/a &(info.kp_proc)
            // (extern_proc *) 0x000000016ef08ef0
            // (lldb) p/a &(info.kp_proc.p_flag)
            // (int *) 0x000000016ef08f10
            // ofset 0x20 = pointersize * 4
            // p/x info.kp_proc.p_flag => (int) 0x04004804
            // p/x  ~0x800 & 0x04004804 
            // #define P_TRACED        0x00000800      /* Debugged process being traced */
            let p_flag_addr = ptr(this.info).add(Process.pointerSize * 4);
            logz(`\t${p_flag_addr} => ${p_flag_addr.readPointer()}`);
            if (p_flag_addr.readInt() & 0x00000800) {
                loge(`\t! bypass isDebug`);
                p_flag_addr.writePointer(p_flag_addr.readPointer().and(~0x00000800));
            }
        }
    });
};
// _dyld_get_image_name
const hook_get_image_name = () => {
    logd("hook dyld_get_image_name");
    // extern const char* _dyld_get_image_name(uint32_t image_index) 
    // __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
    const addr = Module.findExportByName("libdyld.dylib", "_dyld_get_image_name");
    Interceptor.attach(addr, {
        onEnter(args) {
            this.disp = `[${Process.getCurrentThreadId()}] dyld_get_image_name ( index=${args[0]} | ${args[0].toInt32()} )`;
        },
        onLeave(retval) {
            const ret_str = retval.readCString();
            if (ret_str == null)
                return;
            const disp_str = `${this.disp} => '${ret_str}'`;
            if (!SLOG)
                logd(disp_str);
            if (ret_str.includes("substitute")
                || ret_str.includes("substrate")
                || ret_str.includes("CepheiUI")) {
                loge(disp_str);
                const new_ret = ret_str
                    .replace("substitute-loader", "sl")
                    .replace("substitute", "---")
                    .replace("substrate", "---")
                    .replace("CepheiUI", "---");
                retval.replace(Memory.allocUtf8String(new_ret));
                logd('called from:\n' +
                    Thread.backtrace(this.context, Backtracer.ACCURATE)
                        .map(DebugSymbol.fromAddress).join('\n') + '\n');
                return;
            }
        }
    });
};
const hook_canOpenURL = () => {
    logd("hook canOpenURL");
    const old_Method_canOpenURL = ObjC.classes["UIApplication"]["- canOpenURL:"];
    const old_impl = old_Method_canOpenURL.implementation;
    old_Method_canOpenURL.implementation = ObjC.implement(old_Method_canOpenURL, function (clazz, selector, URLString) {
        // [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.avl.com"]]
        const disp = `canOpenURL ( ${new ObjC.Object(clazz)}, ${ObjC.selectorAsString(selector)}, ${new ObjC.Object(URLString)} )`;
        let retval = old_impl(clazz, selector, URLString);
        if (disp.includes("cydia") || disp.includes("Cydia")) {
            loge(`${retval} <= ${disp}`);
            retval = 0;
        }
        else {
            if (!SLOG)
                logd(`${retval} <= ${disp}`);
        }
        return retval;
    });
};
const hook_URLWithString = () => {
    logd("hook URLWithString");
    const old_func = ObjC.classes.NSURL.URLWithString_;
    const old_impl = old_func.implementation;
    old_func.implementation = ObjC.implement(old_func, function (clazz, selector, URLString) {
        let toCString = new ObjC.Object(URLString).toString();
        const disp = `URLWithString ( '${toCString}' )`;
        if (disp.includes("cydia")) {
            URLString = ObjC.classes.NSString.stringWithString_(toCString.replace("cydia", "ccc"));
            loge(`${disp}`);
        }
        else {
            if (!SLOG)
                logd(`${disp}`);
        }
        return old_impl(clazz, selector, URLString);
    });
};
const hook_NSFileManager = () => {
    logd("hook NSFileManager");
    const isOpenJailFile = [
        "/Application/Cydia.app",
        "/Library/MobileSubstrate/MobileSubstrate.dylib",
        "/bin/bash",
        "/etc/apt",
        "/private/var/lib/apt",
        "/private/var/lib/cydia",
        "/private/var/tmp/cydia.log",
        "/Applications/WinterBoard.app",
        "/var/lib/cydia",
        "/private/etc/dpkg/origins/debian",
        "/bin.sh",
        "/private/etc/apt",
        "/etc/ssh/sshd_config",
        "/private/etc/ssh/sshd_config",
        "/Applications/SBSetttings.app",
        "/private/var/mobileLibrary/SBSettingsThemes/",
        "/private/var/stash",
        "/usr/libexec/sftp-server",
        "/usr/libexec/cydia/",
        "/usr/sbin/frida-server",
        "/usr/bin/cycript",
        "/usr/local/bin/cycript",
        "/usr/lib/libcycript.dylib",
        "/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist",
        "/System/Library/LaunchDaemons/com.saurik.Cy@dia.Startup.plist",
        "/System/Library/LaunchDaemons/com.ikey.bbot.plist",
        "/Applications/FakeCarrier.app",
        "/Library/MobileSubstrate/DynamicLibraries/Veency.plist",
        "/Library/MobileSubstrate/DynamicLibraries/LiveClock.plist",
        "/usr/libexec/ssh-keysign",
        "/usr/libexec/sftp-server",
        "/Applications/blackra1n.app",
        "/Applications/IntelliScreen.app",
        "/Applications/Snoop-itConfig.app",
        "/var/lib/dpkg/info",
        "/Applications/Icy.app",
        "/Applications/MxTube.app",
        "/Applications/RockApp.app",
        "/bin/sh",
        "/usr/bin/ssh",
        "/usr/bin/sshd",
        "/usr/sbin/sshd",
        "/var/cache/apt",
        "/var/log/syslog",
        "/var/tmp/cydia.log",
    ];
    // - fileExistsAtPath:isDirectory:
    // - (BOOL)fileExistsAtPath:(NSString *)path isDirectory:(nullable BOOL *)isDirectory;
    const old_func = ObjC.classes.NSFileManager["- fileExistsAtPath:isDirectory:"];
    const old_impl = old_func.implementation;
    old_func.implementation = ObjC.implement(old_func, function (clazz, selector, fileExistsAtPath, isDirectory) {
        if (!fileExistsAtPath)
            return old_impl(clazz, selector, fileExistsAtPath, isDirectory);
        const toCString = new ObjC.Object(fileExistsAtPath).toString();
        const disp = `fileExistsAtPath:isDirectory: ( '${toCString}', ${isDirectory} )`;
        if (isOpenJailFile.includes(toCString)) {
            loge(`${disp}`);
            // fileExistsAtPath = ObjC.classes.NSString.stringWithString_("zzzz")
            return 0;
        }
        else if (!SLOG) {
            logd(`${disp}`);
        }
        return old_impl(clazz, selector, fileExistsAtPath, isDirectory);
    });
    // fopen
    // FILE	*fopen(const char * __restrict __filename, const char * __restrict __mode)
    Interceptor.attach(Module.findExportByName("libsystem_c.dylib", "fopen"), {
        onEnter(args) {
            const fileName = args[0].readCString();
            if (fileName != null) {
                const disp = `fopen ( ${fileName} )`;
                if (isOpenJailFile.includes(fileName)) {
                    loge(`${disp}`);
                    args[0] = Memory.allocUtf8String("zzzz");
                }
                else if (!SLOG) {
                    logd(`${disp}`);
                }
            }
        }
    });
};
const hook_getenv = () => {
    logd("hook getenv");
    // getenv
    // char	*getenv(const char *);
    Interceptor.attach(Module.findExportByName("libsystem_c.dylib", "getenv"), {
        onEnter(args) {
            this.envName = args[0].readCString();
        },
        onLeave(retval) {
            const disp = `getenv ( ${this.envName} ) | ret: '${retval.readCString()}'`;
            if (this.envName != null && this.envName == "DYLD_INSERT_LIBRARIES") {
                loge(`${disp}`);
                retval.replace(NULL);
                logd('called from:\n' +
                    Thread.backtrace(this.context, Backtracer.ACCURATE)
                        .map(DebugSymbol.fromAddress).join('\n') + '\n');
            }
            else if (!SLOG) {
                logd(`${disp}`);
            }
        }
    });
};
const hook_ptrace = () => {
    logd("hook ptrace");
    // void mRiYXNnZnZmZGF2Ym() {
    //     // No Need to encode these strings, because they will be directly compiled, they are not going to be present in the 'DATA' segment of the binary.
    //     __asm (
    //         "mov r0, #31\n" // set #define PT_DENY_ATTACH (31) to r0
    //         "mov r1, #0\n"   // clear r1
    //         "mov r2, #0\n"   // clear r2
    //         "mov r3, #0\n"   // clear r3
    //         "mov ip, #26\n"  // set the instruction pointer to syscal 26
    //         "svc #0x80\n"    // SVC (formerly SWI) generates a supervisor call. Supervisor calls are normally used to request privileged operations or access to system resources from an operating system
    //         );
    // }
    // ptrace(PT_DENY_ATTACH, 0, 0, 0);
    // ↑ 还有可能是使用系统调用实现 这里不做处理 trace指令查看svc调用 不在这里实现 ↑
    // int ptrace(int request, pid_t pid, caddr_t addr, int data);
    // #define PT_DENY_ATTACH 31
    const PT_DENY_ATTACH = 31;
    const addr = Module.findExportByName("libsystem_kernel.dylib", "ptrace");
    const srcCall = new NativeFunction(addr, "int", ["int", "int", "pointer", "int"]);
    Interceptor.revert(addr);
    Interceptor.replace(addr, new NativeCallback((request, pid, addr, data) => {
        loge(`called ptrace( ${request}, ${pid}, ${addr}, ${data} )`);
        if (request == PT_DENY_ATTACH)
            return 0;
        return srcCall(request, pid, addr, data);
    }, "int", ["int", "int", "pointer", "int"]));
};
const hook_NSClassFromString = () => {
    logd("hook NSClassFromString");
    // 从类名获取类 类似java的Class.forName
    const checkArray = [
        "HBPreferences", // 用于以越狱环境下从偏好设置读取配置项
    ];
    // FOUNDATION_EXPORT Class _Nullable NSClassFromString(NSString *aClassName);
    Interceptor.attach(Module.findExportByName("Foundation", "NSClassFromString"), {
        onEnter(args) {
            // Foundation -> -[NSString(NSStringOtherEncodings) UTF8String]
            try {
                // this.className = new ObjC.Object(args[0]).UTF8String()
                this.className = new ObjC.Object(args[0]).toString();
            }
            catch (error) {
                this.className = '';
            }
        },
        onLeave(retval) {
            if (checkArray.includes(this.className)) {
                loge(`${retval} <= NSClassFromString( '${this.className}' )`);
                retval.replace(NULL);
            }
            else {
                if (!SLOG)
                    logw(`${retval} <= ${this.className}`);
            }
        }
    });
};
globalThis.hook_all_detect = () => {
    hook_stat();
    // hook_NSString_IsEqualToString()
    // hook_isDebugged()
    hook_get_image_name();
    hook_canOpenURL();
    hook_URLWithString();
    hook_NSFileManager();
    hook_getenv();
    hook_ptrace();
    hook_NSClassFromString();
};
globalThis.hook_stat = hook_stat;
globalThis.hook_NSString_IsEqualToString = hook_NSString_IsEqualToString;
globalThis.hook_isDebugged = hook_isDebugged;
globalThis.hook_get_image_name = hook_get_image_name;
globalThis.hook_canOpenURL = hook_canOpenURL;
globalThis.hook_URLWithString = hook_URLWithString;
globalThis.hook_NSFileManager = hook_NSFileManager;
globalThis.hook_getenv = hook_getenv;
globalThis.hook_ptrace = hook_ptrace;
globalThis.hook_NSClassFromString = hook_NSClassFromString;
globalThis.hook_exit = () => {
    Interceptor.attach(Module.findExportByName(null, "exit"), {
        onEnter(args) {
            const backtrace = Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n\t");
            console.warn("\n[-] ======== Backtrace Start  ========");
            console.log(backtrace);
            console.warn("\n[-] ======== Backtrace End  ========");
        },
    });
};
globalThis.hook_strcmp = () => {
    Interceptor.attach(Module.findExportByName(null, "strcmp"), {
        onEnter(args) {
            const arg0 = args[0].readCString();
            const arg1 = args[1].readCString();
            logd(`strcmp ( ${arg0}, ${arg1} )`);
        },
    });
};
// if (ObjC.available) {
//     const NSString = ObjC.classes.NSString
//     Interceptor.attach(NSString["- isEqualToString:"].implementation, {
//         onEnter: function (args) {
//             // args[0] 是 'self'
//             // args[1] 是 '_cmd'（这里的命令或方法选择器）
//             // args[2] 是与之比较的 NSString 对象
//             const selfStr = new ObjC.Object(args[0]).toString()
//             const compareStr = new ObjC.Object(args[2]).toString()
//             this.passStr = `'${selfStr}', '${compareStr}'`
//         },
//         onLeave: function (retval) {
//             logd(`isEqualToString: ( ${this.passStr}) | Returns ${retval}`)
//         }
//     })
// } else {
//     loge("Objective-C runtime is not available.")
// }
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/jailbreak/include.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA;AAClB,OAAO,WAAW,CAAA;AAElB,OAAO,aAAa,CAAA;AACpB,OAAO,YAAY,CAAA"}
✄
import './jail.js';
import './enum.js';
import './thread.js';
import './hooks.js';
✄
{"version":3,"file":"jail.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/jailbreak/jail.ts"],"names":[],"mappings":""}
✄
export {};
✄
{"version":3,"file":"thread.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/jailbreak/thread.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,GAAE,EAAE;IAEpB,yCAAyC;IACzC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,EAAC;QACnF,OAAO,EAAE,UAAS,IAAI;YAClB,MAAM,SAAS,GAAG,gBAAgB;gBAC9B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC;qBAC9C,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;YACvD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;YACtB,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;gBAChC,IAAI,CAAC,2BAA2B,CAAC,CAAA;aACpC;iBAAM;gBACH,IAAI,CAAC,2BAA2B,CAAC,CAAA;aACpC;YACD,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;YACxC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAClC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YAClC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QACtC,CAAC;KACJ,CAAC,CAAA;AAEN,CAAC,CAAA;AAMD,UAAU,CAAC,WAAW,GAAG,WAAW,CAAA"}
✄
const hook_thread = () => {
    // libsystem_pthread.dylib!_pthread_start
    Interceptor.attach(Module.getExportByName("libsystem_pthread.dylib", "_pthread_start"), {
        onEnter: function (args) {
            const backTrace = 'called from:\n' +
                Thread.backtrace(this.context, Backtracer.ACCURATE)
                    .map(DebugSymbol.fromAddress).join('\n') + '\n';
            console.log(backTrace);
            if (backTrace.includes("tersafe2")) {
                loge("[!] _pthread_start called");
            }
            else {
                logd("[!] _pthread_start called");
            }
            console.log("[*] _pthread_start called");
            console.log("[*] args[0]", args[0]);
            console.log("[*] args[1]", args[1]);
            console.log("[*] args[2]", args[2]);
        }
    });
};
globalThis.hook_thread = hook_thread;
export {};
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/include.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AACxB,OAAO,oBAAoB,CAAA"}
✄
import './oc/include.js';
import './swift/include.js';
✄
{"version":3,"file":"ViewController.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/ViewController.ts"],"names":[],"mappings":"AAEA,MAAM,mBAAmB,GAA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AwF;AACxF,0BAA0B;AAC1B,mDAAmD;AACnD,wEAAwE;AACxE,iCAAiC;AACjC,aAAa;AACb,4BAA4B;AAE5B,aAAa;AACb,SAAS;AAET,6GAA6G;AAC7G,kDAAkD;AAClD,gHAAgH;AAChH,8DAA8D;AAC9D,sDAAsD;AACtD,+GAA+G;AAC/G,qFAAqF;AACrF,sHAAsH;AACtH,qFAAqF;AACrF,qBAAqB;AACrB,SAAS;AACT,KAAK"}
✄
const hook_ViewController = () => {
    {
        // enter ↓
        // - presentViewController:animated:completion:
        Interceptor.attach(ObjC.classes["UIViewController"]["- presentViewController:animated:completion:"].implementation, {
            onEnter(args) {
                const instance = new ObjC.Object(args[0]);
                logd(`\nCalled presentViewController:'${instance}' -> '${new ObjC.Object(args[2])}' animated:'${args[3]}' completion:${args[4]}`);
                const _storyboard = instance.$ivars["_storyboard"];
                const _modalPresentationStyle = instance.$ivars["_modalPresentationStyle"];
                logz(`\t_storyboard:${_storyboard} | _modalPresentationStyle:${_modalPresentationStyle}`);
            }
        });
        // - presentViewController:withTransition:completion:
        Interceptor.attach(ObjC.classes["UIViewController"]["- presentViewController:animated:completion:"].implementation, {
            onEnter(args) {
                const instance = new ObjC.Object(args[0]);
                logd(`\nCalled presentViewController:'${instance}' -> '${new ObjC.Object(args[2])}' withTransition:'${args[3]}' completion:${args[4]}`);
                const _storyboard = instance.$ivars["_storyboard"];
                const _modalPresentationStyle = instance.$ivars["_modalPresentationStyle"];
                logz(`\t_storyboard:${_storyboard} | _modalPresentationStyle:${_modalPresentationStyle}`);
            }
        });
    }
    {
        // exit ↓
        // - dismissModalViewControllerAnimated:
        Interceptor.attach(ObjC.classes["UIViewController"]["- dismissModalViewControllerAnimated:"].implementation, {
            onEnter(args) {
                const instance = new ObjC.Object(args[0]);
                logd(`\nCalled dismissModalViewControllerAnimated:'${instance}' animated:'${args[2]}'`);
            }
        });
        // - dismissModalViewControllerWithTransition:
        Interceptor.attach(ObjC.classes["UIViewController"]["- dismissModalViewControllerWithTransition:"].implementation, {
            onEnter(args) {
                const instance = new ObjC.Object(args[0]);
                logd(`\nCalled dismissModalViewControllerWithTransition:'${instance}' Transition:'${args[2]}'`);
            }
        });
        // // - dismissViewControllerAnimated:completion:
        Interceptor.attach(ObjC.classes["UIViewController"]["- dismissViewControllerAnimated:completion:"].implementation, {
            onEnter(args) {
                const instance = new ObjC.Object(args[0]);
                logd(`\nCalled dismissViewControllerAnimated:'${instance}' Animated:'${args[2]}' completion:'${args[3]}'`);
            }
        });
        // const src_function = new NativeFunction(ObjC.classes["UIViewController"]["- dismissViewControllerAnimated:completion:"].implementation, "void", ["pointer"])
        // Interceptor.replace(ObjC.classes["UIViewController"]["- dismissViewControllerAnimated:completion:"].implementation, new NativeCallback((_instance: NativePointer, a1: NativePointer, a2: NativePointer) => {
        //     const instance = new ObjC.Object(_instance)
        //     logd(`\nCalled dismissViewControllerAnimated:'${instance}' Animated:'${a1}' completion:'${a2}'`)
        //     return
        //     // return src_function(instance)
        // }, "void", ["pointer", "pointer", "pointer"]))
        // - dismissViewControllerWithTransition:completion:
        Interceptor.attach(ObjC.classes["UIViewController"]["- dismissViewControllerWithTransition:completion:"].implementation, {
            onEnter(args) {
                const instance = new ObjC.Object(args[0]);
                logd(`\nCalled dismissViewControllerWithTransition:'${instance}' Transition:'${args[2]}' completion:'${args[3]}'`);
            }
        });
    }
};
const hook_UIAlertController = (pbt = false) => {
    // UIAlertController + alertControllerWithTitle:message:preferredStyle:
    Interceptor.attach(ObjC.classes["UIAlertController"]["+ alertControllerWithTitle:message:preferredStyle:"].implementation, {
        onEnter(args) {
            const title = new ObjC.Object(args[2]);
            const msg = new ObjC.Object(args[3]);
            logd(`\nCalled alertControllerWithTitle:'${title}' message:'${msg}' preferredStyle:${args[4]}`);
        }, onLeave(retval) {
            const instance = new ObjC.Object(retval);
            const _actions = instance.$ivars["_actions"];
            const count = _actions["- count"]();
            logz(`\t${instance} | actions:${_actions.handle} [ ${count} ]`);
            if (pbt)
                printBacktrace(this.context);
        }
    });
    // UIAlertController - addAction:
    Interceptor.attach(ObjC.classes["UIAlertController"]["- addAction:"].implementation, {
        onEnter(args) {
            const instance = new ObjC.Object(args[0]);
            const action = new ObjC.Object(args[2]);
            logd(`\nCalled UIAlertController '${instance}' - addAction:'${action}'`);
            this.ins = instance;
        }, onLeave(retval) {
            const instance = this.ins;
            const _actions = instance.$ivars["_actions"];
            const count = _actions["- count"]();
            logz(`\t${instance} | actions:${_actions} [ ${count} ]`);
            if (pbt)
                printBacktrace(this.context);
        }
    });
    // UIAlertAction + actionWithTitle:style:handler:
    Interceptor.attach(ObjC.classes["UIAlertAction"]["+ actionWithTitle:style:handler:"].implementation, {
        onEnter(args) {
            const title = new ObjC.Object(args[2]);
            try {
                // !todo parse Block
                logd(`\nCalled UIAlertAction actionWithTitle:'${title}' style:'${args[3]}' handler:'${new ObjC.Block(args[4])}'`);
            }
            catch (error) {
                logd(`\nCalled UIAlertAction actionWithTitle:'${title}' style:'${args[3]}' handler:'${args[4]}'`);
            }
            if (pbt)
                printBacktrace(this.context);
        }
    });
    // var newReplyBlock = new ObjC.Block({
    //     retType: 'void',
    //     argTypes: ['int', 'pointer'],
    //     implementation: function (successOrFailure, nsError) {
    //         console.log("Success: "+successOrFailure)
    //     }
    // });
};
globalThis.hook_ViewController = hook_ViewController;
globalThis.hook_UIAlertController = hook_UIAlertController;
export {};
// setImmediate(() => {
//     Interceptor.attach(ObjC.classes["UIViewController"]["- viewDidLoad"].implementation, {
//         onEnter(args) {
//             const obj = new ObjC.Object(args[0])
//             console.warn(`\nCalled UIViewController viewDidLoad:'${obj}'`)
//         }
//     })
//     Interceptor.attach(ObjC.classes["Runner.NRViewController"]["- viewDidLoad"].implementation, {
//         onEnter(args) {
//             const obj = new ObjC.Object(args[0])
//             console.warn(`\nCalled NRViewController viewDidLoad:'${obj}'`)
//         }
//     })
//     // - application:didFinishLaunchingWithOptions:
//     // Interceptor.attach(ObjC.classes["Runner.AppDelegate"]["- application:didFinishLaunchingWithOptions:"].implementation, {
//     //     onEnter(args) {
//     //         const obj = new ObjC.Object(args[0])
//     //         console.warn(`\nCalled AppDelegate didFinishLaunchingWithOptions:'${obj}'`)
//     //         this.ins = args[0]
//     //     },
//     //     onLeave(retval) {
//     //         console.log(`${new ObjC.Object(this.ins).$ivars["_window"].$ivars["_rootViewController"]}`)
//     //         new ObjC.Object(this.ins).$ivars["_window"].$ivars["_rootViewController"] = ObjC.classes["Runner.NRViewController"]["new"]()
//     //         const backtrace = Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join("\n\t")
//     //         console.log(backtrace)
//     //         console.log(`${new ObjC.Object(this.ins).$ivars["_window"].$ivars["_rootViewController"]}`)
//     //     },
//     // })
//     const addr = ptr(ObjC.classes["Runner.AppDelegate"]["- application:didFinishLaunchingWithOptions:"].implementation)
//     console.error(addr)
//     const src_function = new NativeFunction(addr, "pointer", ["pointer", "pointer", "pointer"])
//     Interceptor.replace(addr, new NativeCallback((_instance: NativePointer, sel: NativePointer, launchOptions: NativePointer) => {
//         let ret = src_function(_instance, sel, launchOptions)
//         const instance = new ObjC.Object(_instance)
//         logd(`\nCalled didFinishLaunchingWithOptions:'${instance}' launchOptions:'${launchOptions}'`)
//         console.log(`${instance.$ivars["_window"].$ivars["_rootViewController"]}`)
//         instance.$ivars["_window"].$ivars["_rootViewController"] = ObjC.classes["Runner.NRViewController"]["new"]()
//         console.log(`${instance.$ivars["_window"].$ivars["_rootViewController"]}`)
//         return ret
//     }, "pointer", ["pointer", "pointer", "pointer"]))
//     Interceptor.attach(ObjC.classes["FlutterAppDelegate"]["- init"].implementation, {
//         onEnter(args) {
//             const obj = new ObjC.Object(args[0])
//             console.warn(`\nCalled FlutterAppDelegate init:'${obj}'`)
//             this.ins = args[0]
//         },
//         onLeave(retval) {
//         },
//     })
//     var target_method = ObjC.classes["Runner.AppDelegate"]["- application:didFinishLaunchingWithOptions:"]
//     var old_impl = target_method.implementation
//     target_method.implementation = ObjC.implement(target_method, function (_instance, s, s1, launchOptions) {
//         let ret = old_impl(_instance, s, s1, launchOptions)
//         const instance = new ObjC.Object(_instance)
//         console.log(`\nCalled didFinishLaunchingWithOptions:'${instance}' launchOptions:'${launchOptions}'`)
//         console.log(`${instance.$ivars["_window"].$ivars["_rootViewController"]}`)
//         instance.$ivars["_window"].$ivars["_rootViewController"] = ObjC.classes["Runner.NRViewController"]["new"]()
//         console.log(`${instance.$ivars["_window"].$ivars["_rootViewController"]}`)
//         return ret
//     })
// })
✄
{"version":3,"file":"button.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/button.ts"],"names":[],"mappings":"AAEA,oDAAoD;AACpD,4GAA4G;AAC5G,gIAAgI;AAChI,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AAEjF,sGAAsG;AACtG,2HAA2H;AAC3H,2JAA2J;AAE3J,oGAAoG;AACpG,iFAAiF;AACjF,iFAAiF;AACjF,oHAAoH;AAEpH,yGAAyG;AACzG,wGAAwG;AACxG,4HAA4H;AAC5H,kIAAkI;AAClI,mFAAmF;AACnF,KAAK;AACL,IAAK,eAuBJ;AAvBD,WAAK,eAAe;IAChB,uDAAS,CAAA;IACT,yEAAuB,CAAA;IACvB,qFAA6B,CAAA;IAC7B,qFAA6B,CAAA;IAC7B,uFAA8B,CAAA;IAC9B,oFAA4B,CAAA;IAC5B,kFAA2B,CAAA;IAC3B,kFAA2B,CAAA;IAC3B,qFAA4B,CAAA;IAC5B,+EAAyB,CAAA;IACzB,kFAA2B,CAAA;IAC3B,sGAAqC,CAAA;IACrC,iGAAkC,CAAA;IAClC,yFAA8B,CAAA;IAC9B,wFAA6B,CAAA;IAC7B,sFAA4B,CAAA;IAC5B,kGAAkC,CAAA;IAClC,sFAAgC,CAAA;IAChC,4FAAkC,CAAA;IAClC,qGAAqC,CAAA;IACrC,4FAAgC,CAAA;IAChC,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gB,CAAC,CAAA;IAC5C,IAAI,OAAO,CAAC,MAAM,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAA;IACtE,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,EAAY,CAAA;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC5B,MAAM,QAAQ,GAAgB,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;QAC5D,MAAM,IAAI,GAA0B,IAAI,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC9E,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;KACzB;AACL,CAAC,CAAA;AAMD,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,CAAA"}
✄
// typedef NS_OPTIONS(NSUInteger, UIControlEvents) {
//     UIControlEventTouchDown                                         = 1 <<  0,      // on all touch downs
//     UIControlEventTouchDownRepeat                                   = 1 <<  1,      // on multiple touchdowns (tap count > 1)
//     UIControlEventTouchDragInside                                   = 1 <<  2,
//     UIControlEventTouchDragOutside                                  = 1 <<  3,
//     UIControlEventTouchDragEnter                                    = 1 <<  4,
//     UIControlEventTouchDragExit                                     = 1 <<  5,
//     UIControlEventTouchUpInside                                     = 1 <<  6,
//     UIControlEventTouchUpOutside                                    = 1 <<  7,
//     UIControlEventTouchCancel                                       = 1 <<  8,
//     UIControlEventValueChanged                                      = 1 << 12,     // sliders, etc.
//     UIControlEventPrimaryActionTriggered API_AVAILABLE(ios(9.0))    = 1 << 13,     // semantic action: for buttons, etc.
//     UIControlEventMenuActionTriggered API_AVAILABLE(ios(14.0))      = 1 << 14,     // triggered when the menu gesture fires but before the menu presents
//     UIControlEventEditingDidBegin                                   = 1 << 16,     // UITextField
//     UIControlEventEditingChanged                                    = 1 << 17,
//     UIControlEventEditingDidEnd                                     = 1 << 18,
//     UIControlEventEditingDidEndOnExit                               = 1 << 19,     // 'return key' ending editing
//     UIControlEventAllTouchEvents                                    = 0x00000FFF,  // for touch events
//     UIControlEventAllEditingEvents                                  = 0x000F0000,  // for UITextField
//     UIControlEventApplicationReserved                               = 0x0F000000,  // range available for application use
//     UIControlEventSystemReserved                                    = 0xF0000000,  // range reserved for internal framework use
//     UIControlEventAllEvents                                         = 0xFFFFFFFF
// };
var UIControlEvents;
(function (UIControlEvents) {
    UIControlEvents[UIControlEvents["UNDEF"] = 0] = "UNDEF";
    UIControlEvents[UIControlEvents["EventTouchDown"] = 1] = "EventTouchDown";
    UIControlEvents[UIControlEvents["EventTouchDownRepeat"] = 2] = "EventTouchDownRepeat";
    UIControlEvents[UIControlEvents["EventTouchDragInside"] = 4] = "EventTouchDragInside";
    UIControlEvents[UIControlEvents["EventTouchDragOutside"] = 8] = "EventTouchDragOutside";
    UIControlEvents[UIControlEvents["EventTouchDragEnter"] = 16] = "EventTouchDragEnter";
    UIControlEvents[UIControlEvents["EventTouchDragExit"] = 32] = "EventTouchDragExit";
    UIControlEvents[UIControlEvents["EventTouchUpInside"] = 64] = "EventTouchUpInside";
    UIControlEvents[UIControlEvents["EventTouchUpOutside"] = 128] = "EventTouchUpOutside";
    UIControlEvents[UIControlEvents["EventTouchCancel"] = 256] = "EventTouchCancel";
    UIControlEvents[UIControlEvents["EventValueChanged"] = 4096] = "EventValueChanged";
    UIControlEvents[UIControlEvents["EventPrimaryActionTriggered"] = 8192] = "EventPrimaryActionTriggered";
    UIControlEvents[UIControlEvents["EventMenuActionTriggered"] = 16384] = "EventMenuActionTriggered";
    UIControlEvents[UIControlEvents["EventEditingDidBegin"] = 65536] = "EventEditingDidBegin";
    UIControlEvents[UIControlEvents["EventEditingChanged"] = 131072] = "EventEditingChanged";
    UIControlEvents[UIControlEvents["EventEditingDidEnd"] = 262144] = "EventEditingDidEnd";
    UIControlEvents[UIControlEvents["EventEditingDidEndOnExit"] = 524288] = "EventEditingDidEndOnExit";
    UIControlEvents[UIControlEvents["EventAllTouchEvents"] = 4095] = "EventAllTouchEvents";
    UIControlEvents[UIControlEvents["EventAllEditingEvents"] = 983040] = "EventAllEditingEvents";
    UIControlEvents[UIControlEvents["EventApplicationReserved"] = 251658240] = "EventApplicationReserved";
    UIControlEvents[UIControlEvents["EventSystemReserved"] = 4026531840] = "EventSystemReserved";
    UIControlEvents[UIControlEvents["EventAllEvents"] = 4294967295] = "EventAllEvents";
})(UIControlEvents || (UIControlEvents = {}));
// iVar        Value
// ----------  -------------------------
// isa         {'handle': '0x203101748'}
// _target     {'handle': '0x13f111ff0'}
// _action     0x1044ba8a0
// _eventMask  64
// _cancelled  False
class UIControlTargetAction {
    constructor(ptr) {
        this.isa = NULL;
        this._target = NULL;
        this._action = NULL;
        this._eventMask = UIControlEvents.UNDEF;
        this._cancelled = false;
        this.isa = ptr.readPointer();
        this._target = ptr.add(1 * Process.pointerSize).readPointer();
        this._action = ptr.add(2 * Process.pointerSize).readPointer();
        this._eventMask = ptr.add(3 * Process.pointerSize).readU32();
        this._cancelled = ptr.add(3 * Process.pointerSize + 4).readU8() != 0;
        this._target_ins = new ObjC.Object(this._target);
        this._action_str = this._action.readCString();
    }
    parseAction() {
        const _fullName = this._target_ins.$methods.filter(i => i.includes(this._action_str))[0];
        const _action_method = this._target_ins.$class[_fullName];
        return `${ptr(_action_method)} -> ${_action_method.implementation}`;
    }
    toString() {
        return `target: ${this._target_ins}\n\taction: ${this._action} | '${this._action_str}' | ${this.parseAction()}\n\teventMask: ${this._eventMask}, cancelled: ${this._cancelled}`;
    }
}
const showButtonActions = (ptr) => {
    const mPtr = checkPointer(ptr);
    let obj = new ObjC.Object(mPtr);
    if (!getSuperClasses(mPtr).map(i => i.$className).includes("UIButton")) {
        // UIButtonLabel props ↓
        // UIButtonLabel extends UILabel ? Four new member variables have been added ?
        // ......
        // [68] _reverseShadow: | boolean
        //         false
        // [69] _button: | ObjC.Object <- instance of UPXCommonButton @ 0x1060b72b0
        //         0x107da0cc0
        // [70] _cachedDefaultAttributes: | ObjC.Object <- instance of __NSDictionaryM @ 0x1dc788050
        //         0x2820daee0
        // [71] _fontIsDefaultForIdiom: | boolean
        //         false
        if (getFields(mPtr).includes("_button")) {
            obj = obj.$ivars["_button"];
        }
        else {
            throw new Error(`pointer --//--> class extends UIButton ${ObjC.classes['UIButton']} ? C:${obj}`);
        }
    }
    const actions = obj.$ivars["_targetActions"];
    if (actions.isNull())
        throw new Error(`targetActions == ${actions} }`);
    const count = actions["- count"]();
    for (let i = 0; i < count; i++) {
        const item_obj = actions["- objectAtIndex:"](i);
        const item = new UIControlTargetAction(item_obj.handle);
        logd(`[${i}] ${item}`);
    }
};
globalThis.showButtonActions = showButtonActions;
export {};
✄
{"version":3,"file":"clazz.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/clazz.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,MAAM;IAE1C,YAAY,IAAkB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,IAAI,CAAC,KAAK,IAAI,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAC7G,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,UAAU,CAAA;IAC1B,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,UAAU,CAAA;IAC1B,CAAC;IAEM,QAAQ;QACX,OAAO,MAAM,IAAI,CAAC,cAAc,IAAI,IAAI,EAAE,CAAA;IAC9C,CAAC;CACJ;AAaD,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,aAAa,CAAA;AACrC,yEAAyE;AAEzE,+DAA+D;AAC/D,2CAA2C;AAC3C,sBAAsB;AACtB,QAAQ;AACR,KAAK"}
✄
export class ObjCClassIMPL extends ObjC.Object {
    constructor(mPtr) {
        super(mPtr);
        if (this.$kind == "meta-class")
            throw new Error(`this ptr can not cast to class | current:${this.$kind}`);
    }
    get name() {
        return this.$className;
    }
    getName() {
        return this.$className;
    }
    toString() {
        return `C: ${this.implementation} ${this}`;
    }
}
globalThis.ObjC.Class = ObjCClassIMPL;
// Reflect.setPrototypeOf(ObjCClassIMPL.prototype, ObjC.Object.prototype)
// Object.defineProperty(ObjCClassIMPL.prototype, "toString", {
//     value: function toString(): string {
//         return `C:`
//     }
// })
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/include.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AACnB,OAAO,aAAa,CAAA;AACpB,OAAO,SAAS,CAAA;AAEhB,OAAO,aAAa,CAAA;AACpB,OAAO,qBAAqB,CAAA;AAE5B,OAAO,oBAAoB,CAAA"}
✄
import './clazz.js';
import './method.js';
import './oc.js';
import './button.js';
import './ViewController.js';
import './types/include.js';
✄
{"version":3,"file":"method.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/method.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,MAAM;IAE3C,QAAQ;QACJ,OAAO,MAAM,IAAI,CAAC,cAAc,IAAI,IAAI,EAAE,CAAA;IAC9C,CAAC;IAED,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,cAAc,CAAA;IAC9B,CAAC;CACJ;AAYD,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,cAAc,CAAA"}
✄
export class ObjCMethodIMPL extends ObjC.Object {
    toString() {
        return `C: ${this.implementation} ${this}`;
    }
    get ptr() {
        return this.implememtation;
    }
}
globalThis.ObjC.Method = ObjCMethodIMPL;
✄
{"version":3,"file":"oc.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/oc.ts"],"names":[],"mappings":"AAAA,IAAI,aAAa,GAAkB,EAAE,CAAA;AAErC,UAAU,CAAC,aAAa,GAAG,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cacheAllClass = Object.values(ObjC.classes);
    return cacheAllClass;
};
// findMethodsByResolver("-[* *Jail*]")
// findMethodsByResolver("-[NSString *stringWith*]")
globalThis.findMethodsByResolver = (query) => {
    if (query == null)
        throw new Error("query cannot be null");
    let count = 0;
    new ApiResolver("objc")
        .enumerateMatches(query)
        .forEach((m) => {
        try {
            // todo parse address to method
            // const dbgs = DebugSymbol.fromAddress(m.address)
            // [iPhone::设置 ]-> DebugSymbol.fromAddress(ptr(0x19c8bba00))
            // {
            //     "address": "0x19c8bba00",
            //     "column": 0,
            //     "fileName": "",
            //     "lineNumber": 0,
            //     "moduleName": "Preferences",
            //     "name": "-[PSTableCell cellTarget]"
            // }
            // Name                    ->      cellTarget
            // NumberOfArguments       ->      2
            // TypeEncoding            ->      @16@0:8
            // ObjectMethod            ->      0x19c9a82d1
            // Implementation          ->      0x19c8bba00 | 0x35a00
            // ReturnType
            //         ret:            @ - object
            // ArgumentTypes
            //         args[0]:        @ - object
            //         args[1]:        : - selector
        }
        catch (error) {
        }
        logd(`[ ${count++} ]\t${m.address}\t${m.name}`);
    });
};
const getClassFromMethodName = (name, filterClass) => {
    let cls;
    for (let i = 0; i < filterClass.length; i++) {
        cls = filterClass[i];
        if (cls[name])
            return cls;
    }
};
export function getClassPtrDebugInfo(cls) {
    try {
        const debugSym = DebugSymbol.fromAddress(cls.handle);
        const md = Process.findModuleByName(debugSym.moduleName);
        return `${debugSym.name} IN ${debugSym.moduleName} [ ${md?.path} ${ptr(md?.size)} ]`;
    }
    catch (error) {
        return '';
    }
}
globalThis.showMethods = (clsNameOrPtr, filter = '', includeParent = false) => {
    const obj = new ObjC.Object(checkPointer(clsNameOrPtr));
    logw(`\nDisplay methods of ${obj.$className} @ ${obj.$class.handle}`);
    logz(getClassPtrDebugInfo(obj.$class));
    showSuperClasses(obj.handle);
    // const supClasses = getSuperClasses(obj)
    let count = 0;
    {
        (() => { return includeParent ? obj.$methods : obj.$ownMethods; })()
            .filter(m => filter.length == 0 ? true : m.includes(filter))
            .sort((i1, i2) => i2.localeCompare(i1))
            .map((m, i) => {
            count = i;
            try {
                // !todo 在 includeParent 启用的时候 分组展示类方法
                // const extra = "C: " + (includeParent ? `${getClassFromMethodName(m, supClasses)?.$class.handle}` : '')
                const _extra = '';
                // class methods
                const method = obj.$class[m];
                const impl = method.implementation;
                const md = Process.findModuleByAddress(impl);
                let extraDes = "-> ";
                try {
                    // after objc.implement, An error will be triggered here.
                    const rva = String(impl.sub(md?.base)).padEnd(11, ' ');
                    extraDes += `${rva} `;
                }
                catch (error) {
                    extraDes = '';
                }
                return `[ ${i} ]\t M: ${ptr(method)} -> ${impl} ${extraDes}\t| ${m}`;
            }
            catch (error) {
                // instance methods
                const selector = call("NSSelectorFromString", allocOCString(m.substring(m.indexOf(' ') + 1)));
                const method = ObjC.api.class_getInstanceMethod(obj, selector);
                const impl = ObjC.api.method_getImplementation(method);
                const md = Process.findModuleByAddress(impl);
                let extraDes = "-> ";
                try {
                    // after objc.implement, An error will be triggered here.
                    const rva = String(impl.sub(md?.base)).padEnd(11, ' ');
                    extraDes += `${rva} `;
                }
                catch (error) {
                    extraDes = '';
                }
                return `[ ${i} ]\t M: ${method} -> ${impl} ${extraDes}\t| ${m}`;
            }
        })
            .forEach((item, i) => item.includes(' _') ? logz(item) : logd(item));
    }
    logn(`\n{ F:${count + 1} / A:${obj.$methods.length} }\n`);
};
// FIXME: This function is deprecated, use findMethodsByResolver instead
// globalThis.findMethods = (query: string, className?: string, accurate = false) => {
//     if (query == null)
//         throw new Error("query cannot be null")
//     let count: number = 0
//     if (!className) {
//         getCachedClasses().forEach(cls => ItorClassMethods(cls, query, accurate))
//     } else {
//         ItorClassMethods(ObjC.classes[className], query, accurate)
//     }
//     newLine()
//     function ItorClassMethods(cls: ObjC.Object, query: string, accurate: boolean) {
//         const methods = cls.$methods.filter((m) => accurate ? m == query : m.includes(query))
//         if (methods.length != 0) logw(`\n[!] ${cls.handle} | ${methods.length} | ${cls.$className} \n`)
//         else throw new Error(`class methods len = ${cls.$methods} ... after Fileter ${methods.length}`)
//         methods
//             .map((m, i) => {
//                 try {
//                     // class methods
//                     const method = cls.$class[m]
//                     const impl = method.implementation // throw error while type of class is instance
//                     const md = Process.findModuleByAddress(impl)
//                     let extraDes: string = "-> "
//                     try {
//                         // after objc.implement, An error will be triggered here.
//                         const rva = String(impl.sub(md?.base!)).padEnd(11, ' ')
//                         extraDes += `${rva} `
//                     } catch (error) {
//                         extraDes = ''
//                     }
//                     return `[ ${i} ]\t M: ${ptr(method)} -> ${impl} ${extraDes} | ${m}`
//                 } catch (error) {
//                     // instance methods
//                     const selector = call("NSSelectorFromString", allocOCString(m.substring(m.indexOf(' ') + 1)))
//                     const method = call("class_getInstanceMethod", cls, selector)
//                     const impl = call("method_getImplementation", method)
//                     const md = Process.findModuleByAddress(impl)
//                     let extraDes: string = "-> "
//                     try {
//                         // after objc.implement, An error will be triggered here.
//                         const rva = String(impl.sub(md?.base!)).padEnd(11, ' ')
//                         extraDes += `${rva} `
//                     } catch (error) {
//                         extraDes = ''
//                     }
//                     return `[ ${i} ]\t M: ${method} -> ${impl} ${extraDes} | ${m}`
//                 }
//             })
//             .sort((a, b) => b[0].localeCompare(a[0]))
//             .map(m => `[ ${count++} ]\t${m}`)
//             .forEach(logd)
//     }
// }
globalThis.findClasses = (query, accurate = false) => {
    if (query == null)
        throw new Error("query cannot be null");
    newLine();
    let count = 0;
    // 不全
    // ObjC.enumerateLoadedClasses({
    //     onMatch(name: string, owner: string) {
    //         if (accurate ? name == query : name.includes(query))
    //             logd(`[ ${count++} ] ${ObjC.classes[name].$class.handle} ${name} ${owner}`)
    //     },
    //     onComplete() {
    //         logw(`\n[findClasses] onComplete | [ ${count} ]\n`)
    //     }
    // })
    getCachedClasses()
        .filter(cls => accurate ? cls.$className == query : cls.$className.includes(query))
        .forEach(cls => {
        logd(`[ ${count++} ]\t${cls.$class.handle}  ${cls.$className}`);
        const md = Process.findModuleByName(cls.$moduleName);
        logz(`\t${md?.base} ${ptr(md?.size)} \t ${cls.$moduleName}`);
    });
    newLine();
};
globalThis.getSuperClasses = (ptr) => {
    const obj = new ObjC.Object(checkPointer(ptr));
    let cls_itor = obj;
    let arr = [cls_itor];
    while (true) {
        try {
            if (cls_itor.isNull() || cls_itor.handle.isNull())
                break;
            cls_itor = cls_itor.$superClass;
            if (cls_itor != null)
                arr.push(cls_itor);
        }
        catch (error) {
            break;
        }
    }
    return arr;
};
const showSuperClasses = (ptr) => {
    if (ptr instanceof ObjC.Object)
        ptr = ptr.handle;
    const arr = getSuperClasses(checkPointer(ptr));
    let disp = '';
    try {
        for (let i = 0; i < arr.length; i++) {
            const className = arr[i].$className;
            const classHandle = arr[i].$class.handle;
            const debugInfo = getClassPtrDebugInfo(arr[i]);
            // logw(debugInfo)
            const color = (debugInfo.includes("/System/Library/") || debugInfo.includes("/usr/lib/")) ? 94 : 36;
            disp += `\x1b[${color}m${className} ( ${classHandle} )\x1b[0m`;
            if (i < arr.length - 1)
                disp += ' -> ';
        }
    }
    catch (error) { }
    log(`\n${disp}\n`);
};
const showSubClasses = (ptr) => {
    const cur = new ObjC.Object(checkPointer(ptr));
    logw(`\nDisplay sub classes of ${cur.$className} @ ${cur.$class.handle} \n`);
    getCachedClasses()
        .filter(item => {
        const sup = item.$superClass;
        if (sup == undefined || sup == null)
            return false;
        return sup.equals(cur.$class);
    })
        .sort((a, b) => a.$className.localeCompare(b.$className))
        .forEach((item, index) => {
        const disp = `[ ${index} ]\t${item.$class.handle} -> ${item.$className}`;
        item.$className.startsWith('_') ? logz(disp) : logd(disp);
    });
    newLine();
};
globalThis.m = globalThis.showMethods;
globalThis.showMethod = (method, extName) => {
    let localM = NULL;
    try {
        if (typeof method === 'number') {
            localM = checkPointer(method);
        }
        else if (typeof method === 'string') {
            localM = nameToMethod(method).handle;
        }
        else if (method instanceof NativePointer) {
            localM = checkPointer(method);
        }
        else
            throw new Error(`method must be a number or string or NativePointer, but got ${method}`);
    }
    catch (error) {
        // try use ApiResolver to find (methodName)
        if (typeof method == "string") {
            let found;
            if (method.includes('[')) {
                found = new ApiResolver("objc").enumerateMatches(method);
            }
            else {
                found = new ApiResolver("objc").enumerateMatches(`*[* ${method}]`);
            }
            if (found != undefined && found != null && found.length != 0) {
                found.forEach(item => showMethod(nameToMethod(item.name).handle, item.name));
            }
            else {
                throw new Error(`Not Found -> ${method}`);
            }
            return;
        }
        else
            throw error;
    }
    logs(getLine(60, '-'));
    // OBJC_EXPORT SEL _Nonnull method_getName(Method _Nonnull m)
    const name = ObjC.api.method_getName(localM).readCString();
    logd(`Name\t\t\t->\t${name} ${extName == undefined ? '' : ` | ${extName}`}`);
    const argsCount = call("method_getNumberOfArguments", localM).toInt32();
    logd(`NumberOfArguments\t->\t${argsCount}`);
    // OBJC_EXPORT const char * _Nullable method_getTypeEncoding(Method _Nonnull m) 
    const typeEncoding = ObjC.api.method_getTypeEncoding(localM).readCString();
    logd(`TypeEncoding\t\t->\t${typeEncoding}`);
    // // struct objc_method_description {
    // //     SEL _Nullable name;               /**< The name of the method */
    // //     char * _Nullable types;           /**< The types of the method arguments */
    // // };
    // class objc_method_description {
    //     name: NativePointer
    //     types: NativePointer
    //     constructor(public mPtr: NativePointer) {
    //         this.name = mPtr
    //         this.types = mPtr.add(Process.pointerSize)
    //     }
    //     public toString() {
    //         return `name: ${this.name.readPointer().readCString()} types: ${this.types.readPointer().readCString()}`
    //     }
    // }
    // // alias name + types ↓
    // const description = new objc_method_description(call("method_getDescription", localM))
    // logd(`Description\t\t->\t${description}`)
    logd(`ObjectMethod\t\t->\t${localM}`);
    // OBJC_EXPORT IMP _Nonnull method_getImplementation(Method _Nonnull m) 
    const implementation = ObjC.api.method_getImplementation(localM);
    let extraDes;
    try {
        const md = Process.findModuleByAddress(implementation);
        let rva = '';
        // if (md == null) {
        //     rva = `${OC_Hook_Status.getNewImplFromOCMethod(localM)} [R]`
        // } else {
        rva = `${implementation.sub(md.base)}`;
        // }
        extraDes = `| ${rva} `;
        logd(`Implementation\t\t->\t${implementation} ${extraDes}`);
    }
    catch (error) {
        // already modify
        extraDes = '';
        logz(`Implementation\t\t->\t${implementation} ${extraDes}`);
    }
    const pk = getArgsAndRet(localM);
    logd('ArgumentTypes');
    pk.args.forEach((item, index) => logd(`\targs[${index}]:\t${item} - ${parseType(item)}`));
    logd(`ReturnType`);
    logd(`\tret: \t\t${pk.ret} - ${parseType(pk.ret)}`);
    logs(getLine(60, '-'));
};
globalThis.showMethodSignature = (method, extName) => {
    let localM = NULL;
    try {
        if (typeof method === 'number') {
            localM = checkPointer(method);
        }
        else if (typeof method === 'string') {
            localM = nameToMethod(method).handle;
        }
        else if (method instanceof NativePointer) {
            localM = checkPointer(method);
        }
        else
            throw new Error(`method must be a number or string or NativePointer, but got ${method}`);
    }
    catch (error) {
        // try use ApiResolver to find (methodName)
        if (typeof method == "string") {
            let found;
            if (method.includes('[')) {
                found = new ApiResolver("objc").enumerateMatches(method);
            }
            else {
                found = new ApiResolver("objc").enumerateMatches(`*[* ${method}]`);
            }
            if (found != undefined && found != null && found.length != 0) {
                found.forEach(item => showMethod(nameToMethod(item.name).handle, item.name));
            }
            else {
                throw new Error(`Not Found -> ${method}`);
            }
            return;
        }
        else
            throw error;
    }
    const typeEncoding = ObjC.api.method_getTypeEncoding(localM).readCString();
    logd(ObjC.classes.NSMethodSignature["signatureWithObjCTypes:"](allocCString(typeEncoding)).debugDescription().toString());
};
export var argType;
(function (argType) {
    argType["string"] = "string";
    argType["class"] = "class";
    argType["object"] = "object";
    argType["selector"] = "selector";
    argType["bool"] = "bool";
    argType["void"] = "void";
})(argType || (argType = {}));
export const packArgs = (arg, type) => {
    // todo
    switch (type) {
        case "string": return arg.readCString() == null ? "" : arg.readCString();
        case "class": return new ObjC.Object(arg).toString();
        case "object": return new ObjC.Object(arg).toString();
        case "const pointer": return hexdump(arg, { ansi: true, length: 0x40 });
        case "selector":
            try {
                return ObjC.selectorAsString(arg);
            }
            catch (error) {
                return arg.readCString() == null ? "" : arg.readCString();
            }
        case "int":
        case "int16":
        case "int64":
        case "uint":
        case "uint64": return `${ptr(arg).toInt32()} <- ${ptr(arg)}`;
        case "bool": return `${(ptr(arg)).toInt32() == 0 ? "false" : "true"}`;
        case "block":
            // xa(arg) // for debug
            try {
                return `\n${xas(arg, 5, '~')}`;
                // return `${blockType} ${r_ptr}`
                // 自行解析block的参考
                // // size 
                // const size = arg.add(Process.pointerSize * 1).readPointer()
                // // functionAddress
                // const functionAddress = arg.add(Process.pointerSize * 2).readPointer()
                // const debugInfo = DebugSymbol.fromAddress(functionAddress)
                // // ctx
                // const ctx = arg.add(Process.pointerSize * 3).readPointer()
                // // self
                // const self = arg.add(Process.pointerSize * 4).readPointer()
                // const self_str = self.isNull() ? "nil" : (`${new ObjC.Object(self)}`)
                // return `${debugInfo.moduleName} ! ${debugInfo.name} | self:${self_str} | type:${blockType} | ctx:${ctx} | size:${size}`
            }
            catch (error) {
                return '';
            }
        case "void": '';
        default: return `${arg}`;
    }
};
export const getArgsAndRet = (method) => {
    let packArgsAndRet = { ret: "", args: [] };
    // OBJC_EXPORT char * _Nonnull method_copyReturnType(Method _Nonnull m) 
    // OBJC_EXPORT void method_getReturnType(Method _Nonnull m, char * _Nonnull dst, size_t dst_len) 
    const dst_len = 0x20;
    const dst_ptr = Memory.alloc(dst_len);
    call("method_getReturnType", method, dst_ptr, dst_len);
    const type = dst_ptr.readCString();
    packArgsAndRet.ret = type;
    dst_ptr.writeByteArray(Array.from(new Uint8Array(dst_len)));
    // OBJC_EXPORT char * _Nullable method_copyArgumentType(Method _Nonnull m, unsigned int index) 
    // OBJC_EXPORT void method_getArgumentType(Method _Nonnull m, unsigned int index, char * _Nullable dst, size_t dst_len) 
    for (let i = 0; i < call("method_getNumberOfArguments", method).toInt32(); i++) {
        try {
            dst_ptr.writeByteArray(Array.from(new Uint8Array(dst_len)));
            call("method_getArgumentType", method, i, dst_ptr, dst_len);
            packArgsAndRet.args[i] = dst_ptr.readCString();
        }
        catch (error) {
            if (i == 0)
                packArgsAndRet.args[0] = "@";
            else
                throw error;
        }
    }
    return packArgsAndRet;
};
/**
 * parse type to string
 * @param typeStr type string
 * @param toDisplay disp(default) or fridaType
 * @returns
 */
export const parseType = (typeStr, toDisplay = true) => {
    const idByAlias = {
        'c': 'char',
        'i': 'int',
        's': 'int16',
        'q': 'int64',
        'C': 'uchar',
        'I': 'uint',
        'S': 'uint16',
        'Q': 'uint64',
        'f': 'float',
        'd': 'double',
        'B': 'bool',
        '^B': 'bool',
        'b': 'bool',
        'v': 'void',
        '*': 'string',
        '@': 'object',
        '@?': 'block',
        '#': 'class',
        ':': 'selector',
        'r^v': 'const pointer',
        '^v': 'pointer' // void *
    };
    const fridaTypeExt = {
        'BOOL': 'bool',
        'object': 'pointer',
        'block': 'pointer',
        'class': 'pointer',
        'selector': 'pointer',
        'const pointer': 'pointer',
    };
    if (typeStr == null || typeStr == undefined)
        return '';
    if (toDisplay) {
        // to display
        if (typeStr in idByAlias)
            return idByAlias[typeStr];
        if (typeStr.startsWith("{"))
            return "struct";
        // throw new Error(`Type case not impl ? ${typeStr}`)
        return `${typeStr} <- parse error`;
    }
    else {
        // to frida type
        if (typeStr in idByAlias) {
            const ret = idByAlias[typeStr];
            const ret_case = fridaTypeExt[ret];
            return ret_case == undefined ? ret : ret_case;
        }
        // throw new Error(`Type case not impl ? ${typeStr}`)
        return `pointer`;
    }
};
globalThis.getFields = (cls) => {
    const localCls = checkPointer(cls);
    const ObjCls = new ObjC.Object(localCls);
    let fields = new Array();
    for (const k in ObjCls.$ivars) {
        fields.push(k);
    }
    return fields;
};
// cls can be instanceof ObjC.ObjC or Class(OC MetaClass)
const listFields = (cls) => getFields(cls).forEach(logd);
globalThis.f = listFields;
/**
 * get method impl
 * @param className
 * @param methodName
 * @returns impl / not Method
 */
globalThis.lookupMethod = (className, methodName) => {
    // this two api available ↓
    try {
        // (void*)class_lookupMethod((Class)NSClassFromString(@"Counter"), (SEL)NSSelectorFromString(@"setTestStr:"));
        const clz = call("NSClassFromString", allocOCString(className));
        if (clz.isNull())
            throw new Error(`class ${className} not found`);
        const sel = call("NSSelectorFromString", allocOCString(methodName));
        if (sel.isNull())
            throw new Error(`error: get selector ${methodName}`);
        const impl = call("class_lookupMethod", clz, sel);
        if (impl.isNull())
            throw new Error(`class ${className} method ${methodName} not found`);
        return impl;
    }
    catch (error) {
        // OBJC_EXPORT IMP _Nullable class_getMethodImplementation(Class _Nullable cls, SEL _Nonnull name) 
        const clz = call("objc_getClass", allocCString(className));
        if (clz.isNull())
            throw new Error(`class ${className} not found`);
        const sel = call("NSSelectorFromString", allocOCString(methodName));
        if (sel.isNull())
            throw new Error(`error: get selector ${methodName}`);
        const impl = call("class_getMethodImplementation", clz, sel);
        if (impl.isNull())
            throw new Error(`class ${className} method ${methodName} not found`);
        return impl;
    }
};
const watch_getClass = () => {
    // todo
    // OBJC_EXPORT void objc_setHook_getClass(objc_hook_getClass _Nonnull newValue, objc_hook_getClass _Nullable * _Nonnull outOldValue)
};
globalThis.printDictionary = (dictionary) => {
    let dis;
    if (dictionary instanceof NativePointer)
        dis = new ObjC.Object(dictionary);
    else if (typeof dictionary == "number" || (typeof dictionary == "string" && dictionary.startsWith("0x")))
        dis = new ObjC.Object(ptr(dictionary));
    else if (dictionary instanceof ObjC.Object)
        dis = dictionary;
    else
        throw new Error('Error dictionary(args[0]), Need ObjC.Object or NativePointer');
    const keys = dis.allKeys();
    for (let i = 0; i < keys.count(); i++) {
        const key = keys.objectAtIndex_(i);
        const value = dis.objectForKey_(key);
        logd(`Key: ${key.toString()}, Value: ${value.toString()}`);
    }
};
globalThis.printArray = (array) => {
    let arr;
    if (array instanceof NativePointer)
        arr = new ObjC.Object(array);
    if (typeof array == "number" || (typeof array == "string" && array.startsWith("0x")))
        arr = new ObjC.Object(ptr(array));
    else if (array instanceof ObjC.Object)
        arr = array;
    else
        throw new Error('Error array(args[0]), Need ObjC.Object or NativePointer');
    const count = arr.count();
    if (count == 0)
        loge('Null array');
    for (let i = 0; i < count; i++) {
        const value = arr.objectAtIndex_(i);
        logd(`Index: ${i}, Value: ${value.toString()}`);
    }
};
globalThis.printSet = (set) => {
    let objSet;
    if (set instanceof NativePointer)
        objSet = new ObjC.Object(set);
    else if (typeof set === "number" || (typeof set === "string" && set.startsWith("0x")))
        objSet = new ObjC.Object(ptr(set));
    else if (set instanceof ObjC.Object)
        objSet = set;
    else
        throw new Error('Error set(args[0]), Need ObjC.Object or NativePointer');
    const allObjects = objSet.allObjects();
    const count = allObjects.count();
    if (count === 0) {
        loge('Null set');
        return;
    }
    for (let i = 0; i < count; i++) {
        const value = allObjects.objectAtIndex_(i);
        logd(`Index: ${i}, Value: ${value.toString()}`);
    }
};
globalThis.showSuperClasses = showSuperClasses;
globalThis.getSuperClasses = getSuperClasses;
globalThis.showSubClasses = showSubClasses;
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/types/include.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA"}
✄
import './objc_method.js';
✄
{"version":3,"file":"objc_method.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/oc/types/objc_method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAahF,MAAM,OAAO,sBAAsB;IAI/B;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,CAAC,OAAsB,EAAE,QAAiB,EAAE,UAAyD,EAAE,mBAA2B,EAAE,EAAE,QAAa,IAAI;QAC7J,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EA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UAAU,CAAC,WAAW,GAAG,gBAAgB,CAAA;AACzC,UAAU,CAAC,WAAW,GAAG,sBAAsB,CAAA"}
✄
import { getArgsAndRet, packArgs, parseType } from "../oc.js";
import { HK_TYPE, printObjcStackTrace, TIME_SIMPLE } from "../../../../utils.js";
export class HookStatusManager_IMPL {
    /**
     *
     * @param hookType hook type
     * @param srcImpl hook target
     * @param modifyImpl frida attach -> InvocationListener OR frida oc replacement -> NativeCallback<any, any>
     * @param ocMethodFullName
     */
    static add(srcImpl, hookType, modifyImpl, ocMethodFullName = '', extra = null) {
        HookStatusManager_IMPL.record.set(srcImpl.toString(), { hook: hookType, modify: modifyImpl, ocMethodFullName: ocMethodFullName, extra: extra });
    }
    static remove(srcImpl) {
        HookStatusManager_IMPL.record.delete(srcImpl.toString());
    }
    static update(srcImpl, hookType, modifyImpl, ocMethodFullName = '', extra = null) {
        HookStatusManager_IMPL.record.set(srcImpl.toString(), { hook: hookType, modify: modifyImpl, ocMethodFullName: ocMethodFullName, extra: extra });
    }
    static get(srcImpl, hooktype = HK_TYPE.FRIDA_ATTACH) {
        if (hooktype == HK_TYPE.FRIDA_ATTACH || hooktype == HK_TYPE.FRIDA_REP)
            return HookStatusManager_IMPL.record.get(srcImpl.toString());
        else if (hooktype == HK_TYPE.OBJC_REP) {
            // todo
            return undefined;
        }
        else
            return undefined;
    }
}
HookStatusManager_IMPL.record = new Map();
class objc_method_pack {
    constructor() {
    }
    static fromMethod(method) {
        const ins = new objc_method_pack();
        ins.method = method;
        return ins;
    }
    static fromAddress(mPtr) {
        const ins = new objc_method_pack();
        ins.method = addressToMethod(mPtr);
        return ins;
    }
    static fromString(str) {
        const ins = new objc_method_pack();
        ins.method = nameToMethod(str);
        return ins;
    }
    get handle() { return this.method.handle; }
    get name() { return ObjC.api.method_getName(this.method).readCString(); }
    get fullName() { return DebugSymbol.fromAddress(this.method.implementation).name; }
    get address() { return this.method.implementation; }
    get rva() {
        const md = Process.findModuleByAddress(this.address);
        return this.address.sub(md?.base);
    }
    get selector() { return this.method.selector.readCString(); }
    hook(hooktype = HK_TYPE.FRIDA_ATTACH, passSomeMethods = true, bt = false) {
        if (!passSomeMethods) {
            if (this.selector.startsWith('_')) {
                logz(`[ ${++objc_method_pack.count_hook} ] pass -> ${this.address} ${this.selector} | private method`);
                return;
            }
            if (this.selector.includes("alloc") || this.selector.startsWith(".")) {
                logz(`[ ${++objc_method_pack.count_hook} ] pass -> ${this.address} ${this.selector} | filter method name`);
                return;
            }
        }
        // if (HookStatusManager_IMPL.get(this.method.implementation) !== undefined) {
        //     logz(`[ ${++objc_method_pack.count_hook} ] pass -> ${this.address} ${this.selector} | already hook`)
        //     return
        // }
        if (this.fullName == null) {
            logz(`[ ${++objc_method_pack.count_hook} ] pass -> ${this.address} ${this.selector} | already hook`);
            return;
        }
        const pk = getArgsAndRet(this.method.handle);
        logw(`[ ${++objc_method_pack.count_hook} ] hook -> ${this.method.implementation} ${this.fullName} ${pk.args.length}`);
        let extraDes;
        try {
            const md = Process.findModuleByAddress(this.method.implementation);
            let rva = `${this.method.implementation.sub(md.base)}`;
            extraDes = `R:${rva}`;
        }
        catch (error) {
            // already modify
            extraDes = '';
        }
        const thisMethod = this;
        switch (hooktype) {
            case HK_TYPE.FRIDA_ATTACH:
                // const cacheObj = HookStatusManager_IMPL.has(thisMethod)
                // if (cacheObj != null) cacheObj.detach()
                // HookStatusManager_IMPL.update(thisMethod)
                this.listener = Interceptor.attach(thisMethod.method.implementation, {
                    onEnter: function (args) {
                        const className = new ObjC.Object(args[0]).$className;
                        this.titile = (`Called -> [ ${className} ] ${thisMethod.name} [ M:${thisMethod.method.handle} A:${thisMethod.method.implementation} ${extraDes} ]`);
                        let argsStr = [];
                        pk.args.forEach((item, index) => {
                            argsStr.push(`args[${index}]\t->\t${item} - ${parseType(item)}\t${args[index]} ${packArgs(args[index], parseType(item))}`);
                        });
                        this.argumentsStr = argsStr.join('\n');
                    },
                    onLeave: function (retval) {
                        logo(`\n${getLine(85)}`);
                        logo(`${this.titile}`);
                        logd(`${this.argumentsStr}`);
                        if (parseType(pk.ret) == "void") {
                            logd(`retval\t->\t${pk.ret} - ${parseType(pk.ret)}`);
                        }
                        else {
                            const retDetail = `${retval} ${packArgs(retval, parseType(pk.ret))}`;
                            logd(`retval\t->\t${pk.ret} - ${parseType(pk.ret)}\t${retDetail}`);
                        }
                        if (bt) {
                            logo(`  [-] Call Stack (for ${thisMethod.name}):`);
                            const stack = Thread.backtrace(this.context, Backtracer.ACCURATE)
                                .map(DebugSymbol.fromAddress).join('\n    |-- ');
                            logz(`    |-- ${stack}`);
                        }
                    }
                });
                break;
            case HK_TYPE.FRIDA_REP:
                // todo ...
                // let argsT: []
                // if (this.methodFHandle) {
                //     argsT = eval(`[ ${this.methodFHandle?.argumentTypes.map(i => `"${i}"`)} ]`)
                // } else {
                //     argsT = eval(`[ ${Array.from({ length: defaultArgsC }, (_, _i) => `"pointer"`).join(', ')} ]`)
                // }
                // try {
                //     const srcCall = new NativeFunction(this.address, 'pointer', argsT) as IMPS
                //     Interceptor.revert(this.address)
                //     logz(`${this.sel} ${argsT}`)
                //     Interceptor.replace(this.address, new NativeCallback(function (...args) {
                //         let ret = srcCall(...arguments)
                //         const argsStr = args.map((i, c) => {
                //             const il: NativePointer = i as NativePointer
                //             if (c == 0) return `${new ObjC.Object(il)} @ ${il}`
                //             if (c == 1) return ObjC.selectorAsString(il)
                //             return ptr(i as any)
                //         }).join(', ')
                //         logd(`[ ${++objc_method_pack.count} ]\tcalled ${argsStr}`)
                //         return ret
                //     }, 'pointer', argsT))
                //     logd(`hooking ${this.address} -> ${this.sel}`)
                // } catch (error) {
                //     loge(`hooking ${this.address} -> ${this.sel} | Error: ${error}`)
                // }
                break;
            case HK_TYPE.OBJC_REP:
                const old_impl = this.method.implementation;
                try {
                    const new_impl = ObjC.implement(this.method, function (clazz, selector, ...args) {
                        const retval = old_impl(clazz, selector, ...args);
                        const className = new ObjC.Object(clazz).$className;
                        logo(`\n${getLine(85)}`);
                        logo(`[${++objc_method_pack.count_call} | ${TIME_SIMPLE()} ] Called -> [ ${className} ] ${thisMethod.name} [ M:${thisMethod.handle} A:${thisMethod.method.implementation} ${extraDes} ]`);
                        const argsStr = [];
                        pk.args.forEach((item, index) => {
                            const logType = parseType(item).padEnd(8, ' ');
                            if (index == 0) {
                                argsStr.push(`args[${index}]\t->\t${item}\t- ${logType}\t${clazz.toString().padEnd(13, ' ')} | ${packArgs(clazz, logType.trimEnd())}`);
                            }
                            else if (index == 1) {
                                argsStr.push(`args[${index}]\t->\t${item}\t- ${logType}\t${selector.toString().padEnd(13, ' ')} | ${packArgs(selector, logType.trimEnd())}`);
                            }
                            else {
                                let currentArg;
                                try {
                                    // 这里有点奇怪，如果 ...args 长度是1，他就不是数组了
                                    currentArg = ptr(args[index - 2]);
                                }
                                catch (error) {
                                    currentArg = ptr(args);
                                }
                                // for debug ↓
                                // loge(`args[${index}]\t->\t${item}\t- ${logType}\t${currentArg}\t${packArgs(currentArg, logType)}`)
                                // loge(packArg + " " + item)
                                let packArg = packArgs(currentArg, logType.trimEnd());
                                if (logType.trimEnd() == 'object' && !currentArg.isNull()) {
                                    const clsName = new ObjC.Object(currentArg).$className;
                                    if (!packArg.includes(clsName))
                                        packArg = `${clsName} ${packArg}`;
                                }
                                argsStr.push(`args[${index}]\t->\t${item}\t- ${logType}\t${currentArg.toString().padEnd(13, ' ')} | ${packArg}`);
                            }
                        });
                        formatLog(argsStr);
                        const logType_ret = parseType(pk.ret).padEnd(8, ' ');
                        if (logType_ret.includes("void")) {
                            formatLog([`retval\t->\t${pk.ret}\t- ${logType_ret}`]);
                        }
                        else {
                            const retDetail = `${retval.toString().padEnd(13, ' ')} | ${retval} ${packArgs(retval, logType_ret.trimEnd())}`;
                            formatLog([`retval\t->\t${pk.ret}\t- ${logType_ret}\t${retDetail}`]);
                        }
                        if (bt)
                            printObjcStackTrace();
                        return retval;
                    });
                    HookStatusManager_IMPL.add(this.method.implementation, HK_TYPE.OBJC_REP, new_impl, thisMethod.name); // record
                    this.method.implementation = new_impl;
                }
                catch (error) {
                    loge(`${++objc_method_pack.count_hook} ] pass -> ${this.method.handle} -> ${this.method.selector} | Error: ${error}`);
                }
                break;
            default:
                throw new Error(`ERROR HookType`);
        }
        function formatLog(msg) {
            msg.forEach(item => {
                const braceIndex = item.indexOf('{');
                if (braceIndex !== -1) {
                    const head = item.substring(0, braceIndex).trim();
                    const body = item.substring(braceIndex).trim();
                    logd(head);
                    body.split('\n').forEach(line => {
                        const trimmed = line.trim();
                        if (trimmed !== '') {
                            logz(`\t\t\t\t\t${trimmed}`);
                        }
                    });
                }
                else if (item.includes('\n')) {
                    const msg = item.split('|');
                    logd(`${msg[0]}`);
                    if (msg[1] != undefined && typeof (msg[1]) == "string" && msg[1] != '')
                        msg[1].trimStart().split('\n').forEach(item => logz(`\t\t\t\t\t${item}`));
                }
                else
                    logd(item);
            });
        }
    }
    detach() {
        if (this.listener != undefined)
            this.listener.detach();
    }
}
// public invoke(...args: any[]) {
//     if (!this.methodFHandle) throw new Error('Missing impl method call')
//     if (args.length != this.argsCount - 2) throw new Error(`Invalid argument count [ expected ${this.argsCount - 2} but got ${args.length} ]`)
//     return this.methodFHandle(...args)
//     // return this.methodFHandle(Memory.allocUtf8String("test"))
//     // return call(ObjC.api.objc_msgSend, this.methodFHandle.handle, this.sel_ptr, ...args.map(x => ptr(x as any)))
// }
// public toString(): string { return `${this.PTR_SEL} -> ${this.address} -> ${this.rva} | ${this.sel} (${this.types})` }
objc_method_pack.count_hook = 0;
objc_method_pack.count_call = 0;
globalThis.objc_method = objc_method_pack;
globalThis.Hook_Status = HookStatusManager_IMPL;
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/swift/include.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA"}
✄
import './main.js';
✄
{"version":3,"file":"main.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/lang/swift/main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AACjD,iDAAiD;AACjD,oDAAoD;AACpD,SAAS;AACT,MAAM,CAAN,IAAY,MAkCX;AAlCD,WAAY,MAAM;IACd,uCAAU,CAAA;IACV,uCAAU,CAAA;IACV,yCAAW,CAAA;IACX,uCAAU,CAAA;IACV,yCAAW,CAAA;IACX,yCAAW,CAAA;IACX,uCAAU,CAAA;IACV,uCAAU,CAAA;IACV,yCAAW,CAAA;IACX,wCAAW,CAAA;IACX,0CAAY,CAAA;IACZ,wCAAW,CAAA;IACX,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,wCAAW,CAAA;IACX,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,8CAAc,CAAA;IACd,0CAAY,CAAA;IACZ,4CAAa,CAAA;IACb,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,0CAAY,CAAA;IACZ,6CAAa,CAAA;IACb,iDAAe,CAAA;AACnB,CAAC,EAlCW,MAAM,KAAN,MAAM,QAkCjB"}
✄
var targetPointers = new Array();
globalThis.findSvcInstructions = (md = '') => {
    (md != '' ? Process.findModuleByName(md) : Process.mainModule)
        .enumerateSections()
        .forEach(item => {
        if (item.name == '__text') {
            logw(`\n${item.address} -> ${item.name} ${ptr(item.size)}\n`);
            Memory.scanSync(item.address, item.size, "01 10 00 D4").forEach((item, index) => {
                logd(`[${index}] ->\t${item.address.sub(Process.mainModule.base)} | ${DebugSymbol.fromAddress(item.address)}`);
                if (!targetPointers.includes(item.address))
                    targetPointers.push(item.address);
                let currentIns = Instruction.parse(item.address);
                let lastIns;
                let itorAdd = item.address;
                let maxItor = 5;
                let insLog = `\n\t${currentIns.address} ${currentIns}`;
                try {
                    while ((itorAdd = itorAdd.sub(0x4)) && --maxItor > 0) {
                        lastIns = Instruction.parse(itorAdd);
                        if (lastIns.mnemonic == "mov" && lastIns.operands.find(i => i.type == "reg" && (i.value == "w16" || i.value == "x16"))) {
                            let opCode = Number(lastIns.operands.find(i => i.type == "imm")?.value);
                            insLog = `\n\t${lastIns.address} ${lastIns} | { ${SYSCALL[opCode]} [ ${opCode} ] ` + insLog;
                            break;
                        }
                        else {
                            insLog = `\n\t${lastIns.address} ${lastIns}` + insLog;
                        }
                    }
                }
                catch (error) {
                }
                if (!insLog.includes("| { "))
                    insLog = `\n\t ......` + insLog;
                insLog.split("\n")
                    .forEach(msg => msg.includes("svc") || msg.includes("| { ") ? logw(!msg.includes("svc") ? msg : msg + '\n') : logz(msg));
                // MemoryAccessMonitor.enable({base:currentIns.address, size:0x4}, {
                //     onAccess(details) {
                //         logd(`${details.from}`)
                //         LOGJSON(details)   
                //     }
                // })
            });
            newLine();
        }
    });
};
globalThis.findBRKInstructions = (md = '') => {
    (md != '' ? Process.findModuleByName(md) : Process.mainModule)
        .enumerateSections()
        .forEach(item => {
        if (item.name == '__text') {
            logw(`\n${item.address} -> ${item.name} ${ptr(item.size)}\n`);
            Memory.scanSync(item.address, item.size, "20 00 20 D4").forEach((item, index) => {
                logd(`[${index}] ->\t${item.address.sub(Process.mainModule.base)} | ${DebugSymbol.fromAddress(item.address)}`);
                const currentIns = Instruction.parse(item.address);
                logd(`[${index}] \t${currentIns.address} ${currentIns}`);
            });
            newLine();
        }
    });
};
var registerFlag = false;
const regExceptionHandle = () => {
    if (registerFlag)
        return;
    registerFlag = true;
    Process.setExceptionHandler((callback) => {
        if (targetPointers.includes(callback.address)) {
            loge(`Got Ins Err -> ${callback.address}`);
            let ins_value = callback.address.readU32();
            callback.address.writeU32(ptr(ins_value).xor(ins_value).toUInt32());
            return true;
        }
        return false;
    });
};
globalThis.nopSysCall = (md = '', nopAll = false) => {
    findSvcInstructions(md);
    targetPointers.forEach(item => {
        Memory.patchCode(item, 0x4, (addr) => {
            const lastIns = Instruction.parse(addr.sub(0x4));
            const opCode = Number(lastIns.operands.find(i => i.type == "imm")?.value);
            if (Process.arch == "arm64") {
                if (opCode == SYSCALL.SYS_exit || opCode == SYSCALL.SYS_ptrace) {
                    new Arm64Writer(addr).putNop();
                }
                else if (nopAll)
                    new Arm64Writer(addr).putNop();
            }
            else {
                Interceptor.attach(lastIns.address, {
                    onEnter(args) {
                        logd(`Called SVC -> ${SYSCALL[opCode]} @ ${addr}`);
                        new Arm64Writer(addr).putNop();
                    }
                });
            }
        });
    });
};
globalThis.modTargets = () => {
    regExceptionHandle();
    logw(`targetPointers -> ${targetPointers.length}`);
    targetPointers.forEach(item => {
        Memory.patchCode(item, 0x4, (ins) => {
            let ins_value = ins.readU32();
            ins.writeU32(ptr(ins_value).xor(ins_value).toUInt32());
        });
    });
};
// https://github.com/xybp888/iOS-SDKs/blob/master/iPhoneOS13.0.sdk/usr/include/sys/syscall.h
export var SYSCALL;
(function (SYSCALL) {
    SYSCALL[SYSCALL["SYS_syscall"] = 0] = "SYS_syscall";
    SYSCALL[SYSCALL["SYS_exit"] = 1] = "SYS_exit";
    SYSCALL[SYSCALL["SYS_fork"] = 2] = "SYS_fork";
    SYSCALL[SYSCALL["SYS_read"] = 3] = "SYS_read";
    SYSCALL[SYSCALL["SYS_write"] = 4] = "SYS_write";
    SYSCALL[SYSCALL["SYS_open"] = 5] = "SYS_open";
    SYSCALL[SYSCALL["SYS_close"] = 6] = "SYS_close";
    SYSCALL[SYSCALL["SYS_wait4"] = 7] = "SYS_wait4";
    // 8 is old creat
    SYSCALL[SYSCALL["SYS_link"] = 9] = "SYS_link";
    SYSCALL[SYSCALL["SYS_unlink"] = 10] = "SYS_unlink";
    // 11 is old execv
    SYSCALL[SYSCALL["SYS_chdir"] = 12] = "SYS_chdir";
    SYSCALL[SYSCALL["SYS_fchdir"] = 13] = "SYS_fchdir";
    SYSCALL[SYSCALL["SYS_mknod"] = 14] = "SYS_mknod";
    SYSCALL[SYSCALL["SYS_chmod"] = 15] = "SYS_chmod";
    SYSCALL[SYSCALL["SYS_chown"] = 16] = "SYS_chown";
    // 17 is old break
    SYSCALL[SYSCALL["SYS_getfsstat"] = 18] = "SYS_getfsstat";
    // 19 is old lseek
    SYSCALL[SYSCALL["SYS_getpid"] = 20] = "SYS_getpid";
    // 21 is old mount
    // 22 is old umount
    SYSCALL[SYSCALL["SYS_setuid"] = 23] = "SYS_setuid";
    SYSCALL[SYSCALL["SYS_getuid"] = 24] = "SYS_getuid";
    SYSCALL[SYSCALL["SYS_geteuid"] = 25] = "SYS_geteuid";
    SYSCALL[SYSCALL["SYS_ptrace"] = 26] = "SYS_ptrace";
    SYSCALL[SYSCALL["SYS_recvmsg"] = 27] = "SYS_recvmsg";
    SYSCALL[SYSCALL["SYS_sendmsg"] = 28] = "SYS_sendmsg";
    SYSCALL[SYSCALL["SYS_recvfrom"] = 29] = "SYS_recvfrom";
    SYSCALL[SYSCALL["SYS_accept"] = 30] = "SYS_accept";
    SYSCALL[SYSCALL["SYS_getpeername"] = 31] = "SYS_getpeername";
    SYSCALL[SYSCALL["SYS_getsockname"] = 32] = "SYS_getsockname";
    SYSCALL[SYSCALL["SYS_access"] = 33] = "SYS_access";
    SYSCALL[SYSCALL["SYS_chflags"] = 34] = "SYS_chflags";
    SYSCALL[SYSCALL["SYS_fchflags"] = 35] = "SYS_fchflags";
    SYSCALL[SYSCALL["SYS_sync"] = 36] = "SYS_sync";
    SYSCALL[SYSCALL["SYS_kill"] = 37] = "SYS_kill";
    // 38 is old stat
    SYSCALL[SYSCALL["SYS_getppid"] = 39] = "SYS_getppid";
    // 40 is old lstat
    SYSCALL[SYSCALL["SYS_dup"] = 41] = "SYS_dup";
    SYSCALL[SYSCALL["SYS_pipe"] = 42] = "SYS_pipe";
    SYSCALL[SYSCALL["SYS_getegid"] = 43] = "SYS_getegid";
    // 44 is old profil
    // 45 is old ktrace
    SYSCALL[SYSCALL["SYS_sigaction"] = 46] = "SYS_sigaction";
    SYSCALL[SYSCALL["SYS_getgid"] = 47] = "SYS_getgid";
    SYSCALL[SYSCALL["SYS_sigprocmask"] = 48] = "SYS_sigprocmask";
    SYSCALL[SYSCALL["SYS_getlogin"] = 49] = "SYS_getlogin";
    SYSCALL[SYSCALL["SYS_setlogin"] = 50] = "SYS_setlogin";
    SYSCALL[SYSCALL["SYS_acct"] = 51] = "SYS_acct";
    SYSCALL[SYSCALL["SYS_sigpending"] = 52] = "SYS_sigpending";
    SYSCALL[SYSCALL["SYS_sigaltstack"] = 53] = "SYS_sigaltstack";
    SYSCALL[SYSCALL["SYS_ioctl"] = 54] = "SYS_ioctl";
    SYSCALL[SYSCALL["SYS_reboot"] = 55] = "SYS_reboot";
    SYSCALL[SYSCALL["SYS_revoke"] = 56] = "SYS_revoke";
    SYSCALL[SYSCALL["SYS_symlink"] = 57] = "SYS_symlink";
    SYSCALL[SYSCALL["SYS_readlink"] = 58] = "SYS_readlink";
    SYSCALL[SYSCALL["SYS_execve"] = 59] = "SYS_execve";
    SYSCALL[SYSCALL["SYS_umask"] = 60] = "SYS_umask";
    SYSCALL[SYSCALL["SYS_chroot"] = 61] = "SYS_chroot";
    // 62 is old fstat
    SYSCALL[SYSCALL["SYS_invalid"] = 63] = "SYS_invalid";
    // 64 is old getpagesize
    SYSCALL[SYSCALL["SYS_msync"] = 65] = "SYS_msync";
    SYSCALL[SYSCALL["SYS_vfork"] = 66] = "SYS_vfork";
    // 67 is old vread
    // 68 is old vwrite
    // 69 is old sbrk
    // 70 is old sstk
    // 71 is old mmap
    // 72 is old vadvise
    SYSCALL[SYSCALL["SYS_munmap"] = 73] = "SYS_munmap";
    SYSCALL[SYSCALL["SYS_mprotect"] = 74] = "SYS_mprotect";
    SYSCALL[SYSCALL["SYS_madvise"] = 75] = "SYS_madvise";
    // 76 is old vhangup
    // 77 is old vlimit
    SYSCALL[SYSCALL["SYS_mincore"] = 78] = "SYS_mincore";
    SYSCALL[SYSCALL["SYS_getgroups"] = 79] = "SYS_getgroups";
    SYSCALL[SYSCALL["SYS_setgroups"] = 80] = "SYS_setgroups";
    SYSCALL[SYSCALL["SYS_getpgrp"] = 81] = "SYS_getpgrp";
    SYSCALL[SYSCALL["SYS_setpgid"] = 82] = "SYS_setpgid";
    SYSCALL[SYSCALL["SYS_setitimer"] = 83] = "SYS_setitimer";
    // 84 is old wait
    SYSCALL[SYSCALL["SYS_swapon"] = 85] = "SYS_swapon";
    SYSCALL[SYSCALL["SYS_getitimer"] = 86] = "SYS_getitimer";
    // 87 is old gethostname
    // 88 is old sethostname
    SYSCALL[SYSCALL["SYS_getdtablesize"] = 89] = "SYS_getdtablesize";
    SYSCALL[SYSCALL["SYS_dup2"] = 90] = "SYS_dup2";
    // 91 is old getdopt
    SYSCALL[SYSCALL["SYS_fcntl"] = 92] = "SYS_fcntl";
    SYSCALL[SYSCALL["SYS_select"] = 93] = "SYS_select";
    // 94 is old setdopt
    SYSCALL[SYSCALL["SYS_fsync"] = 95] = "SYS_fsync";
    SYSCALL[SYSCALL["SYS_setpriority"] = 96] = "SYS_setpriority";
    SYSCALL[SYSCALL["SYS_socket"] = 97] = "SYS_socket";
    SYSCALL[SYSCALL["SYS_connect"] = 98] = "SYS_connect";
    // 99 is old accept
    SYSCALL[SYSCALL["SYS_getpriority"] = 100] = "SYS_getpriority";
    // 101 is old send
    // 102 is old recv
    // 103 is old sigreturn
    SYSCALL[SYSCALL["SYS_bind"] = 104] = "SYS_bind";
    SYSCALL[SYSCALL["SYS_setsockopt"] = 105] = "SYS_setsockopt";
    SYSCALL[SYSCALL["SYS_listen"] = 106] = "SYS_listen";
    // 107 is old vtimes
    // 108 is old sigvec
    // 109 is old sigblock
    // 110 is old sigsetmask
    SYSCALL[SYSCALL["SYS_sigsuspend"] = 111] = "SYS_sigsuspend";
    // 112 is old sigstack
    // 113 is old recvmsg
    // 114 is old sendmsg
    // 115 is old vtrace
    SYSCALL[SYSCALL["SYS_gettimeofday"] = 116] = "SYS_gettimeofday";
    SYSCALL[SYSCALL["SYS_getrusage"] = 117] = "SYS_getrusage";
    SYSCALL[SYSCALL["SYS_getsockopt"] = 118] = "SYS_getsockopt";
    // 119 is old resuba
    SYSCALL[SYSCALL["SYS_readv"] = 120] = "SYS_readv";
    SYSCALL[SYSCALL["SYS_writev"] = 121] = "SYS_writev";
    SYSCALL[SYSCALL["SYS_settimeofday"] = 122] = "SYS_settimeofday";
    SYSCALL[SYSCALL["SYS_fchown"] = 123] = "SYS_fchown";
    SYSCALL[SYSCALL["SYS_fchmod"] = 124] = "SYS_fchmod";
    // 125 is old recvfrom
    SYSCALL[SYSCALL["SYS_setreuid"] = 126] = "SYS_setreuid";
    SYSCALL[SYSCALL["SYS_setregid"] = 127] = "SYS_setregid";
    SYSCALL[SYSCALL["SYS_rename"] = 128] = "SYS_rename";
    // 129 is old truncate
    // 130 is old ftruncate
    SYSCALL[SYSCALL["SYS_flock"] = 131] = "SYS_flock";
    SYSCALL[SYSCALL["SYS_mkfifo"] = 132] = "SYS_mkfifo";
    SYSCALL[SYSCALL["SYS_sendto"] = 133] = "SYS_sendto";
    SYSCALL[SYSCALL["SYS_shutdown"] = 134] = "SYS_shutdown";
    SYSCALL[SYSCALL["SYS_socketpair"] = 135] = "SYS_socketpair";
    SYSCALL[SYSCALL["SYS_mkdir"] = 136] = "SYS_mkdir";
    SYSCALL[SYSCALL["SYS_rmdir"] = 137] = "SYS_rmdir";
    SYSCALL[SYSCALL["SYS_utimes"] = 138] = "SYS_utimes";
    SYSCALL[SYSCALL["SYS_futimes"] = 139] = "SYS_futimes";
    SYSCALL[SYSCALL["SYS_adjtime"] = 140] = "SYS_adjtime";
    // 141 is old getpeername
    SYSCALL[SYSCALL["SYS_gethostuuid"] = 142] = "SYS_gethostuuid";
    // 143 is old sethostid
    // 144 is old getrlimit
    // 145 is old setrlimit
    // 146 is old killpg
    SYSCALL[SYSCALL["SYS_setsid"] = 147] = "SYS_setsid";
    // 148 is old setquota
    // 149 is old qquota
    // 150 is old getsockname
    SYSCALL[SYSCALL["SYS_getpgid"] = 151] = "SYS_getpgid";
    SYSCALL[SYSCALL["SYS_setprivexec"] = 152] = "SYS_setprivexec";
    SYSCALL[SYSCALL["SYS_pread"] = 153] = "SYS_pread";
    SYSCALL[SYSCALL["SYS_pwrite"] = 154] = "SYS_pwrite";
    SYSCALL[SYSCALL["SYS_nfssvc"] = 155] = "SYS_nfssvc";
    // 156 is old getdirentries
    SYSCALL[SYSCALL["SYS_statfs"] = 157] = "SYS_statfs";
    SYSCALL[SYSCALL["SYS_fstatfs"] = 158] = "SYS_fstatfs";
    SYSCALL[SYSCALL["SYS_unmount"] = 159] = "SYS_unmount";
    // 160 is old async_daemon
    SYSCALL[SYSCALL["SYS_getfh"] = 161] = "SYS_getfh";
    // 162 is old getdomainname
    // 163 is old setdomainname
    // 164 is unused
    SYSCALL[SYSCALL["SYS_quotactl"] = 165] = "SYS_quotactl";
    // 166 is old exportfs
    SYSCALL[SYSCALL["SYS_mount"] = 167] = "SYS_mount";
    // 168 is old ustat
    SYSCALL[SYSCALL["SYS_csops"] = 169] = "SYS_csops";
    SYSCALL[SYSCALL["SYS_csops_audittoken"] = 170] = "SYS_csops_audittoken";
    // 171 is old wait3
    // 172 is old rpause
    SYSCALL[SYSCALL["SYS_waitid"] = 173] = "SYS_waitid";
    // 174 is old getdents
    // 175 is old gc_control
    // 176 is old add_profil
    SYSCALL[SYSCALL["SYS_kdebug_typefilter"] = 177] = "SYS_kdebug_typefilter";
    SYSCALL[SYSCALL["SYS_kdebug_trace_string"] = 178] = "SYS_kdebug_trace_string";
    SYSCALL[SYSCALL["SYS_kdebug_trace64"] = 179] = "SYS_kdebug_trace64";
    SYSCALL[SYSCALL["SYS_kdebug_trace"] = 180] = "SYS_kdebug_trace";
    SYSCALL[SYSCALL["SYS_setgid"] = 181] = "SYS_setgid";
    SYSCALL[SYSCALL["SYS_setegid"] = 182] = "SYS_setegid";
    SYSCALL[SYSCALL["SYS_seteuid"] = 183] = "SYS_seteuid";
    SYSCALL[SYSCALL["SYS_sigreturn"] = 184] = "SYS_sigreturn";
    // 185 is old chud
    SYSCALL[SYSCALL["SYS_thread_selfcounts"] = 186] = "SYS_thread_selfcounts";
    SYSCALL[SYSCALL["SYS_fdatasync"] = 187] = "SYS_fdatasync";
    SYSCALL[SYSCALL["SYS_stat"] = 188] = "SYS_stat";
    SYSCALL[SYSCALL["SYS_fstat"] = 189] = "SYS_fstat";
    SYSCALL[SYSCALL["SYS_lstat"] = 190] = "SYS_lstat";
    SYSCALL[SYSCALL["SYS_pathconf"] = 191] = "SYS_pathconf";
    SYSCALL[SYSCALL["SYS_fpathconf"] = 192] = "SYS_fpathconf";
    // 193 is old getfsstat
    SYSCALL[SYSCALL["SYS_getrlimit"] = 194] = "SYS_getrlimit";
    SYSCALL[SYSCALL["SYS_setrlimit"] = 195] = "SYS_setrlimit";
    SYSCALL[SYSCALL["SYS_getdirentries"] = 196] = "SYS_getdirentries";
    SYSCALL[SYSCALL["SYS_mmap"] = 197] = "SYS_mmap";
    // 198 is old __syscall
    SYSCALL[SYSCALL["SYS_lseek"] = 199] = "SYS_lseek";
    SYSCALL[SYSCALL["SYS_truncate"] = 200] = "SYS_truncate";
    SYSCALL[SYSCALL["SYS_ftruncate"] = 201] = "SYS_ftruncate";
    SYSCALL[SYSCALL["SYS_sysctl"] = 202] = "SYS_sysctl";
    SYSCALL[SYSCALL["SYS_mlock"] = 203] = "SYS_mlock";
    SYSCALL[SYSCALL["SYS_munlock"] = 204] = "SYS_munlock";
    SYSCALL[SYSCALL["SYS_undelete"] = 205] = "SYS_undelete";
    // 206 is old ATsocket
    // 207 is old ATgetmsg
    // 208 is old ATputmsg
    // 209 is old ATsndreq
    // 210 is old ATsndrsp
    // 211 is old ATgetreq
    // 212 is old ATgetrsp
    // 213 is reserved for AppleTalk
    // 214 is unused
    // 215 is unused
    SYSCALL[SYSCALL["SYS_open_dprotected_np"] = 216] = "SYS_open_dprotected_np";
    SYSCALL[SYSCALL["SYS_fsgetpath_ext"] = 217] = "SYS_fsgetpath_ext";
    // 218 is old lstatv
    // 219 is old fstatv
    SYSCALL[SYSCALL["SYS_getattrlist"] = 220] = "SYS_getattrlist";
    SYSCALL[SYSCALL["SYS_setattrlist"] = 221] = "SYS_setattrlist";
    SYSCALL[SYSCALL["SYS_getdirentriesattr"] = 222] = "SYS_getdirentriesattr";
    SYSCALL[SYSCALL["SYS_exchangedata"] = 223] = "SYS_exchangedata";
    // 224 is old checkuseraccess or fsgetpath
    SYSCALL[SYSCALL["SYS_searchfs"] = 225] = "SYS_searchfs";
    SYSCALL[SYSCALL["SYS_delete"] = 226] = "SYS_delete";
    SYSCALL[SYSCALL["SYS_copyfile"] = 227] = "SYS_copyfile";
    SYSCALL[SYSCALL["SYS_fgetattrlist"] = 228] = "SYS_fgetattrlist";
    SYSCALL[SYSCALL["SYS_fsetattrlist"] = 229] = "SYS_fsetattrlist";
    SYSCALL[SYSCALL["SYS_poll"] = 230] = "SYS_poll";
    SYSCALL[SYSCALL["SYS_watchevent"] = 231] = "SYS_watchevent";
    SYSCALL[SYSCALL["SYS_waitevent"] = 232] = "SYS_waitevent";
    SYSCALL[SYSCALL["SYS_modwatch"] = 233] = "SYS_modwatch";
    SYSCALL[SYSCALL["SYS_getxattr"] = 234] = "SYS_getxattr";
    SYSCALL[SYSCALL["SYS_fgetxattr"] = 235] = "SYS_fgetxattr";
    SYSCALL[SYSCALL["SYS_setxattr"] = 236] = "SYS_setxattr";
    SYSCALL[SYSCALL["SYS_fsetxattr"] = 237] = "SYS_fsetxattr";
    SYSCALL[SYSCALL["SYS_removexattr"] = 238] = "SYS_removexattr";
    SYSCALL[SYSCALL["SYS_fremovexattr"] = 239] = "SYS_fremovexattr";
    SYSCALL[SYSCALL["SYS_listxattr"] = 240] = "SYS_listxattr";
    SYSCALL[SYSCALL["SYS_flistxattr"] = 241] = "SYS_flistxattr";
    SYSCALL[SYSCALL["SYS_fsctl"] = 242] = "SYS_fsctl";
    SYSCALL[SYSCALL["SYS_initgroups"] = 243] = "SYS_initgroups";
    SYSCALL[SYSCALL["SYS_posix_spawn"] = 244] = "SYS_posix_spawn";
    SYSCALL[SYSCALL["SYS_ffsctl"] = 245] = "SYS_ffsctl";
    // 246 is unused
    SYSCALL[SYSCALL["SYS_nfsclnt"] = 247] = "SYS_nfsclnt";
    SYSCALL[SYSCALL["SYS_fhopen"] = 248] = "SYS_fhopen";
    // 249 is unused
    SYSCALL[SYSCALL["SYS_minherit"] = 250] = "SYS_minherit";
    SYSCALL[SYSCALL["SYS_semsys"] = 251] = "SYS_semsys";
    SYSCALL[SYSCALL["SYS_msgsys"] = 252] = "SYS_msgsys";
    SYSCALL[SYSCALL["SYS_shmsys"] = 253] = "SYS_shmsys";
    SYSCALL[SYSCALL["SYS_semctl"] = 254] = "SYS_semctl";
    SYSCALL[SYSCALL["SYS_semget"] = 255] = "SYS_semget";
    SYSCALL[SYSCALL["SYS_semop"] = 256] = "SYS_semop";
    // 257 is old semconfig
    SYSCALL[SYSCALL["SYS_msgctl"] = 258] = "SYS_msgctl";
    SYSCALL[SYSCALL["SYS_msgget"] = 259] = "SYS_msgget";
    SYSCALL[SYSCALL["SYS_msgsnd"] = 260] = "SYS_msgsnd";
    SYSCALL[SYSCALL["SYS_msgrcv"] = 261] = "SYS_msgrcv";
    SYSCALL[SYSCALL["SYS_shmat"] = 262] = "SYS_shmat";
    SYSCALL[SYSCALL["SYS_shmctl"] = 263] = "SYS_shmctl";
    SYSCALL[SYSCALL["SYS_shmdt"] = 264] = "SYS_shmdt";
    SYSCALL[SYSCALL["SYS_shmget"] = 265] = "SYS_shmget";
    SYSCALL[SYSCALL["SYS_shm_open"] = 266] = "SYS_shm_open";
    SYSCALL[SYSCALL["SYS_shm_unlink"] = 267] = "SYS_shm_unlink";
    SYSCALL[SYSCALL["SYS_sem_open"] = 268] = "SYS_sem_open";
    SYSCALL[SYSCALL["SYS_sem_close"] = 269] = "SYS_sem_close";
    SYSCALL[SYSCALL["SYS_sem_unlink"] = 270] = "SYS_sem_unlink";
    SYSCALL[SYSCALL["SYS_sem_wait"] = 271] = "SYS_sem_wait";
    SYSCALL[SYSCALL["SYS_sem_trywait"] = 272] = "SYS_sem_trywait";
    SYSCALL[SYSCALL["SYS_sem_post"] = 273] = "SYS_sem_post";
    SYSCALL[SYSCALL["SYS_sysctlbyname"] = 274] = "SYS_sysctlbyname";
    // 275 is old sem_init
    // 276 is old sem_destroy
    SYSCALL[SYSCALL["SYS_open_extended"] = 277] = "SYS_open_extended";
    SYSCALL[SYSCALL["SYS_umask_extended"] = 278] = "SYS_umask_extended";
    SYSCALL[SYSCALL["SYS_stat_extended"] = 279] = "SYS_stat_extended";
    SYSCALL[SYSCALL["SYS_lstat_extended"] = 280] = "SYS_lstat_extended";
    SYSCALL[SYSCALL["SYS_fstat_extended"] = 281] = "SYS_fstat_extended";
    SYSCALL[SYSCALL["SYS_chmod_extended"] = 282] = "SYS_chmod_extended";
    SYSCALL[SYSCALL["SYS_fchmod_extended"] = 283] = "SYS_fchmod_extended";
    SYSCALL[SYSCALL["SYS_access_extended"] = 284] = "SYS_access_extended";
    SYSCALL[SYSCALL["SYS_settid"] = 285] = "SYS_settid";
    SYSCALL[SYSCALL["SYS_gettid"] = 286] = "SYS_gettid";
    SYSCALL[SYSCALL["SYS_setsgroups"] = 287] = "SYS_setsgroups";
    SYSCALL[SYSCALL["SYS_getsgroups"] = 288] = "SYS_getsgroups";
    SYSCALL[SYSCALL["SYS_setwgroups"] = 289] = "SYS_setwgroups";
    SYSCALL[SYSCALL["SYS_getwgroups"] = 290] = "SYS_getwgroups";
    SYSCALL[SYSCALL["SYS_mkfifo_extended"] = 291] = "SYS_mkfifo_extended";
    SYSCALL[SYSCALL["SYS_mkdir_extended"] = 292] = "SYS_mkdir_extended";
    SYSCALL[SYSCALL["SYS_identitysvc"] = 293] = "SYS_identitysvc";
    SYSCALL[SYSCALL["SYS_shared_region_check_np"] = 294] = "SYS_shared_region_check_np";
    // 295 is old shared_region_map_np
    SYSCALL[SYSCALL["SYS_vm_pressure_monitor"] = 296] = "SYS_vm_pressure_monitor";
    SYSCALL[SYSCALL["SYS_psynch_rw_longrdlock"] = 297] = "SYS_psynch_rw_longrdlock";
    SYSCALL[SYSCALL["SYS_psynch_rw_yieldwrlock"] = 298] = "SYS_psynch_rw_yieldwrlock";
    SYSCALL[SYSCALL["SYS_psynch_rw_downgrade"] = 299] = "SYS_psynch_rw_downgrade";
    SYSCALL[SYSCALL["SYS_psynch_rw_upgrade"] = 300] = "SYS_psynch_rw_upgrade";
    SYSCALL[SYSCALL["SYS_psynch_mutexwait"] = 301] = "SYS_psynch_mutexwait";
    SYSCALL[SYSCALL["SYS_psynch_mutexdrop"] = 302] = "SYS_psynch_mutexdrop";
    SYSCALL[SYSCALL["SYS_psynch_cvbroad"] = 303] = "SYS_psynch_cvbroad";
    SYSCALL[SYSCALL["SYS_psynch_cvsignal"] = 304] = "SYS_psynch_cvsignal";
    SYSCALL[SYSCALL["SYS_psynch_cvwait"] = 305] = "SYS_psynch_cvwait";
    SYSCALL[SYSCALL["SYS_psynch_rw_rdlock"] = 306] = "SYS_psynch_rw_rdlock";
    SYSCALL[SYSCALL["SYS_psynch_rw_wrlock"] = 307] = "SYS_psynch_rw_wrlock";
    SYSCALL[SYSCALL["SYS_psynch_rw_unlock"] = 308] = "SYS_psynch_rw_unlock";
    SYSCALL[SYSCALL["SYS_psynch_rw_unlock2"] = 309] = "SYS_psynch_rw_unlock2";
    SYSCALL[SYSCALL["SYS_getsid"] = 310] = "SYS_getsid";
    SYSCALL[SYSCALL["SYS_settid_with_pid"] = 311] = "SYS_settid_with_pid";
    SYSCALL[SYSCALL["SYS_psynch_cvclrprepost"] = 312] = "SYS_psynch_cvclrprepost";
    SYSCALL[SYSCALL["SYS_aio_fsync"] = 313] = "SYS_aio_fsync";
    SYSCALL[SYSCALL["SYS_aio_return"] = 314] = "SYS_aio_return";
    SYSCALL[SYSCALL["SYS_aio_suspend"] = 315] = "SYS_aio_suspend";
    SYSCALL[SYSCALL["SYS_aio_cancel"] = 316] = "SYS_aio_cancel";
    SYSCALL[SYSCALL["SYS_aio_error"] = 317] = "SYS_aio_error";
    SYSCALL[SYSCALL["SYS_aio_read"] = 318] = "SYS_aio_read";
    SYSCALL[SYSCALL["SYS_aio_write"] = 319] = "SYS_aio_write";
    SYSCALL[SYSCALL["SYS_lio_listio"] = 320] = "SYS_lio_listio";
    // 321 is old __pthread_cond_wait
    SYSCALL[SYSCALL["SYS_iopolicysys"] = 322] = "SYS_iopolicysys";
    SYSCALL[SYSCALL["SYS_process_policy"] = 323] = "SYS_process_policy";
    SYSCALL[SYSCALL["SYS_mlockall"] = 324] = "SYS_mlockall";
    SYSCALL[SYSCALL["SYS_munlockall"] = 325] = "SYS_munlockall";
    // 326 is unused
    SYSCALL[SYSCALL["SYS_issetugid"] = 327] = "SYS_issetugid";
    SYSCALL[SYSCALL["SYS___pthread_kill"] = 328] = "SYS___pthread_kill";
    SYSCALL[SYSCALL["SYS___pthread_sigmask"] = 329] = "SYS___pthread_sigmask";
    SYSCALL[SYSCALL["SYS___sigwait"] = 330] = "SYS___sigwait";
    SYSCALL[SYSCALL["SYS___disable_threadsignal"] = 331] = "SYS___disable_threadsignal";
    SYSCALL[SYSCALL["SYS___pthread_markcancel"] = 332] = "SYS___pthread_markcancel";
    SYSCALL[SYSCALL["SYS___pthread_canceled"] = 333] = "SYS___pthread_canceled";
    SYSCALL[SYSCALL["SYS___semwait_signal"] = 334] = "SYS___semwait_signal";
    // 335 is old utrace
    SYSCALL[SYSCALL["SYS_proc_info"] = 336] = "SYS_proc_info";
    SYSCALL[SYSCALL["SYS_sendfile"] = 337] = "SYS_sendfile";
    SYSCALL[SYSCALL["SYS_stat64"] = 338] = "SYS_stat64";
    SYSCALL[SYSCALL["SYS_fstat64"] = 339] = "SYS_fstat64";
    SYSCALL[SYSCALL["SYS_lstat64"] = 340] = "SYS_lstat64";
    SYSCALL[SYSCALL["SYS_stat64_extended"] = 341] = "SYS_stat64_extended";
    SYSCALL[SYSCALL["SYS_lstat64_extended"] = 342] = "SYS_lstat64_extended";
    SYSCALL[SYSCALL["SYS_fstat64_extended"] = 343] = "SYS_fstat64_extended";
    SYSCALL[SYSCALL["SYS_getdirentries64"] = 344] = "SYS_getdirentries64";
    SYSCALL[SYSCALL["SYS_statfs64"] = 345] = "SYS_statfs64";
    SYSCALL[SYSCALL["SYS_fstatfs64"] = 346] = "SYS_fstatfs64";
    SYSCALL[SYSCALL["SYS_getfsstat64"] = 347] = "SYS_getfsstat64";
    SYSCALL[SYSCALL["SYS___pthread_chdir"] = 348] = "SYS___pthread_chdir";
    SYSCALL[SYSCALL["SYS___pthread_fchdir"] = 349] = "SYS___pthread_fchdir";
    SYSCALL[SYSCALL["SYS_audit"] = 350] = "SYS_audit";
    SYSCALL[SYSCALL["SYS_auditon"] = 351] = "SYS_auditon";
    // 352 is unused
    SYSCALL[SYSCALL["SYS_getauid"] = 353] = "SYS_getauid";
    SYSCALL[SYSCALL["SYS_setauid"] = 354] = "SYS_setauid";
    // 355 is old getaudit
    // 356 is old setaudit
    SYSCALL[SYSCALL["SYS_getaudit_addr"] = 357] = "SYS_getaudit_addr";
    SYSCALL[SYSCALL["SYS_setaudit_addr"] = 358] = "SYS_setaudit_addr";
    SYSCALL[SYSCALL["SYS_auditctl"] = 359] = "SYS_auditctl";
    SYSCALL[SYSCALL["SYS_bsdthread_create"] = 360] = "SYS_bsdthread_create";
    SYSCALL[SYSCALL["SYS_bsdthread_terminate"] = 361] = "SYS_bsdthread_terminate";
    SYSCALL[SYSCALL["SYS_kqueue"] = 362] = "SYS_kqueue";
    SYSCALL[SYSCALL["SYS_kevent"] = 363] = "SYS_kevent";
    SYSCALL[SYSCALL["SYS_lchown"] = 364] = "SYS_lchown";
    // 365 is old stack_snapshot
    SYSCALL[SYSCALL["SYS_bsdthread_register"] = 366] = "SYS_bsdthread_register";
    SYSCALL[SYSCALL["SYS_workq_open"] = 367] = "SYS_workq_open";
    SYSCALL[SYSCALL["SYS_workq_kernreturn"] = 368] = "SYS_workq_kernreturn";
    SYSCALL[SYSCALL["SYS_kevent64"] = 369] = "SYS_kevent64";
    SYSCALL[SYSCALL["SYS___old_semwait_signal"] = 370] = "SYS___old_semwait_signal";
    SYSCALL[SYSCALL["SYS___old_semwait_signal_nocancel"] = 371] = "SYS___old_semwait_signal_nocancel";
    SYSCALL[SYSCALL["SYS_thread_selfid"] = 372] = "SYS_thread_selfid";
    SYSCALL[SYSCALL["SYS_ledger"] = 373] = "SYS_ledger";
    SYSCALL[SYSCALL["SYS_kevent_qos"] = 374] = "SYS_kevent_qos";
    SYSCALL[SYSCALL["SYS_kevent_id"] = 375] = "SYS_kevent_id";
    // 376 is unused
    // 377 is unused
    // 378 is unused
    // 379 is unused
    SYSCALL[SYSCALL["SYS___mac_execve"] = 380] = "SYS___mac_execve";
    SYSCALL[SYSCALL["SYS___mac_syscall"] = 381] = "SYS___mac_syscall";
    SYSCALL[SYSCALL["SYS___mac_get_file"] = 382] = "SYS___mac_get_file";
    SYSCALL[SYSCALL["SYS___mac_set_file"] = 383] = "SYS___mac_set_file";
    SYSCALL[SYSCALL["SYS___mac_get_link"] = 384] = "SYS___mac_get_link";
    SYSCALL[SYSCALL["SYS___mac_set_link"] = 385] = "SYS___mac_set_link";
    SYSCALL[SYSCALL["SYS___mac_get_proc"] = 386] = "SYS___mac_get_proc";
    SYSCALL[SYSCALL["SYS___mac_set_proc"] = 387] = "SYS___mac_set_proc";
    SYSCALL[SYSCALL["SYS___mac_get_fd"] = 388] = "SYS___mac_get_fd";
    SYSCALL[SYSCALL["SYS___mac_set_fd"] = 389] = "SYS___mac_set_fd";
    SYSCALL[SYSCALL["SYS___mac_get_pid"] = 390] = "SYS___mac_get_pid";
    // 391 is unused
    // 392 is unused
    // 393 is unused
    SYSCALL[SYSCALL["SYS_pselect"] = 394] = "SYS_pselect";
    SYSCALL[SYSCALL["SYS_pselect_nocancel"] = 395] = "SYS_pselect_nocancel";
    SYSCALL[SYSCALL["SYS_read_nocancel"] = 396] = "SYS_read_nocancel";
    SYSCALL[SYSCALL["SYS_write_nocancel"] = 397] = "SYS_write_nocancel";
    SYSCALL[SYSCALL["SYS_open_nocancel"] = 398] = "SYS_open_nocancel";
    SYSCALL[SYSCALL["SYS_close_nocancel"] = 399] = "SYS_close_nocancel";
    SYSCALL[SYSCALL["SYS_wait4_nocancel"] = 400] = "SYS_wait4_nocancel";
    SYSCALL[SYSCALL["SYS_recvmsg_nocancel"] = 401] = "SYS_recvmsg_nocancel";
    SYSCALL[SYSCALL["SYS_sendmsg_nocancel"] = 402] = "SYS_sendmsg_nocancel";
    SYSCALL[SYSCALL["SYS_recvfrom_nocancel"] = 403] = "SYS_recvfrom_nocancel";
    SYSCALL[SYSCALL["SYS_accept_nocancel"] = 404] = "SYS_accept_nocancel";
    SYSCALL[SYSCALL["SYS_msync_nocancel"] = 405] = "SYS_msync_nocancel";
    SYSCALL[SYSCALL["SYS_fcntl_nocancel"] = 406] = "SYS_fcntl_nocancel";
    SYSCALL[SYSCALL["SYS_select_nocancel"] = 407] = "SYS_select_nocancel";
    SYSCALL[SYSCALL["SYS_fsync_nocancel"] = 408] = "SYS_fsync_nocancel";
    SYSCALL[SYSCALL["SYS_connect_nocancel"] = 409] = "SYS_connect_nocancel";
    SYSCALL[SYSCALL["SYS_sigsuspend_nocancel"] = 410] = "SYS_sigsuspend_nocancel";
    SYSCALL[SYSCALL["SYS_readv_nocancel"] = 411] = "SYS_readv_nocancel";
    SYSCALL[SYSCALL["SYS_writev_nocancel"] = 412] = "SYS_writev_nocancel";
    SYSCALL[SYSCALL["SYS_sendto_nocancel"] = 413] = "SYS_sendto_nocancel";
    SYSCALL[SYSCALL["SYS_pread_nocancel"] = 414] = "SYS_pread_nocancel";
    SYSCALL[SYSCALL["SYS_pwrite_nocancel"] = 415] = "SYS_pwrite_nocancel";
    SYSCALL[SYSCALL["SYS_waitid_nocancel"] = 416] = "SYS_waitid_nocancel";
    SYSCALL[SYSCALL["SYS_poll_nocancel"] = 417] = "SYS_poll_nocancel";
    SYSCALL[SYSCALL["SYS_msgsnd_nocancel"] = 418] = "SYS_msgsnd_nocancel";
    SYSCALL[SYSCALL["SYS_msgrcv_nocancel"] = 419] = "SYS_msgrcv_nocancel";
    SYSCALL[SYSCALL["SYS_sem_wait_nocancel"] = 420] = "SYS_sem_wait_nocancel";
    SYSCALL[SYSCALL["SYS_aio_suspend_nocancel"] = 421] = "SYS_aio_suspend_nocancel";
    SYSCALL[SYSCALL["SYS___sigwait_nocancel"] = 422] = "SYS___sigwait_nocancel";
    SYSCALL[SYSCALL["SYS___semwait_signal_nocancel"] = 423] = "SYS___semwait_signal_nocancel";
    SYSCALL[SYSCALL["SYS___mac_mount"] = 424] = "SYS___mac_mount";
    SYSCALL[SYSCALL["SYS___mac_get_mount"] = 425] = "SYS___mac_get_mount";
    SYSCALL[SYSCALL["SYS___mac_getfsstat"] = 426] = "SYS___mac_getfsstat";
    SYSCALL[SYSCALL["SYS_fsgetpath"] = 427] = "SYS_fsgetpath";
    SYSCALL[SYSCALL["SYS_audit_session_self"] = 428] = "SYS_audit_session_self";
    SYSCALL[SYSCALL["SYS_audit_session_join"] = 429] = "SYS_audit_session_join";
    SYSCALL[SYSCALL["SYS_fileport_makeport"] = 430] = "SYS_fileport_makeport";
    SYSCALL[SYSCALL["SYS_fileport_makefd"] = 431] = "SYS_fileport_makefd";
    SYSCALL[SYSCALL["SYS_audit_session_port"] = 432] = "SYS_audit_session_port";
    SYSCALL[SYSCALL["SYS_pid_suspend"] = 433] = "SYS_pid_suspend";
    SYSCALL[SYSCALL["SYS_pid_resume"] = 434] = "SYS_pid_resume";
    SYSCALL[SYSCALL["SYS_pid_hibernate"] = 435] = "SYS_pid_hibernate";
    SYSCALL[SYSCALL["SYS_pid_shutdown_sockets"] = 436] = "SYS_pid_shutdown_sockets";
    // 437 is old shared_region_slide_np
    SYSCALL[SYSCALL["SYS_shared_region_map_and_slide_np"] = 438] = "SYS_shared_region_map_and_slide_np";
    SYSCALL[SYSCALL["SYS_kas_info"] = 439] = "SYS_kas_info";
    SYSCALL[SYSCALL["SYS_memorystatus_control"] = 440] = "SYS_memorystatus_control";
    SYSCALL[SYSCALL["SYS_guarded_open_np"] = 441] = "SYS_guarded_open_np";
    SYSCALL[SYSCALL["SYS_guarded_close_np"] = 442] = "SYS_guarded_close_np";
    SYSCALL[SYSCALL["SYS_guarded_kqueue_np"] = 443] = "SYS_guarded_kqueue_np";
    SYSCALL[SYSCALL["SYS_change_fdguard_np"] = 444] = "SYS_change_fdguard_np";
    SYSCALL[SYSCALL["SYS_usrctl"] = 445] = "SYS_usrctl";
    SYSCALL[SYSCALL["SYS_proc_rlimit_control"] = 446] = "SYS_proc_rlimit_control";
    SYSCALL[SYSCALL["SYS_connectx"] = 447] = "SYS_connectx";
    SYSCALL[SYSCALL["SYS_disconnectx"] = 448] = "SYS_disconnectx";
    SYSCALL[SYSCALL["SYS_peeloff"] = 449] = "SYS_peeloff";
    SYSCALL[SYSCALL["SYS_socket_delegate"] = 450] = "SYS_socket_delegate";
    SYSCALL[SYSCALL["SYS_telemetry"] = 451] = "SYS_telemetry";
    SYSCALL[SYSCALL["SYS_proc_uuid_policy"] = 452] = "SYS_proc_uuid_policy";
    SYSCALL[SYSCALL["SYS_memorystatus_get_level"] = 453] = "SYS_memorystatus_get_level";
    SYSCALL[SYSCALL["SYS_system_override"] = 454] = "SYS_system_override";
    SYSCALL[SYSCALL["SYS_vfs_purge"] = 455] = "SYS_vfs_purge";
    SYSCALL[SYSCALL["SYS_sfi_ctl"] = 456] = "SYS_sfi_ctl";
    SYSCALL[SYSCALL["SYS_sfi_pidctl"] = 457] = "SYS_sfi_pidctl";
    SYSCALL[SYSCALL["SYS_coalition"] = 458] = "SYS_coalition";
    SYSCALL[SYSCALL["SYS_coalition_info"] = 459] = "SYS_coalition_info";
    SYSCALL[SYSCALL["SYS_necp_match_policy"] = 460] = "SYS_necp_match_policy";
    SYSCALL[SYSCALL["SYS_getattrlistbulk"] = 461] = "SYS_getattrlistbulk";
    SYSCALL[SYSCALL["SYS_clonefileat"] = 462] = "SYS_clonefileat";
    SYSCALL[SYSCALL["SYS_openat"] = 463] = "SYS_openat";
    SYSCALL[SYSCALL["SYS_openat_nocancel"] = 464] = "SYS_openat_nocancel";
    SYSCALL[SYSCALL["SYS_renameat"] = 465] = "SYS_renameat";
    SYSCALL[SYSCALL["SYS_faccessat"] = 466] = "SYS_faccessat";
    SYSCALL[SYSCALL["SYS_fchmodat"] = 467] = "SYS_fchmodat";
    SYSCALL[SYSCALL["SYS_fchownat"] = 468] = "SYS_fchownat";
    SYSCALL[SYSCALL["SYS_fstatat"] = 469] = "SYS_fstatat";
    SYSCALL[SYSCALL["SYS_fstatat64"] = 470] = "SYS_fstatat64";
    SYSCALL[SYSCALL["SYS_linkat"] = 471] = "SYS_linkat";
    SYSCALL[SYSCALL["SYS_unlinkat"] = 472] = "SYS_unlinkat";
    SYSCALL[SYSCALL["SYS_readlinkat"] = 473] = "SYS_readlinkat";
    SYSCALL[SYSCALL["SYS_symlinkat"] = 474] = "SYS_symlinkat";
    SYSCALL[SYSCALL["SYS_mkdirat"] = 475] = "SYS_mkdirat";
    SYSCALL[SYSCALL["SYS_getattrlistat"] = 476] = "SYS_getattrlistat";
    SYSCALL[SYSCALL["SYS_proc_trace_log"] = 477] = "SYS_proc_trace_log";
    SYSCALL[SYSCALL["SYS_bsdthread_ctl"] = 478] = "SYS_bsdthread_ctl";
    SYSCALL[SYSCALL["SYS_openbyid_np"] = 479] = "SYS_openbyid_np";
    SYSCALL[SYSCALL["SYS_recvmsg_x"] = 480] = "SYS_recvmsg_x";
    SYSCALL[SYSCALL["SYS_sendmsg_x"] = 481] = "SYS_sendmsg_x";
    SYSCALL[SYSCALL["SYS_thread_selfusage"] = 482] = "SYS_thread_selfusage";
    SYSCALL[SYSCALL["SYS_csrctl"] = 483] = "SYS_csrctl";
    SYSCALL[SYSCALL["SYS_guarded_open_dprotected_np"] = 484] = "SYS_guarded_open_dprotected_np";
    SYSCALL[SYSCALL["SYS_guarded_write_np"] = 485] = "SYS_guarded_write_np";
    SYSCALL[SYSCALL["SYS_guarded_pwrite_np"] = 486] = "SYS_guarded_pwrite_np";
    SYSCALL[SYSCALL["SYS_guarded_writev_np"] = 487] = "SYS_guarded_writev_np";
    SYSCALL[SYSCALL["SYS_renameatx_np"] = 488] = "SYS_renameatx_np";
    SYSCALL[SYSCALL["SYS_mremap_encrypted"] = 489] = "SYS_mremap_encrypted";
    SYSCALL[SYSCALL["SYS_netagent_trigger"] = 490] = "SYS_netagent_trigger";
    SYSCALL[SYSCALL["SYS_stack_snapshot_with_config"] = 491] = "SYS_stack_snapshot_with_config";
    SYSCALL[SYSCALL["SYS_microstackshot"] = 492] = "SYS_microstackshot";
    SYSCALL[SYSCALL["SYS_grab_pgo_data"] = 493] = "SYS_grab_pgo_data";
    SYSCALL[SYSCALL["SYS_persona"] = 494] = "SYS_persona";
    // 495-498 are unused
    SYSCALL[SYSCALL["SYS_work_interval_ctl"] = 499] = "SYS_work_interval_ctl";
    SYSCALL[SYSCALL["SYS_getentropy"] = 500] = "SYS_getentropy";
    SYSCALL[SYSCALL["SYS_necp_open"] = 501] = "SYS_necp_open";
    SYSCALL[SYSCALL["SYS_necp_client_action"] = 502] = "SYS_necp_client_action";
    SYSCALL[SYSCALL["SYS___nexus_open"] = 503] = "SYS___nexus_open";
    SYSCALL[SYSCALL["SYS___nexus_register"] = 504] = "SYS___nexus_register";
    SYSCALL[SYSCALL["SYS___nexus_deregister"] = 505] = "SYS___nexus_deregister";
    SYSCALL[SYSCALL["SYS___nexus_create"] = 506] = "SYS___nexus_create";
    SYSCALL[SYSCALL["SYS___nexus_destroy"] = 507] = "SYS___nexus_destroy";
    SYSCALL[SYSCALL["SYS___nexus_get_opt"] = 508] = "SYS___nexus_get_opt";
    SYSCALL[SYSCALL["SYS___nexus_set_opt"] = 509] = "SYS___nexus_set_opt";
    SYSCALL[SYSCALL["SYS___channel_open"] = 510] = "SYS___channel_open";
    SYSCALL[SYSCALL["SYS___channel_get_info"] = 511] = "SYS___channel_get_info";
    SYSCALL[SYSCALL["SYS___channel_sync"] = 512] = "SYS___channel_sync";
    SYSCALL[SYSCALL["SYS___channel_get_opt"] = 513] = "SYS___channel_get_opt";
    SYSCALL[SYSCALL["SYS___channel_set_opt"] = 514] = "SYS___channel_set_opt";
    SYSCALL[SYSCALL["SYS_ulock_wait"] = 515] = "SYS_ulock_wait";
    SYSCALL[SYSCALL["SYS_ulock_wake"] = 516] = "SYS_ulock_wake";
    SYSCALL[SYSCALL["SYS_fclonefileat"] = 517] = "SYS_fclonefileat";
    SYSCALL[SYSCALL["SYS_fs_snapshot"] = 518] = "SYS_fs_snapshot";
    // 519 is unused
    SYSCALL[SYSCALL["SYS_terminate_with_payload"] = 520] = "SYS_terminate_with_payload";
    SYSCALL[SYSCALL["SYS_abort_with_payload"] = 521] = "SYS_abort_with_payload";
    SYSCALL[SYSCALL["SYS_necp_session_open"] = 522] = "SYS_necp_session_open";
    SYSCALL[SYSCALL["SYS_necp_session_action"] = 523] = "SYS_necp_session_action";
    SYSCALL[SYSCALL["SYS_setattrlistat"] = 524] = "SYS_setattrlistat";
    SYSCALL[SYSCALL["SYS_net_qos_guideline"] = 525] = "SYS_net_qos_guideline";
    SYSCALL[SYSCALL["SYS_fmount"] = 526] = "SYS_fmount";
    SYSCALL[SYSCALL["SYS_ntp_adjtime"] = 527] = "SYS_ntp_adjtime";
    SYSCALL[SYSCALL["SYS_ntp_gettime"] = 528] = "SYS_ntp_gettime";
    SYSCALL[SYSCALL["SYS_os_fault_with_payload"] = 529] = "SYS_os_fault_with_payload";
    SYSCALL[SYSCALL["SYS_kqueue_workloop_ctl"] = 530] = "SYS_kqueue_workloop_ctl";
    SYSCALL[SYSCALL["SYS___mach_bridge_remote_time"] = 531] = "SYS___mach_bridge_remote_time";
    SYSCALL[SYSCALL["SYS_coalition_ledger"] = 532] = "SYS_coalition_ledger";
    SYSCALL[SYSCALL["SYS_log_data"] = 533] = "SYS_log_data";
    SYSCALL[SYSCALL["SYS_memorystatus_available_memory"] = 534] = "SYS_memorystatus_available_memory";
    SYSCALL[SYSCALL["SYS_MAXSYSCALL"] = 535] = "SYS_MAXSYSCALL";
})(SYSCALL || (SYSCALL = {}));
// #include <machine/signal.h>     /* sigcontext; codes for SIGILL, SIGFPE */
// #define SIGHUP  1       /* hangup */
// #define SIGINT  2       /* interrupt */
// #define SIGQUIT 3       /* quit */
// #define SIGILL  4       /* illegal instruction (not reset when caught) */
// #define SIGTRAP 5       /* trace trap (not reset when caught) */
// #define SIGABRT 6       /* abort() */
// #if  (defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE))
// #define SIGPOLL 7       /* pollable event ([XSR] generated, not supported) */
// #else   /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
// #define SIGIOT  SIGABRT /* compatibility */
// #define SIGEMT  7       /* EMT instruction */
// #endif  /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
// #define SIGFPE  8       /* floating point exception */
// #define SIGKILL 9       /* kill (cannot be caught or ignored) */
// #define SIGBUS  10      /* bus error */
// #define SIGSEGV 11      /* segmentation violation */
// #define SIGSYS  12      /* bad argument to system call */
// #define SIGPIPE 13      /* write on a pipe with no one to read it */
// #define SIGALRM 14      /* alarm clock */
// #define SIGTERM 15      /* software termination signal from kill */
// #define SIGURG  16      /* urgent condition on IO channel */
// #define SIGSTOP 17      /* sendable stop signal not from tty */
// #define SIGTSTP 18      /* stop signal from tty */
// #define SIGCONT 19      /* continue a stopped process */
// #define SIGCHLD 20      /* to parent on child stop or exit */
// #define SIGTTIN 21      /* to readers pgrp upon background tty read */
// #define SIGTTOU 22      /* like TTIN for output if (tp->t_local&LTOSTOP) */
// #if  (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
// #define SIGIO   23      /* input/output possible signal */
// #endif
// #define SIGXCPU 24      /* exceeded CPU time limit */
// #define SIGXFSZ 25      /* exceeded file size limit */
// #define SIGVTALRM 26    /* virtual time alarm */
// #define SIGPROF 27      /* profiling time alarm */
// #if  (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
// #define SIGWINCH 28     /* window size changes */
// #define SIGINFO 29      /* information request */
// #endif
// #define SIGUSR1 30      /* user defined signal 1 */
// #define SIGUSR2 31      /* user defined signal 2 */
// #if defined(_ANSI_SOURCE) || __DARWIN_UNIX03 || defined(__cplusplus)
// /*
//  * Language spec sez we must list exactly one parameter, even though we
//  * actually supply three.  Ugh!
//  * SIG_HOLD is chosen to avoid KERN_SIG_* values in <sys/signalvar.h>
//  */
// #define SIG_DFL         (void (*)(int))0
// #define SIG_IGN         (void (*)(int))1
// #define SIG_HOLD        (void (*)(int))5
// #define SIG_ERR         ((void (*)(int))-1)
// #else
// /* DO NOT REMOVE THE COMMENTED OUT int: fixincludes needs to see them */
// #define SIG_DFL         (void (*)( /*int*/ ))0
// #define SIG_IGN         (void (*)( /*int*/ ))1
// #define SIG_HOLD        (void (*)( /*int*/ ))5
// #define SIG_ERR         ((void (*)( /*int*/ ))-1)
// #endif
export var SIGNAL;
(function (SIGNAL) {
    SIGNAL[SIGNAL["SIGHUP"] = 1] = "SIGHUP";
    SIGNAL[SIGNAL["SIGINT"] = 2] = "SIGINT";
    SIGNAL[SIGNAL["SIGQUIT"] = 3] = "SIGQUIT";
    SIGNAL[SIGNAL["SIGILL"] = 4] = "SIGILL";
    SIGNAL[SIGNAL["SIGTRAP"] = 5] = "SIGTRAP";
    SIGNAL[SIGNAL["SIGABRT"] = 6] = "SIGABRT";
    SIGNAL[SIGNAL["SIGEMT"] = 7] = "SIGEMT";
    SIGNAL[SIGNAL["SIGFPE"] = 8] = "SIGFPE";
    SIGNAL[SIGNAL["SIGKILL"] = 9] = "SIGKILL";
    SIGNAL[SIGNAL["SIGBUS"] = 10] = "SIGBUS";
    SIGNAL[SIGNAL["SIGSEGV"] = 11] = "SIGSEGV";
    SIGNAL[SIGNAL["SIGSYS"] = 12] = "SIGSYS";
    SIGNAL[SIGNAL["SIGPIPE"] = 13] = "SIGPIPE";
    SIGNAL[SIGNAL["SIGALRM"] = 14] = "SIGALRM";
    SIGNAL[SIGNAL["SIGTERM"] = 15] = "SIGTERM";
    SIGNAL[SIGNAL["SIGURG"] = 16] = "SIGURG";
    SIGNAL[SIGNAL["SIGSTOP"] = 17] = "SIGSTOP";
    SIGNAL[SIGNAL["SIGTSTP"] = 18] = "SIGTSTP";
    SIGNAL[SIGNAL["SIGCONT"] = 19] = "SIGCONT";
    SIGNAL[SIGNAL["SIGCHLD"] = 20] = "SIGCHLD";
    SIGNAL[SIGNAL["SIGTTIN"] = 21] = "SIGTTIN";
    SIGNAL[SIGNAL["SIGTTOU"] = 22] = "SIGTTOU";
    SIGNAL[SIGNAL["SIGPOLL"] = 23] = "SIGPOLL";
    SIGNAL[SIGNAL["SIGXCPU"] = 24] = "SIGXCPU";
    SIGNAL[SIGNAL["SIGXFSZ"] = 25] = "SIGXFSZ";
    SIGNAL[SIGNAL["SIGVTALRM"] = 26] = "SIGVTALRM";
    SIGNAL[SIGNAL["SIGPROF"] = 27] = "SIGPROF";
    SIGNAL[SIGNAL["SIGWINCH"] = 28] = "SIGWINCH";
    SIGNAL[SIGNAL["SIGINFO"] = 29] = "SIGINFO";
    SIGNAL[SIGNAL["SIGUSR1"] = 30] = "SIGUSR1";
    SIGNAL[SIGNAL["SIGUSR2"] = 31] = "SIGUSR2";
    SIGNAL[SIGNAL["SIG_BLOCK"] = 0] = "SIG_BLOCK";
    SIGNAL[SIGNAL["SIG_UNBLOCK"] = 1] = "SIG_UNBLOCK";
})(SIGNAL || (SIGNAL = {}));
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/memory/include.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA"}
✄
import './findsvc.js';
✄
{"version":3,"file":"include.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/plugin/service/include.ts"],"names":[],"mappings":"AAAA,OAAO,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,CAAC,GAAG,CAAC,oCAAoC,UAAU,IAAI,QAAQ,IAAI,WAAW,EAAE,CAAC,CAAA;QACxF,IAAI,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE;YAC1C,IAAI,CAAC,0CAA0C,CAAC,CAAA;YAChD,IAAI,QAAQ,KAAK,CAAC,EAAE;gBAChB,IAAI,CAAC,4DAA4D,CAAC,CAAA;gBAClE,OAAO,YAAY,CAAA;aACtB;SACJ;QACD,OAAO,gBAAgB,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,CAAC,CAAA;IAC7G,CAAC,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;AAS7E,CAAC,CAAC,CAAA"}
✄
setImmediate(() => {
    return;
    B_NSLOG();
    const addr_IOObjectConformsTo = DebugSymbol.fromName("IOObjectConformsTo").address;
    const func_IOObjectConformsTo = new NativeFunction(addr_IOObjectConformsTo, 'int', ['pointer', 'pointer']);
    const addr_IORegistryEntryGetName = Module.getExportByName(null, "IORegistryEntryGetName");
    // KERN_SUCCESS 0
    const KERN_SUCCESS = 0;
    const cstr_IOWatchdog = allocCString("IOWatchdog");
    let gIOWatchdogConnection = NULL;
    // kern_return_t IOServiceOpen(io_service_t service, task_port_t owningTask, uint32_t type, io_connect_t *connect)
    const addr_IOServiceOpen = DebugSymbol.fromName("IOServiceOpen").address;
    Interceptor.replace(addr_IOServiceOpen, new NativeCallback((service, owningTask, type, connect) => {
        const originalFunction = new NativeFunction(addr_IOServiceOpen, 'int', ['pointer', 'pointer', 'uint', 'pointer']);
        const result = originalFunction(service, owningTask, type, connect);
        const nameBuffer = Memory.alloc(512);
        const length = 512;
        const IORegistryEntryGetName = new NativeFunction(addr_IORegistryEntryGetName, 'int', ['pointer', 'pointer', 'uint32']);
        if (IORegistryEntryGetName(service, nameBuffer, length) === KERN_SUCCESS) {
            const serviceName = nameBuffer.readUtf8String();
            logd(`Service Name: ${serviceName}`);
        }
        else {
            loge("Failed to get the service name");
        }
        logd(`Called IOServiceOpen ${service} ${owningTask} ${type} ${connect}`);
        if (result === KERN_SUCCESS && !connect.readPointer().isNull()) {
            if (func_IOObjectConformsTo(service, cstr_IOWatchdog)) {
                logw('got IOWatchdog');
                gIOWatchdogConnection = connect.readPointer();
            }
            else {
                logd('pass');
            }
        }
        return result;
    }, 'int', ['pointer', 'pointer', 'uint', 'pointer']));
    const addr_IOConnectCallStructMethod = DebugSymbol.fromName("IOConnectCallStructMethod").address;
    // kern_return_t IOConnectCallStructMethod(mach_port_t connection, uint32_t selector, const void *inputStruct, size_t inputStructCnt, void *outputStruct, size_t *outputStructCnt)
    const originalFunction = new NativeFunction(addr_IOConnectCallStructMethod, 'int', ['pointer', 'uint', 'pointer', 'ulong', 'pointer', 'pointer']);
    Interceptor.replace(addr_IOConnectCallStructMethod, new NativeCallback((connection, selector, inputStruct, inputStructCnt, outputStruct, outputStructCnt) => {
        console.log(`called IOConnectCallStructMethod ${connection} ${selector} ${inputStruct}`);
        if (connection.equals(gIOWatchdogConnection)) {
            logw(`connection.equals(gIOWatchdogConnection)`);
            if (selector === 2) {
                logw('connection.equals(gIOWatchdogConnection) and selector == 2');
                return KERN_SUCCESS;
            }
        }
        return originalFunction(connection, selector, inputStruct, inputStructCnt, outputStruct, outputStructCnt);
    }, 'int', ['pointer', 'uint', 'pointer', 'ulong', 'pointer', 'pointer']));
});
✄
{"version":3,"file":"runtime.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/runtime.ts"],"names":[],"mappings":"AAMA,yDAAyD;AAEzD,UAAU,CAAC,KAAK,GAAG,MAAM,KAAK;CAAG,CAAA;AAEjC,IAAI,OAAO,CAAC,QAAQ,IAAI,QAAQ,EAAE;IAC9B,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,UAAS,MAAM;QACjF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACnC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;SAClD;IACL,CAAC,CAAC,CAAA;CACL;;AAED,+BAA+B;AAC/B,MAAM"}
✄
// usesage : libcA.objc_msgSend / libcA.objc_getClass ...
globalThis.libcA = class libcA {
};
if (Process.platform == "darwin") {
    Process.getModuleByName("libobjc.A.dylib").enumerateSymbols().forEach(function (symbol) {
        if (!symbol.name.includes('redacted')) {
            Reflect.set(libcA, symbol.name, symbol.address);
        }
    });
}
export {};
// todo : other common libs ...
// ...
✄
{"version":3,"file":"types.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/types.ts"],"names":[],"mappings":""}
✄
export {};
✄
{"version":3,"file":"utils.js","sourceRoot":"C:/Users/A/testFrida/IOSUtils/","sources":["agent/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,OAAO,YAAY,CAAA;AAEnB,6BAA6B;AAC7B,cAAc;AACd,MAAM,OAAO,eAAe;IAQxB,YAAY,MAAc,GAAG,EAAE,cAAsB,IAAI;QAPjD,iBAAY,GAAW,GAAG,CAAA;QAC1B,iBAAY,GAAW,GAAG,CAAA,CAAC,KAAK;QAChC,qBAAgB,GAAW,CAAC,CAAA;QAC5B,mBAAc,GAAW,YAAY,CAAA;QAErC,mBAAc,GAAY,KAAK,CAAA,CAAC,YAAY;QAGhD,IAAI,CAAC,YAAY,GAAG,GAAG,CAAA;QACvB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;QACzB,IAAI,CAAC,KAAK,EAAE,C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/D;AACL,CAAC;AAiED,MAAM,CAAN,IAAY,OAIX;AAJD,WAAY,OAAO;IACf,qDAAgB,CAAA;IAChB,+CAAa,CAAA;IACb,6CAAY,CAAA;AAChB,CAAC,EAJW,OAAO,KAAP,OAAO,QAIlB;AAGD,UAAU,CAAC,CAAC,GAAG,SAAS,CAAA;AACxB,UAAU,CAAC,CAAC,GAAG,YAAY,CAAA;AAC3B,UAAU,CAAC,CAAC,GAAG,WAAW,CAAA;AAC1B,UAAU,CAAC,EAAE,GAAG,SAAS,CAAA;AACzB,UAAU,CAAC,GAAG,GAAG,sBAAsB,CAAA;AACvC,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAA,CAAC,CAAC,CAAA;AAEnC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAA"}
✄
import { NSUTF8StringEncoding } from './constants.js';
import { SIGNAL } from './plugin/memory/findsvc.js';
import './types.js';
// ... 单线程的js 这样只会显示最后的结果 ...
// 后续改改创建线程来轮询
export class ProcessDispTask {
    constructor(max = 100, refreshTime = 1000) {
        this._maxProgress = 100;
        this._refreshTime = 200; // ms
        this._currentProgress = 0;
        this._displayTitile = `Progress: `;
        this._processRuning = false; // runing ? 
        this._maxProgress = max;
        this._refreshTime = refreshTime;
        this._currentProgress = 0;
        this.start();
    }
    setMax(max) {
        this._maxProgress = max;
    }
    start() {
        this._processRuning = true;
        this._taskID = setInterval(() => {
            if (this._currentProgress >= this._maxProgress)
                this.stop();
            if (!this._processRuning)
                return;
            console.log('\x1Bc');
            console.warn(`${this._displayTitile} ${this._currentProgress * 100 / this._maxProgress}%\r`);
        }, this._refreshTime);
    }
    stop() {
        clearInterval(this._taskID);
        this._processRuning = false;
        console.log(`${this._displayTitile} ${this._currentProgress * 100 / this._maxProgress}%`);
    }
    update(progress) {
        this._currentProgress = progress;
    }
}
globalThis.ProcessDispTask = ProcessDispTask;
globalThis.clear = () => console.log('\x1Bc');
globalThis.hex = (ptr, len = 0x40) => {
    let mPtr = NULL;
    if (typeof ptr == 'string' && ptr.startsWith("0x"))
        mPtr = new NativePointer(ptr);
    else if (typeof ptr == 'number')
        mPtr = new NativePointer(ptr);
    else if (ptr instanceof NativePointer)
        mPtr = ptr;
    if (mPtr.isNull())
        throw new Error('ptr is null');
    console.log(hexdump(mPtr, { length: len, header: true, ansi: true }));
};
globalThis.dumpUI = () => {
    logd(ObjC.classes.UIWindow.keyWindow().recursiveDescription().toString());
};
globalThis.checkPointer = (ptr, throwErr = true) => {
    let mPtr = NULL;
    if (typeof ptr === 'string') {
        ptr = ptr.trim();
        if (ptr.startsWith('0x')) {
            mPtr = new NativePointer(parseInt(ptr, 16));
        }
        else {
            try {
                mPtr = ObjC.classes[ptr].handle;
            }
            catch { }
            try {
                if (mPtr.isNull())
                    mPtr = DebugSymbol.fromName(ptr).address;
            }
            catch { }
            if (mPtr.isNull()) {
                if (throwErr)
                    throw new Error(`Invalid pointer <- cannot find '${ptr}'`);
                return NULL;
            }
            return mPtr;
        }
    }
    else if (typeof ptr === 'number') {
        mPtr = new NativePointer(ptr);
    }
    else if (ptr instanceof NativePointer) {
        mPtr = ptr;
    }
    else if (ptr instanceof ObjC.Object) {
        mPtr = ptr.handle;
    }
    if (throwErr && mPtr.isNull())
        throw new Error('Invalid pointer');
    return mPtr;
};
globalThis.allocOCString = (str) => {
    if (str == undefined || str.length == 0 || str == null)
        throw new Error('Invalid string');
    return ObjC.classes["NSString"]["+ stringWithUTF8String:"](allocCString(str));
};
globalThis.allocCString = (str) => {
    if (str == undefined || str.length == 0 || str == null)
        throw new Error('Invalid string');
    return Memory.allocUtf8String(str);
};
/**
 *
 * @param ptr function address | asm start address
 * @param args arguments list | if call oc function, instance as first arg, use ObjC.selector or NSSelectorFromString as the secend arg
 * @returns function return value | NativePointer
 * @example
 *
 * new ObjC.selector("xxx") === call("NSSelectorFromString", allocOCString("xxx"))
 *
 * [ UILabel ] 0x102e07840
    UILabel ( 0x20310ec40 )  -> UIView ( 0x20310f668 )  -> UIResponder ( 0x203108f98 )  -> NSObject ( 0x2030ca1f0 )
    [ 0 ]    M: 0x1ba532e80 | - setTextColor:
    [ 1 ]    M: 0x1ba53393c | - setTextAlignment:
    [ 2 ]    M: 0x1ba5328d8 | - setText:
    [ 3 ]    M: 0x1ba533a40 | - setHighlightedTextColor:
    [ 4 ]    M: 0x1ba53ba58 | - setAutotrackTextToFit:
    
    call(0x1ba5328d8, 0x102e07840, ObjC.selector("- setText:"), allocOCString("123123123"))
 */
const debugLog = false;
globalThis.call = (ptr, ...args) => {
    try {
        const target = checkPointer(ptr);
        if (debugLog)
            logw(`Called -> Address: ${target}${typeof ptr == "string" ? ` ${ptr}\t` : ''} | Arguments [ ${args.length} ] -> ${args}`);
        const argsStr = args.map(arg => typeof arg === 'number' ? `"pointer"` : `"pointer"`).join(', '); // All types are treated as pointer
        const func = eval(`new NativeFunction(new NativePointer(${target}), 'pointer', [ ${argsStr} ])`);
        if (typeof func !== 'function')
            throw new Error("Error while Created NativeFunction");
        return func(...args.map(item => checkPointer(item)));
    }
    catch (error) {
        throw new Error(`Error during call: \n\t${error}`);
    }
};
globalThis.callOC = (objPtr, funcName, ...args) => {
    return new ObjC.Object(checkPointer(objPtr))[funcName](...args);
    // return call(ptr(new ObjC.Object(checkPointer(objPtr))[funcName].implementation), objPtr, ObjC.selector(funcName), ...args)
};
/**
 * OC call on main thread
 *
 * @param objPtr
 * @param funcName
 * @param args
 *
 * example : callOcOnMain(0x102e07840, "- setText:", allocOCString("test"))
 */
globalThis.callOcOnMain = (objPtr, funcName, ...args) => {
    ObjC.schedule(ObjC.mainQueue, () => {
        const ret = callOC(objPtr, funcName, ...args);
        if (ret != undefined)
            logd(`${ret}`);
    });
};
const bytesToUTF8 = (data) => {
    // Sample Objective-C
    // char buf[] = "\x41\x42\x43\x44";
    // NSString *p = [[NSString alloc] initWithBytes:buf length:5 encoding:NSUTF8StringEncoding];
    if (data === null) {
        return "";
    }
    if (!data.hasOwnProperty("bytes")) {
        return data.toString();
    }
    const s = ObjC.classes.NSString.alloc().initWithBytes_length_encoding_(data.bytes(), data.length(), NSUTF8StringEncoding);
    if (s) {
        return s.UTF8String();
    }
    return "";
};
globalThis.getIvars = (clazz) => {
    const mPtr = checkPointer(clazz);
    const obj = new ObjC.Object(mPtr); // class handle
    if (obj.$kind != "instance")
        throw new Error("Wrong Object ptr\nclass_copyIvarList api only support instance ptr as first argument");
    const classHandles = [];
    let currentClassHandle = obj.$class.handle;
    do {
        classHandles.unshift(currentClassHandle);
        currentClassHandle = ObjC.api.class_getSuperclass(currentClassHandle);
    } while (!currentClassHandle.isNull());
    const retValue = new Array();
    const numIvarsBuf = Memory.alloc(Process.pointerSize);
    classHandles.forEach(clazz => {
        const ivarHandles = ObjC.api.class_copyIvarList(clazz, numIvarsBuf);
        try {
            const numIvars = numIvarsBuf.readUInt();
            for (let i = 0; i !== numIvars; i++) {
                const handle = ivarHandles.add(i * Process.pointerSize).readPointer();
                const name = ObjC.api.ivar_getName(handle).readUtf8String();
                const offset = ObjC.api.ivar_getOffset(handle).toInt32();
                retValue.push({ objClazz: new ObjC.Object(clazz), handle: handle, name: name, offset: offset });
            }
        }
        finally {
            ObjC.api.free(ivarHandles);
        }
    });
    return retValue;
};
globalThis.showIvars = (clazz) => {
    const mPtr = checkPointer(clazz);
    let obj = new ObjC.Object(mPtr); // obj handle
    showSuperClasses(obj.handle);
    const res = getIvars(obj.handle);
    const groupedByObjClazz = res.reduce((acc, item) => {
        const clazzKey = item.objClazz.toString();
        if (!acc[clazzKey]) {
            acc[clazzKey] = [];
        }
        acc[clazzKey].push(item);
        return acc;
    }, {});
    Object.keys(groupedByObjClazz).forEach((clazzKey) => {
        logn(`\n--- ${ObjC.classes[clazzKey].handle} & ${clazzKey} ---`);
        groupedByObjClazz[clazzKey].forEach((item, index) => logd(`[ ${index} ]\t${ptr(item.offset)} -> ${item.name}`));
    });
    newLine();
};
globalThis.lfs = (ptrArg, ret = false) => {
    const mPtr = checkPointer(ptrArg);
    const obj = new ObjC.Object(mPtr); // class handle
    if (obj.$kind != "instance")
        throw new Error("ivars | can only parse instance");
    showSuperClasses(obj.$class);
    const res = getIvars(obj.handle);
    const groupedByObjClazz = res.reduce((acc, item) => {
        const clazzKey = item.objClazz.toString();
        if (!acc[clazzKey]) {
            acc[clazzKey] = [];
        }
        acc[clazzKey].push(item);
        return acc;
    }, {});
    const $clonedIvars = {};
    const vars = obj.$ivars;
    Object.keys(groupedByObjClazz).forEach((clazzKey) => {
        logn(`\n--- ${ObjC.classes[clazzKey].handle} & ${clazzKey} ---`);
        groupedByObjClazz[clazzKey].forEach((item, index) => {
            try {
                const name = item.name;
                if (vars.hasOwnProperty(name)) {
                    const v = vars[name];
                    $clonedIvars[name] = bytesToUTF8(v);
                    if (ret)
                        return;
                    if (v instanceof ObjC.Object) {
                        const clsName = v.$className;
                        let ext = '';
                        try {
                            switch (clsName) {
                                case '__NSCFString':
                                    // 特值处理，当然这里这样写是没必要的，只是单独摘出来而已
                                    ext = `-> "${new ObjC.Object(v.handle)}"`;
                                    break;
                                default:
                                    if (!v.handle.isNull()) {
                                        let objStr = asOcObjtoString(v.handle);
                                        if (objStr.includes("\n")) {
                                            const lines = objStr.split("\n");
                                            objStr = lines.map(line => `\t\t${line}`).join("\n");
                                            objStr = `\n${objStr}`;
                                        }
                                        ext = `-> ${objStr}`;
                                    }
                                    break;
                            }
                        }
                        catch (error) { }
                        logd(`[ ${index} ]\t${ptr(item.offset)} [ ${ptr(item.offset).add(mPtr)} ] -> ${name}: | ObjC.Object <- ${v.$kind} of ${clsName} @ ${v.$class.handle}`);
                        logz(`\t${v.handle} ${ext}`);
                    }
                    else if (typeof v == "object") {
                        logd(`[ ${index} ]\t${ptr(item.offset)} [ ${ptr(item.offset).add(mPtr)} ] -> ${name}: | ${typeof v}`);
                        logz(`\t${v}`);
                    }
                    else {
                        logd(`[ ${index} ]\t${ptr(item.offset)} [ ${ptr(item.offset).add(mPtr)} ] -> ${name}: | ${typeof v}`);
                        logz(`\t${$clonedIvars[name]}`);
                    }
                }
            }
            catch (error) {
                logd(`[ ${index} ]\t${ptr(item.offset)} [ ${ptr(item.offset).add(mPtr)} ] -> ${item.name}: | Error accessing value`);
            }
        });
    });
    newLine();
    if (ret)
        return $clonedIvars;
};
// similar to x/a (lldb) 
/**
 * example:
 * can use at block
 * [Remote::MobileSMS ]-> xa(0x280c5bd18)
    0x280c5bd18 -> 0x280c5bd20         |
    0x280c5bd18 -> 0x1f6528a68         |    libsystem_blocks.dylib ! _NSConcreteMallocBlock
    0x280c5bd18 -> 0xc3000002          |
    0x280c5bd18 -> 0x1a1bee114         |    ContactsAutocompleteUI ! __44-[CNComposeRecipientTextView initWithFrame:]_block_invoke
    0x280c5bd18 -> 0x1ef275b48         |    ContactsAutocompleteUI ! __block_descriptor_40_e8_32w_e24_v16?0"NSNotification"8l
 */
globalThis.xa = (ptr, count = 5) => {
    newLine();
    logd(xas(ptr));
    newLine();
};
globalThis.xas = (ptr, count = 5, split = '|') => {
    const mPtr = checkPointer(ptr);
    let ret = '';
    for (let i = 0; i < count; i++) {
        const indexAddress = mPtr;
        const current = indexAddress.add(i * Process.pointerSize).readPointer();
        const sym = DebugSymbol.fromAddress(current);
        const mdName = sym.moduleName;
        const symDisp = mdName == null ? '' : `${mdName} ! ${sym.name}`;
        ret += `${indexAddress} -> ${current.toString().padEnd(4 + Process.pointerSize * 2, ' ')}${split}\t${symDisp}\n`;
    }
    return ret.trimEnd();
};
globalThis.getBacktrace = (ctx) => `called from:\n${Thread.backtrace(ctx, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n\t')}\n`;
globalThis.printBacktrace = (ctx) => log(getBacktrace(ctx));
globalThis.raise = (sign = SIGNAL.SIGSTOP) => new NativeFunction(Module.findExportByName(null, 'raise'), 'int', ['int'])(sign);
// globalThis.lfs = (ptr: NativePointer | string | number, ret: boolean = false) => {
//     const mPtr = checkPointer(ptr)
//     const obj = new ObjC.Object(mPtr) // class handle
//     if (obj.$kind != "instance") throw new Error("ivars | can only parse instance")
//     showSuperClasses(obj.handle)
//     const $clonedIvars: { [name: string]: any } = {}
//     const vars = obj.$ivars
//     let index: number = 0
//     // frida-oc-bridge impl
//     for (const k in vars) {
//         try {
//             if (vars.hasOwnProperty(k)) {
//                 const v = vars[k] as Object
//                 $clonedIvars[k] = bytesToUTF8(v)
//                 if (ret) continue
//                 if (v instanceof ObjC.Object) {
//                     logd(`[${++index}] ${k}: | ObjC.Object <- ${v.$kind} of ${v.$className} @ ${v.$class.handle}`)
//                     logz(`\t${v.handle}`)
//                 } else if (typeof v == "object") {
//                     logd(`[${++index}] ${k}: | ${typeof v}`)
//                     logz(`\t${v}`)
//                 } else {
//                     logd(`[${++index}] ${k}: | ${typeof v}`)
//                     logz(`\t${$clonedIvars[k]}`)
//                 }
//             }
//         } catch (error) {
//         }
//     }
//     if (ret) return $clonedIvars
// }
var passValueKey;
(function (passValueKey) {
    passValueKey["org"] = "org";
    passValueKey["src"] = "src";
    passValueKey["enter"] = "enter";
    passValueKey["leave"] = "leave";
    passValueKey["time"] = "time";
})(passValueKey || (passValueKey = {}));
var map_attach_listener = new Map();
const attachNative = (mPtr, mOnEnter, mOnLeave, needRecord = true) => {
    if (typeof mPtr == "number")
        mPtr = ptr(mPtr);
    if (mPtr instanceof NativePointer && mPtr.isNull())
        return;
    var passValue = new Map();
    passValue.set(passValueKey.org, mPtr);
    passValue.set(passValueKey.src, mPtr);
    passValue.set(passValueKey.enter, mOnEnter);
    passValue.set(passValueKey.leave, mOnLeave);
    passValue.set(passValueKey.time, new Date());
    mPtr = checkPointer(mPtr);
    let Listener = Interceptor.attach(mPtr, {
        onEnter: function (args) {
            if (mOnEnter != undefined)
                mOnEnter(args, this.context, passValue);
        },
        onLeave: function (retval) {
            if (mOnLeave != undefined)
                mOnLeave(retval, this.context, passValue);
        }
    });
    if (needRecord)
        map_attach_listener.set(String(mPtr), Listener);
};
const detachAll = (mPtr) => {
    if (typeof mPtr == "number")
        mPtr = ptr(mPtr);
    if (mPtr == undefined) {
        map_attach_listener.clear();
        Interceptor.detachAll();
    }
    else {
        let key = String(checkPointer(mPtr));
        let listener = map_attach_listener.get(key);
        if (listener != undefined) {
            listener.detach();
            map_attach_listener.delete(key);
        }
    }
};
var arr_nop_addr = new Array();
function replaceFunction(mPtr, callBack, TYPENOP = true) {
    mPtr = checkPointer(mPtr);
    if (String(arr_nop_addr).indexOf(String(mPtr)) == -1) {
        arr_nop_addr.push(String(mPtr));
    }
    else {
        Interceptor.revert(mPtr);
    }
    const srcFunc = new NativeFunction(mPtr, 'pointer', ['pointer', 'pointer', 'pointer', 'pointer']);
    Interceptor.replace(mPtr, new NativeCallback((arg0, arg1, arg2, arg3) => {
        logw("\nCalled " + (TYPENOP ? "Replaced" : "Nop") + " function ---> " + mPtr);
        const ret = callBack(srcFunc, arg0, arg1, arg2, arg3);
        return ret == null ? ptr(0) : ret;
    }, 'pointer', ['pointer', 'pointer', 'pointer', 'pointer']));
}
const nopFunction = (mPtr) => {
    if (typeof mPtr == "number")
        mPtr = ptr(mPtr);
    if (mPtr == undefined)
        return;
    replaceFunction(mPtr, () => ptr(0), true);
};
const cancelNop = (mPtr) => {
    mPtr = checkPointer(mPtr);
    Interceptor.revert(mPtr);
    for (let i = 0; i < arr_nop_addr.length; i++) {
        if (String(arr_nop_addr[i]) == String(mPtr)) {
            arr_nop_addr = arr_nop_addr.splice(arr_nop_addr[i], 1);
        }
    }
};
const cancelAllNopedFunction = () => arr_nop_addr.forEach((addr) => Interceptor.revert(addr));
const stk = (mPtr) => {
    Interceptor.attach(checkPointer(mPtr), {
        onEnter: function (args) {
            logw(`ENTER: ${mPtr}\n\tINS=${new ObjC.Object(args[0])} SEL=${ObjC.selectorAsString(args[1])}`);
            logw(`\tARG2=${new ObjC.Object(args[2])} ARG3=${new ObjC.Object(args[3])} ... `);
            Stalker.follow(Process.getCurrentThreadId(), {
                events: {
                    exec: true
                },
                onReceive: function (events) {
                    const bbs = Stalker.parse(events, {
                        stringify: false,
                        annotate: false
                    });
                    logd(bbs.flat().map(item => DebugSymbol.fromAddress(ptr(item))).join('\n'));
                }
            });
        },
        onLeave: function (retval) {
            Stalker.unfollow();
            Stalker.flush();
        }
    });
};
globalThis.isObjcInstance = (mPtr) => {
    if (mPtr == undefined || mPtr.isNull())
        return NULL;
    try {
        return call("object_getClass", mPtr).readPointer();
    }
    catch (error) {
        return NULL;
    }
};
// +[UPWDeviceUtil deviceOSVersion] => {clsName, methodName}
// globalThis.nameToMethod = (method: string): ObjC.ObjectMethod => {
//     if (method[1] == '[' && method.endsWith(']')) {
//         const methodL = method.slice(2, -1)
//         const parts = methodL.split(' ')
//         if (parts.length != 2) throw new Error("Invalid format, there should be exactly one space.")
//         const className = parts[0]
//         const classMethod = `${method[0]} ${parts[1]}`
//         return ObjC.classes[className][classMethod]
//     } else {
//         throw new Error("Invalid format, should start with '+[' / '-[' and end with ']'")
//     }
// }
globalThis.nameToMethod = (method) => {
    if (method[1] === '[' && method.endsWith(']')) {
        const methodContent = method.slice(2, -1).trim(); // 去掉前缀 -[ 和 后缀 ]
        const parts = methodContent.split(' ');
        if (parts.length < 2) {
            throw new Error("Invalid format, should contain class and selector.");
        }
        const className = parts[0];
        // 将后续部分合并回 selector 字符串（并剔除地址参数）
        const selectorRaw = parts.slice(1).join(' ');
        // 将带地址的选择器（比如 xxx:0x123 yyy:0x456）转为 xxx:yyy:
        const selectorCleaned = selectorRaw
            .split(/\s+/)
            .map(seg => {
            const colonIndex = seg.indexOf(':');
            return colonIndex !== -1 ? seg.substring(0, colonIndex + 1) : seg;
        })
            .join('');
        const fullSelector = `${method[0]} ${selectorCleaned}`; // 恢复成 `- selector:` 形式
        return ObjC.classes[className][fullSelector];
    }
    else {
        throw new Error("Invalid format, should start with '+[' / '-[' and end with ']'");
    }
};
export const TIME_SIMPLE = () => new Date().toLocaleTimeString().split(" ")[0];
globalThis.addressToMethod = (mPtr) => nameToMethod(DebugSymbol.fromAddress(mPtr instanceof NativePointer ? mPtr : ptr(mPtr)).name);
globalThis.showAsm = (mPtr, len = 0x20) => {
    const l_mPtr = checkPointer(mPtr);
    let next = l_mPtr;
    newLine();
    const sym = DebugSymbol.fromAddress(l_mPtr);
    let status_func_start = false;
    let method = undefined;
    let methodCount = 2;
    const argsMap = new Map();
    // log function title
    if (sym.moduleName != null && sym.name != null) {
        const base = new ApiResolver('objc').enumerateMatches(sym.name)[0].address;
        let ext = '';
        if (!base.equals(sym.address))
            ext += `${sym.address.sub(base)}`;
        else {
            status_func_start = true;
            method = addressToMethod(base);
            methodCount = call("method_getNumberOfArguments", method.handle).toInt32();
        }
        logw(`${sym.moduleName} | ${sym.name} @ ${base} ${ext}\n`);
    }
    // instruction iterator
    while (len-- > 0) {
        try {
            // only deal with arm64
            const ins = Instruction.parse(next);
            const logMsg = `\t${ins.address} ${ins.mnemonic} ${ins.opStr}`;
            check_instance_args(ins, methodCount) ? loge(logMsg) : logd(logMsg);
            check_info_BL_B(ins);
            check_info_LDR_ADD(ins);
            next = ins.next;
        }
        catch (error) {
            // ...
        }
    }
    newLine();
    LOGJSON(argsMap);
    function check_info_BL_B(ins) {
        try {
            const op = ins.operands[0];
            // check bl 
            if ((ins.mnemonic == 'bl' || ins.mnemonic == 'b') && op.access == "r" && op.type == "imm")
                logz(`\t\t-> ${DebugSymbol.fromAddress(ptr(op.value.toNumber())).name}`);
        }
        catch (error) {
            // do notiong
            loge(error);
        }
    }
    function check_info_LDR_ADD(ins) {
        try {
            // check 
            // 0x10435b438 adrp x0, #0x104621000
            // 0x10435b43c add x0, x0, #0x8c8
            if (ins.mnemonic == 'add'
                && ins.operands[0].access == "w" && ins.operands[0].type == "reg"
                && ins.operands[1].access == "r" && ins.operands[1].type == "reg"
                && ins.operands[2].access == "r" && ins.operands[2].type == "imm"
                && ins.regsAccessed.read.toString() == ins.regsAccessed.written.toString()) {
                const offet = ins.operands[2].value.toNumber();
                const lastIns = Instruction.parse(ins.address.sub(ins.size));
                if (lastIns.mnemonic == 'adrp'
                    && lastIns.operands[0].access == "w" && lastIns.operands[0].type == "reg"
                    && lastIns.operands[1].access == "r" && lastIns.operands[1].type == "imm"
                    && lastIns.regsAccessed.written.toString() == ins.regsAccessed.read.toString()) {
                    const base = lastIns.operands[1].value.toNumber();
                    const addr = ptr(base).add(offet);
                    try {
                        const name = DebugSymbol.fromAddress(addr).name;
                        if (name != null) {
                            logz(`\t\t-> ${addr} ${name}`);
                        }
                        else {
                            const p = addr.readPointer().readPointer();
                            logz(`\t\t! ${p} "${new ObjC.Object(addr)}" | ${DebugSymbol.fromAddress(p).name}`);
                        }
                    }
                    catch (error) {
                        loge(error);
                    }
                }
            }
        }
        catch (error) {
            loge(error);
        }
    }
    function check_instance_args(ins, findNumberOfargs = 2) {
        if (!status_func_start || argsMap.size == findNumberOfargs)
            return false;
        for (let regIndex = 0; regIndex < findNumberOfargs; regIndex++) {
            const condition_operands_r = ins.operands.find(op => op.access == "r" && op.type == "reg" && op.value.toString() == `x${regIndex}`);
            const condition_regsAccessed_r = ins.regsAccessed.read.toString().includes(`x${regIndex}`);
            if (condition_operands_r && condition_regsAccessed_r) {
                return addToArgsArray({
                    index: regIndex,
                    address: ins.address,
                    extra: ins.opStr
                });
            }
        }
        return false;
        function addToArgsArray(args) {
            if (!argsMap.has(args.index)) {
                argsMap.set(args.index, args);
                return true;
            }
            else
                return false;
        }
    }
};
globalThis.dis = globalThis.showAsm;
globalThis.asOcObj = (mPtr) => {
    return new ObjC.Object(ptr(mPtr));
};
globalThis.asOcObjtoString = (mPtr) => {
    return decodeURIComponent(new ObjC.Object(ptr(mPtr)).toString()).toString();
};
globalThis.asOcString = (mPtr) => {
    logd(decodeURIComponent(new ObjC.Object(ptr(mPtr)).toString()));
};
globalThis.asOcSELtoString = (mPtr) => {
    return ObjC.selectorAsString(ptr(mPtr));
};
globalThis.demangleName = (expName) => {
    // DebugSymbol.fromName("__cxa_demangle")
    const demangleAddress = Module.findExportByName(null, '__cxa_demangle');
    if (demangleAddress == null)
        throw Error("can not find export function -> __cxa_demangle");
    const demangle = new NativeFunction(demangleAddress, 'pointer', ['pointer', 'pointer', 'pointer', 'pointer']);
    const mangledName = Memory.allocUtf8String(expName);
    const outputBuffer = NULL;
    const length = NULL;
    const status = Memory.alloc(Process.pageSize);
    const result = demangle(mangledName, outputBuffer, length, status);
    if (status.readInt() === 0) {
        let resultStr = result.readUtf8String();
        return (resultStr == null || resultStr == expName) ? "" : resultStr;
    }
    else
        return "";
};
globalThis.getSym = (filterName, mdName) => {
    if (mdName == undefined) {
        return Process.enumerateModules()
            .flatMap(module => module.enumerateSymbols())
            .filter(item => item.name.includes(filterName) || demangleName(item.name).includes(filterName));
    }
    else {
        const module = Process.findModuleByName(mdName);
        if (!module) {
            logw(`Module '${mdName}' not found...`);
            return undefined;
        }
        return module.enumerateSymbols()
            .filter(item => item.name.includes(filterName) || demangleName(item.name).includes(filterName));
    }
};
globalThis.findSym = (filterName, imageName = "", onlyFunction = false) => {
    if (filterName == undefined)
        throw new Error('filterName can not be null ...');
    newLine();
    if (imageName != undefined && imageName.length > 0) {
        if (imageName.includes('*')) {
            Process.enumerateModules().filter(item => item.name.includes(imageName.replace('*', ''))).forEach(i => (iteratorName(i)));
        }
        else {
            iteratorName(Process.findModuleByName(imageName));
        }
    }
    else if (imageName != undefined && imageName != "") {
        iteratorName(Process.findModuleByName(imageName));
    }
    else {
        Process.enumerateModules().forEach(iteratorName);
    }
    function iteratorName(md) {
        if (md == null)
            throw new Error('Module can not be null ...');
        const syms = md.enumerateSymbols();
        const filterSyms = syms.map(item => { return { msd: item, demangeName: demangleName(item.name), rva: item.address.sub(md.base) }; })
            .filter(item => item.demangeName.includes(filterName) || item.msd.name.includes(filterName))
            .filter(item => onlyFunction ? item.msd.type == 'function' : true)
            .filter(item => !item.msd.address.isNull());
        if (filterSyms.length == 0)
            return;
        logw(`Found { ${filterSyms.length} / ${syms.length} } in '${md.path}'\n`);
        filterSyms.forEach((item, index) => {
            logd(`[${index}] \t${item.msd.address} -> \t${item.msd.name}`);
            if (item.demangeName.length != 0)
                logz(`\t\t\t${item.demangeName} | ${item.rva}`);
        });
        newLine();
    }
};
globalThis.sleep = (sec) => new NativeFunction(DebugSymbol.fromName("sleep").address, 'pointer', ['int'])(sec);
const _getAddr__mod_init_func = (sectionName = "__mod_init_func", moduleName = Process.mainModule.name) => {
    return Process.getModuleByName(moduleName).enumerateSections().find(item => item.name.includes(sectionName));
};
globalThis.saveFile = (start, size, fileName = `/tmp/${Date.now()}`) => {
    if (start == null || start == undefined || start == 0)
        throw new Error("start Address can not be null");
    if (size == null || size == undefined || size == 0)
        throw new Error("size can not be null");
    const file = new File(fileName, "wb");
    const startPtr = start instanceof NativePointer ? start : ptr(start);
    file.write(startPtr.readByteArray(size));
    logd(`MEM ${start} -> ${size} has been saved to ${fileName}`);
};
globalThis.saveModule = (mdName) => {
    if (mdName == null || mdName == undefined || mdName.length == 0)
        throw new Error("mdName can not be null");
    const module = Process.findModuleByName(mdName);
    if (module == null)
        throw new Error("Module not found");
    saveFile(module.base, module.size, `/tmp/${module.name}`);
};
globalThis.listModules = (filterName) => {
    if (filterName == undefined) {
        Process.enumerateModules().forEach(item => logd(JSON.stringify(item)));
    }
    else {
        Process.enumerateModules().filter(i => i.name.includes(filterName)).forEach(item => logd(JSON.stringify(item)));
    }
};
// ObjC.classes["NIMSDK"]["- registerWithOption:"]
globalThis.trace = (cls = "NIMSDK", func = "- registerWithOption:", filterlib = "AcmeisApp.app") => {
    Interceptor.attach(ObjC.classes[cls][func].implementation, {
        onEnter(args) {
            const instance = new ObjC.Object(args[0]);
            const sel = ObjC.selectorAsString(args[1]);
            this.msg = `${cls} ${func} ${instance} ${sel}`;
            logw(`\nCalled -> ${this.msg}`);
            const tid = Process.getCurrentThreadId();
            logw(`\nThread ID: ${tid}`);
            const mdmap = new ModuleMap(item => item.path.includes(filterlib));
            logd("↓ Stalker trace ↓\n");
            Stalker.follow(tid, {
                events: {
                    call: true,
                    ret: true
                },
                onReceive: function (events) {
                    const bbs = Stalker.parse(events, {
                        stringify: false,
                        annotate: false
                    });
                    let msg = bbs.flat()
                        .map(item => ptr(item))
                        .filter(item => mdmap.has(item))
                        .map(item => DebugSymbol.fromAddress(item))
                        .map(item => `${item} ${item.address}`)
                        .join('\n');
                    logd(msg);
                }
            });
        },
        onLeave: function (retval) {
            logd("onLeave");
            Stalker.unfollow();
        }
    });
};
// usesage => choose("SBTelephonyManager")
globalThis.choose = (className, callBack) => {
    if (typeof className == "string") {
        var cls = ObjC.classes[className];
    }
    else if (className instanceof ObjC.Object) {
        var cls = className;
    }
    else if (typeof className == "number") {
        if (ObjC.api.object_isClass(ptr(className))) {
            var cls = new ObjC.Object(ptr(className));
        }
        else {
            var cls = new ObjC.Object(ptr(className)).$class;
        }
    }
    else if (className instanceof NativePointer) {
        var cls = new ObjC.Object(className);
    }
    else
        throw new Error(`className must be string | ObjC.Object | number | NativePointer`);
    log('\n');
    if (cls == null)
        throw new Error(`Class '${className}' not found`);
    ObjC.chooseSync(cls).forEach((item, index) => {
        try {
            if (callBack == undefined) {
                let dis = item.toString();
                if (!dis.includes(item.handle.toString()))
                    dis = `${item.handle} -> ${dis}`;
                logd(`[ ${index} ] ${dis}\n`);
            }
            else
                callBack(item);
        }
        catch (e) {
            logw(e);
        }
    });
};
// oc print stack 
// if use ObjC.implement to hook, you can use this
export function printObjcStackTrace(message = "Current Objective-C Stack Trace") {
    try {
        const NSThread = ObjC.classes.NSThread;
        if (!NSThread) {
            loge("[Frida] NSThread class not found. Cannot print Objective-C stack trace.");
            return;
        }
        const callStackSymbols = NSThread.callStackSymbols();
        logw(`\n--- ${message} ---`);
        for (let i = 0; i < callStackSymbols.count(); i++) {
            const symbol = callStackSymbols.objectAtIndex_(i);
            logz(`  ${symbol.toString()}`);
        }
        logz("-------------------------------------------\n");
    }
    catch (e) {
        loge(`[Frida] Error printing Objective-C stack trace: ${e}`);
    }
}
export var HK_TYPE;
(function (HK_TYPE) {
    HK_TYPE[HK_TYPE["FRIDA_ATTACH"] = 0] = "FRIDA_ATTACH";
    HK_TYPE[HK_TYPE["FRIDA_REP"] = 1] = "FRIDA_REP";
    HK_TYPE[HK_TYPE["OBJC_REP"] = 2] = "OBJC_REP";
})(HK_TYPE || (HK_TYPE = {}));
globalThis.d = detachAll;
globalThis.A = attachNative;
globalThis.n = nopFunction;
globalThis.nn = cancelNop;
globalThis.nnn = cancelAllNopedFunction;
globalThis.D = () => { d(); nnn(); };
globalThis.stk = stk;