The imports of the PE in a dict. Keys are the names of DLL to import from and values are :class:`list` of :class:`IATEntry` :type: {:class:`str` : [:class:`IATEntry`]}
(self)
| 434 | # TODO: get imports by parsing other modules exports if no INT |
| 435 | @utils.fixedpropety |
| 436 | def imports(self): |
| 437 | """The imports of the PE in a dict. |
| 438 | Keys are the names of DLL to import from and values are :class:`list` |
| 439 | of :class:`IATEntry` |
| 440 | |
| 441 | :type: {:class:`str` : [:class:`IATEntry`]}""" |
| 442 | res = {} |
| 443 | for import_descriptor in self.get_IMPORT_DESCRIPTORS(): |
| 444 | INT = import_descriptor.get_INT(self) |
| 445 | IAT = import_descriptor.get_IAT(self) |
| 446 | if INT is not None: |
| 447 | for iat_entry, (ord, name) in zip(IAT, INT): |
| 448 | # str(name.decode()) -> python2 and python3 compatible for str result |
| 449 | iat_entry.ord = ord |
| 450 | iat_entry.name = str(name) if name else "" |
| 451 | name = get_string(self.target, self.baseaddr + import_descriptor.Name) |
| 452 | res.setdefault(name.lower(), []).extend(IAT) |
| 453 | return res |
nothing calls this directly
no test coverage detected