Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
binwalk
Commits
a823ab6c
Commit
a823ab6c
authored
Jun 21, 2016
by
devttys0
Committed by
GitHub
Jun 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #206 from Lekensteyn/magic-fixes
Ignore dotfiles when discovering magic files
parents
2051757c
d013b42a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
settings.py
src/binwalk/core/settings.py
+6
-2
No files found.
src/binwalk/core/settings.py
View file @
a823ab6c
...
...
@@ -65,12 +65,16 @@ class Settings:
user_binarch
=
self
.
_user_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINARCH_MAGIC_FILE
)
system_binarch
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINARCH_MAGIC_FILE
)
def
list_files
(
dir_path
):
# Ignore hidden dotfiles.
return
[
os
.
path
.
join
(
dir_path
,
x
)
for
x
in
os
.
listdir
(
dir_path
)
if
not
x
.
startswith
(
'.'
)]
if
not
system_only
:
user_dir
=
os
.
path
.
join
(
self
.
user_dir
,
self
.
BINWALK_USER_DIR
,
self
.
BINWALK_MAGIC_DIR
)
files
+=
[
os
.
path
.
join
(
user_dir
,
x
)
for
x
in
os
.
listdir
(
user_dir
)]
files
+=
list_files
(
user_dir
)
if
not
user_only
:
system_dir
=
os
.
path
.
join
(
self
.
system_dir
,
self
.
BINWALK_MAGIC_DIR
)
files
+=
[
os
.
path
.
join
(
system_dir
,
x
)
for
x
in
os
.
listdir
(
system_dir
)]
files
+=
list_files
(
system_dir
)
# Don't include binarch signatures in the default list of signature files.
# It is specifically loaded when -A is specified on the command line.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment