From 84115b6f86e572142aa98eba518737806240ef1f Mon Sep 17 00:00:00 2001 From: JeanExtreme002 Date: Thu, 4 Jun 2026 23:30:59 -0300 Subject: [PATCH] feat: lower default pointer-scan depth to 3 and relocate count label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lower the default max_depth from 5 to 3 across the scan API, the abstract process, and the dialog spin box — shallower scans are far faster and cover the common case. Move the result count label to its own row below the action buttons so it no longer competes for space in the button row. --- PyMemoryEditor/app/pointer_scan_dialog.py | 10 +++++----- PyMemoryEditor/process/abstract.py | 4 ++-- PyMemoryEditor/process/pointer_scan.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PyMemoryEditor/app/pointer_scan_dialog.py b/PyMemoryEditor/app/pointer_scan_dialog.py index 150b643..ea4fe35 100644 --- a/PyMemoryEditor/app/pointer_scan_dialog.py +++ b/PyMemoryEditor/app/pointer_scan_dialog.py @@ -369,7 +369,7 @@ def _build_ui(self) -> None: self._depth_spin = QSpinBox() self._depth_spin.setRange(1, 12) - self._depth_spin.setValue(5) + self._depth_spin.setValue(3) self._depth_spin.setToolTip( "Maximum pointer levels (offsets) in a chain. Deeper finds more " "paths but costs exponentially more time." @@ -487,10 +487,6 @@ def _build_ui(self) -> None: button_row.addStretch(1) - self._count_label = QLabel("") - self._count_label.setObjectName("hint") - button_row.addWidget(self._count_label) - close_btn = QPushButton("Close") close_btn.setStyleSheet(_equal_height) close_btn.clicked.connect(self.accept) @@ -498,6 +494,10 @@ def _build_ui(self) -> None: layout.addLayout(button_row) + self._count_label = QLabel("") + self._count_label.setObjectName("hint") + layout.addWidget(self._count_label) + self._progress = QProgressBar() self._progress.setRange(0, 100) self._progress.setValue(0) diff --git a/PyMemoryEditor/process/abstract.py b/PyMemoryEditor/process/abstract.py index 2dcb2c7..883496f 100644 --- a/PyMemoryEditor/process/abstract.py +++ b/PyMemoryEditor/process/abstract.py @@ -776,7 +776,7 @@ def scan_pointer_paths( self, target_address: int, *, - max_depth: int = 5, + max_depth: int = 3, max_offset: int = 0x400, ptr_size: Optional[int] = None, aligned: bool = True, @@ -836,7 +836,7 @@ def scan_pointer_paths( :: hp_addr = next(process.search_by_value(int, 4, 1234)) - for path in process.scan_pointer_paths(hp_addr, max_depth=5, max_results=20): + for path in process.scan_pointer_paths(hp_addr, max_depth=3, max_results=20): print(path) # "game.exe"+0x10F4F4 -> [+0x0] -> +0x158 assert path.resolve(process) == hp_addr diff --git a/PyMemoryEditor/process/pointer_scan.py b/PyMemoryEditor/process/pointer_scan.py index a7e7e5a..886ef64 100644 --- a/PyMemoryEditor/process/pointer_scan.py +++ b/PyMemoryEditor/process/pointer_scan.py @@ -346,7 +346,7 @@ def find_pointer_paths( is_static: Callable[[int], bool], module_resolver: Callable[[int], Optional[Tuple[str, int]]], *, - max_depth: int = 5, + max_depth: int = 3, max_offset: int = 0x400, ptr_size: int = 8, max_results: Optional[int] = None,