-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
118b9d3
commit 8ac05ba
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import PySide6.QtWidgets as QtWidgets | ||
|
||
from .. import pe_file | ||
from .components import table | ||
|
||
|
||
class LibrariesView(QtWidgets.QWidget): | ||
class LibrariesView(QtWidgets.QScrollArea): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
# Set up scroll area | ||
self.setWidgetResizable(True) | ||
self.scroll_area = QtWidgets.QWidget(self) | ||
self.setWidget(self.scroll_area) | ||
self.scroll_area.setLayout(QtWidgets.QFormLayout()) | ||
|
||
# Libraries | ||
self.libraries_group = table.TableGroup( | ||
"Libraries", fit_columns=True, headers=["Name", "Imports"]) | ||
self.scroll_area.layout().addWidget(self.libraries_group) | ||
|
||
def load(self, pe_obj: pe_file.PEFile): | ||
... | ||
# Libraries | ||
libraries_list = [] | ||
for i, import_obj in enumerate(pe_obj.pe.DIRECTORY_ENTRY_IMPORT): | ||
libraries_list.append(( | ||
import_obj.dll.decode("utf-8").strip('\x00'), | ||
len(import_obj.imports), | ||
)) | ||
|
||
self.libraries_group.view.setModel(table.TableModel( | ||
libraries_list, headers=["Name", "Imports"])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters