def find_apple_crash_report_referenced_images(binary_images, threads):
 image_map = {}
 for image in binary_images:
  image_map[image['image_addr']] = image['uuid']
 to_load = set()
 for thread in threads:
  if ('backtrace' not in thread):
   continue
  for frame in thread['backtrace']['contents']:
   img_uuid = image_map.get(frame['object_addr'])
   if (img_uuid is not None):
    to_load.add(img_uuid)
 return list(to_load)

def find_apple_crash_report_referenced_images ( binary_images , threads ) : image_map = { } for image in binary_images : image_map [ image [ 'image_addr' ] ] = image [ 'uuid' ] to_load = set ( ) for thread in threads : if ( 'backtrace' not in thread ) : continue for frame in thread [ 'backtrace' ] [ 'contents' ] : img_uuid = image_map . get ( frame [ 'object_addr' ] ) if ( img_uuid is not None ) : to_load . add ( img_uuid ) return list ( to_load )
given some binary images from an apple crash report and a thread list this returns a list of image uuids to load .