#NEWLINE# def _get_arch( self , macho , macho_end ) : #NEWLINE# #INDENT# arch = { #NEWLINE# #INDENT# 'macho' : macho , #NEWLINE# 'macho_end' : macho_end , #NEWLINE# #UNINDENT# } #NEWLINE# arch [ 'cmds' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for cmd in macho . commands : #NEWLINE# #INDENT# name = cmd . cmd #NEWLINE# arch [ 'cmds' ] [ name ] = cmd #NEWLINE# #UNINDENT# if ( 'LC_CODE_SIGNATURE' in arch [ 'cmds' ] ) : #NEWLINE# #INDENT# arch [ 'lc_codesig' ] = arch [ 'cmds' ] [ 'LC_CODE_SIGNATURE' ] #NEWLINE# codesig_offset = ( arch [ 'macho' ] . macho_start + arch [ 'lc_codesig' ] . data . dataoff ) #NEWLINE# self . f . seek ( codesig_offset ) #NEWLINE# codesig_data = self . f . read ( arch [ 'lc_codesig' ] . data . datasize ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . info ( 'signing from scratch!' ) #NEWLINE# entitlements_file = '/Users/neilk/projects/ios-apps/unsigned_entitlements.plist' #NEWLINE# codesig_data = make_signature ( macho , macho_end , arch [ 'cmds' ] , self . f , self ) #NEWLINE# arch [ 'lc_codesig' ] = arch [ 'cmds' ] [ 'LC_CODE_SIGNATURE' ] #NEWLINE# #UNINDENT# arch [ 'codesig' ] = Codesig ( self , codesig_data ) #NEWLINE# arch [ 'codesig_len' ] = len ( codesig_data ) #NEWLINE# return arch