#NEWLINE# def fix_deps( self , prefix ) : #NEWLINE# #INDENT# sec = self . find_section ( b'.dynstr' ) #NEWLINE# deps = [ ] #NEWLINE# for i in self . dynamic : #NEWLINE# #INDENT# if ( i . d_tag == DT_NEEDED ) : #NEWLINE# #INDENT# deps . append ( i ) #NEWLINE# #UNINDENT# #UNINDENT# for i in deps : #NEWLINE# #INDENT# offset = ( sec . sh_offset + i . val ) #NEWLINE# self . bf . seek ( offset ) #NEWLINE# name = self . read_str ( ) #NEWLINE# if name . startswith ( prefix ) : #NEWLINE# #INDENT# basename = name . split ( b'/' ) [ ( - 1 ) ] #NEWLINE# padding = ( b'\x00' * ( len ( name ) - len ( sec ) ) ) #NEWLINE# newname = ( basename + padding ) #NEWLINE# assert ( len ( newname ) == len ( name ) ) #NEWLINE# self . bf . seek ( offset ) #NEWLINE# self . bf . write ( newname )