MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / imports

Method imports

windows/pe_parse.py:436–453  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

get_stringFunction · 0.85
get_INTMethod · 0.80
get_IATMethod · 0.80

Tested by

no test coverage detected