def __init__(self, *args, **kwargs):
self.metadata = kwargs.pop("metadata", {})
super(ParsePDB, self).__init__(*args, **kwargs)
profile_class = self.metadata.get(
"ProfileClass", self.plugin_args.profile_class)
# By default select the class with the same name as the pdb file.
if profile_class is None:
profile_class = os.path.splitext(
os.path.basename(self.plugin_args.pdb_filename))[0].capitalize()
if profile_class not in obj.Profile.classes:
profile_class = "BasicPEProfile"
self.plugin_args.profile_class = profile_class
versions = []
if self.plugin_args.windows_version is not None:
versions = self.plugin_args.windows_version.split(".", 2)
for i, metadata in enumerate(["major", "minor", "rev"]):
try:
self.metadata[metadata] = versions[i]
except IndexError:
break
self.tpi = PDBParser(self.plugin_args.pdb_filename, self.session)
评论列表
文章目录