File tree Expand file tree Collapse file tree 1 file changed +35
-26
lines changed
Expand file tree Collapse file tree 1 file changed +35
-26
lines changed Original file line number Diff line number Diff line change @@ -844,36 +844,45 @@ def _symbols(self) -> Generator[Symbol]:
844844 imported = True ,
845845 )
846846 elif isinstance (head , lief .MachO .Binary ):
847- for binding in head .dyld_chained_fixups .bindings :
848- name = binding .symbol .demangled_name or binding .symbol .name
849- name = self .ascii (name )
850- addr = self .rebase_img_to_usr (binding .address )
851- imports_done .add (name )
852- yield Symbol (
853- addr ,
854- name ,
855- ps ,
856- function = True ,
857- exported = False ,
858- imported = True ,
859- )
847+ for dlyd in (
848+ head .dyld_chained_fixups ,
849+ head .dyld_info ,
850+ ):
851+ if not dlyd :
852+ continue
853+ for binding in dlyd .bindings :
854+ name = binding .symbol .demangled_name or binding .symbol .name
855+ name = self .ascii (name )
856+ addr = self .rebase_img_to_usr (binding .address )
857+ imports_done .add (name )
858+ yield Symbol (
859+ addr ,
860+ name ,
861+ ps ,
862+ function = True ,
863+ exported = False ,
864+ imported = True ,
865+ )
860866 elif isinstance (head , lief .ELF .Binary ):
861- for binding in itertools . chain (
867+ for bindings in (
862868 head .pltgot_relocations ,
863869 head .dynamic_relocations ,
864870 ):
865- name = binding .symbol .demangled_name or binding .symbol .name
866- name = self .ascii (name )
867- addr = self .rebase_img_to_usr (binding .address )
868- imports_done .add (name )
869- yield Symbol (
870- addr ,
871- name ,
872- ps ,
873- function = True ,
874- exported = False ,
875- imported = True ,
876- )
871+ if not bindings :
872+ continue
873+ for binding in bindings :
874+ name = binding .symbol .demangled_name or binding .symbol .name
875+ name = self .ascii (name )
876+ addr = self .rebase_img_to_usr (binding .address )
877+ imports_done .add (name )
878+ yield Symbol (
879+ addr ,
880+ name ,
881+ ps ,
882+ function = True ,
883+ exported = False ,
884+ imported = True ,
885+ )
877886
878887 for symbol in it :
879888 addr = self .rebase_img_to_usr (value := symbol .value )
You can’t perform that action at this time.
0 commit comments