Skip to content

Commit 9fcb0a7

Browse files
committed
Removed more Ruff warnings.
1 parent 841979c commit 9fcb0a7

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

winappdbg/process.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4788,8 +4788,3 @@ def _notify_exit_process(self, event):
47884788
if dwProcessId in self.__processDict:
47894789
self._del_process(dwProcessId)
47904790
return True
4791-
4792-
4793-
4794-
4795-

winappdbg/tools/pstrings.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,48 +51,48 @@ def main():
5151
%(prog)s notepad.exe
5252
%(prog)s 1234 --min-length 8 --encoding ascii
5353
%(prog)s chrome.exe -v --limit 100
54-
"""
54+
""",
5555
)
5656

5757
parser.add_argument(
58-
"target",
59-
help="Process ID (PID) or process name to extract strings from"
58+
"target", help="Process ID (PID) or process name to extract strings from"
6059
)
6160

6261
parser.add_argument(
63-
"--min-length", "-n",
62+
"--min-length",
63+
"-n",
6464
type=int,
6565
default=4,
6666
metavar="N",
67-
help="Minimum string length in characters (default: 4)"
67+
help="Minimum string length in characters (default: 4)",
6868
)
6969

7070
parser.add_argument(
71-
"--encoding", "-e",
71+
"--encoding",
72+
"-e",
7273
choices=["ascii", "unicode", "both"],
7374
default="both",
74-
help="Encoding type: ascii, unicode, or both (default: both)"
75+
help="Encoding type: ascii, unicode, or both (default: both)",
7576
)
7677

7778
parser.add_argument(
78-
"--limit", "-l",
79-
type=int,
80-
metavar="N",
81-
help="Limit output to first N strings"
79+
"--limit", "-l", type=int, metavar="N", help="Limit output to first N strings"
8280
)
8381

8482
# Verbose/quiet mode
8583
output_group = parser.add_mutually_exclusive_group()
8684
output_group.add_argument(
87-
"--verbose", "-v",
85+
"--verbose",
86+
"-v",
8887
action="store_true",
89-
help="Verbose output with headers and statistics"
88+
help="Verbose output with headers and statistics",
9089
)
9190
output_group.add_argument(
92-
"--quiet", "-q",
91+
"--quiet",
92+
"-q",
9393
action="store_true",
9494
default=True,
95-
help="Quiet output, only addresses and strings (default)"
95+
help="Quiet output, only addresses and strings (default)",
9696
)
9797

9898
args = parser.parse_args()
@@ -125,7 +125,9 @@ def main():
125125
print(f"Error: Process '{args.target}' not found", file=sys.stderr)
126126
return 1
127127
if len(found) > 1:
128-
print(f"Error: Multiple processes found for '{args.target}'", file=sys.stderr)
128+
print(
129+
f"Error: Multiple processes found for '{args.target}'", file=sys.stderr
130+
)
129131
print("Please specify one of the following PIDs:", file=sys.stderr)
130132
for process, filename in found:
131133
print(f" {process.get_pid()}: {filename}", file=sys.stderr)
@@ -179,6 +181,7 @@ def main():
179181
print(f"\nError during string extraction: {e}", file=sys.stderr)
180182
if args.verbose:
181183
import traceback
184+
182185
traceback.print_exc()
183186
return 1
184187

winappdbg/win32/kernel32.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
NTDDI_VISTA,
102102
GetCurrentProcess,
103103
GetCurrentThread,
104-
GetModuleHandle,
105-
GetModuleHandleA,
106-
GetModuleHandleW,
104+
GetModuleHandle, # noqa: F401
105+
GetModuleHandleA, # noqa: F401
106+
GetModuleHandleW, # noqa: F401
107107
arch,
108108
)
109109

0 commit comments

Comments
 (0)