hook系统__NSCFDictionary 的objectForKey 函数的时候崩溃,求解决思路


#1
  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2)
    frame #0: 0x000000018346c198 libobjc.A.dylibobjc_retain + 8
    frame #1: 0x000000018346c218 libobjc.A.dylib
    objc_storeStrong + 44
    • frame #2: 0x0000000106c0f624 libMonkeyPodDylib.dylib$__NSCFDictionary_objectForKey$_method(self=0x00000001c3672040, _cmd="objectForKey:", aKey=0x0000000000000000) at MonkeyPodDylib.m:111
      frame #3: 0x00000001841462d8 CoreFoundation
      -[__NSDictionaryObjectEnumerator nextObject] + 92
      frame #4: 0x00000001840fc84c CoreFoundation-[NSEnumerator countByEnumeratingWithState:objects:count:] + 60
      frame #5: 0x00000001841464c4 CoreFoundation
      -[NSEnumerator allObjects] + 124
      frame #6: 0x000000018e03ccec UIKit__updateTouchesWithDigitizerEventAndDetermineIfShouldSend + 792
      frame #7: 0x000000018e040d04 UIKit
      __dispatchPreprocessedEventFromEventQueue + 804
      frame #8: 0x000000018e0438a8 UIKit__handleEventQueueInternal + 4760
      frame #9: 0x000000018e03c7c0 UIKit
      __handleHIDEventFetcherDrain + 152
      frame #10: 0x00000001841b297c CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
      frame #11: 0x00000001841b28fc CoreFoundation
      __CFRunLoopDoSource0 + 88
      frame #12: 0x00000001841b2184 CoreFoundation__CFRunLoopDoSources0 + 204
      frame #13: 0x00000001841afd5c CoreFoundation
      __CFRunLoopRun + 1048
      frame #14: 0x00000001840cfe58 CoreFoundationCFRunLoopRunSpecific + 436
      frame #15: 0x0000000185f7cf84 GraphicsServices
      GSEventRunModal + 100
      frame #16: 0x000000018d74f67c UIKit`UIApplicationMain + 236

#2

iOS10好像是好的 iOS11就成这样了