Skip to content

Commit cece2c6

Browse files
author
Rajiv Subrahmanyam
committed
#554: If %ProgramFiles% resolves to C:\Program Files (x86), we should still yield C:\Program Files
1 parent a18f2d6 commit cece2c6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ Thumbs.db
2424
# Ignore development files
2525
docs/book/src/_build/
2626
.idea/
27+
.project
28+
.pydevproject
2729

2830
# Ignore Django secret_key
2931
web/web/secret_key.py
3032

3133
# Ignore yara rules
3234
data/yara/index_*.yar
35+
36+
# Ignore venv
37+
venv

analyzer/windows/lib/common/abstracts.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def _enum_paths(self):
3939
if basedir == "SystemRoot":
4040
yield os.path.join(os.getenv("SystemRoot"), *path[1:])
4141
elif basedir == "ProgramFiles":
42-
yield os.path.join(os.getenv("ProgramFiles"), *path[1:])
42+
program_files = os.getenv("ProgramFiles")
43+
yield os.path.join(program_files, *path[1:])
44+
if program_files.lower().endswith(' (x86)'):
45+
yield os.path.join(program_files[:-6], *path[1:])
4346
if os.getenv("ProgramFiles(x86)"):
4447
yield os.path.join(os.getenv("ProgramFiles(x86)"),
4548
*path[1:])

0 commit comments

Comments
 (0)