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
5ce83d5a
Commit
5ce83d5a
authored
Dec 20, 2013
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional directory restructuring.
parent
e9d9055a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
15 deletions
+16
-15
extract.conf
src/binwalk/config/extract.conf
+0
-0
__init__.py
src/binwalk/core/__init__.py
+0
-0
config.py
src/binwalk/core/config.py
+2
-2
module.py
src/binwalk/core/module.py
+8
-8
binwalk
src/binwalk/magic/binwalk
+0
-0
configuration.py
src/binwalk/modules/configuration.py
+2
-1
lzmamod.py
src/binwalk/plugins/lzmamod.py
+1
-1
zlib.py
src/binwalk/plugins/zlib.py
+1
-1
setup.py
src/setup.py
+2
-2
No files found.
src/binwalk/config
s
/extract.conf
→
src/binwalk/config/extract.conf
View file @
5ce83d5a
File moved
src/binwalk/core/__init__.py
0 → 100644
View file @
5ce83d5a
src/binwalk/core/config.py
View file @
5ce83d5a
...
@@ -39,8 +39,8 @@ class Config:
...
@@ -39,8 +39,8 @@ class Config:
# Sub directories
# Sub directories
BINWALK_USER_DIR
=
".binwalk"
BINWALK_USER_DIR
=
".binwalk"
BINWALK_MAGIC_DIR
=
"magic
s
"
BINWALK_MAGIC_DIR
=
"magic"
BINWALK_CONFIG_DIR
=
"config
s
"
BINWALK_CONFIG_DIR
=
"config"
BINWALK_PLUGINS_DIR
=
"plugins"
BINWALK_PLUGINS_DIR
=
"plugins"
# File names
# File names
...
...
src/binwalk/core/module.py
View file @
5ce83d5a
...
@@ -120,7 +120,7 @@ class Module(object):
...
@@ -120,7 +120,7 @@ class Module(object):
# A list of binwalk.core.module.ModuleKwargs accepted by __init__
# A list of binwalk.core.module.ModuleKwargs accepted by __init__
KWARGS
=
[]
KWARGS
=
[]
# A dictionary of module dependencies; all modules depend on binwalk.
core.
modules.configuration.Configuration
# A dictionary of module dependencies; all modules depend on binwalk.modules.configuration.Configuration
DEPENDS
=
{
'config'
:
'Configuration'
,
'extractor'
:
'Extractor'
}
DEPENDS
=
{
'config'
:
'Configuration'
,
'extractor'
:
'Extractor'
}
# Format string for printing the header during a scan
# Format string for printing the header during a scan
...
@@ -395,10 +395,10 @@ class Modules(object):
...
@@ -395,10 +395,10 @@ class Modules(object):
Returns a list of modules that contain the specified attribute.
Returns a list of modules that contain the specified attribute.
'''
'''
import
binwalk.
core.
modules
import
binwalk.modules
modules
=
[]
modules
=
[]
for
(
name
,
module
)
in
inspect
.
getmembers
(
binwalk
.
core
.
modules
):
for
(
name
,
module
)
in
inspect
.
getmembers
(
binwalk
.
modules
):
if
inspect
.
isclass
(
module
)
and
hasattr
(
module
,
attribute
):
if
inspect
.
isclass
(
module
)
and
hasattr
(
module
,
attribute
):
modules
.
append
(
module
)
modules
.
append
(
module
)
...
@@ -469,17 +469,17 @@ class Modules(object):
...
@@ -469,17 +469,17 @@ class Modules(object):
return
module
(
**
kwargs
)
return
module
(
**
kwargs
)
def
dependencies
(
self
,
module
):
def
dependencies
(
self
,
module
):
import
binwalk.
core.
modules
import
binwalk.modules
kwargs
=
{}
kwargs
=
{}
if
hasattr
(
module
,
"DEPENDS"
):
if
hasattr
(
module
,
"DEPENDS"
):
for
(
kwarg
,
dependency
)
in
iterator
(
module
.
DEPENDS
):
for
(
kwarg
,
dependency
)
in
iterator
(
module
.
DEPENDS
):
# The dependency module must be imported by binwalk.
core.
modules.__init__.py
# The dependency module must be imported by binwalk.modules.__init__.py
if
hasattr
(
binwalk
.
core
.
modules
,
dependency
):
if
hasattr
(
binwalk
.
modules
,
dependency
):
dependency
=
getattr
(
binwalk
.
core
.
modules
,
dependency
)
dependency
=
getattr
(
binwalk
.
modules
,
dependency
)
else
:
else
:
sys
.
stderr
.
write
(
"WARNING:
%
s depends on
%
s which was not found in binwalk.
core.
modules.__init__.py
\n
"
%
(
str
(
module
),
dependency
))
sys
.
stderr
.
write
(
"WARNING:
%
s depends on
%
s which was not found in binwalk.modules.__init__.py
\n
"
%
(
str
(
module
),
dependency
))
continue
continue
# No recursive dependencies, thanks
# No recursive dependencies, thanks
...
...
src/binwalk/magic
s
/binwalk
→
src/binwalk/magic/binwalk
View file @
5ce83d5a
File moved
src/binwalk/modules/configuration.py
View file @
5ce83d5a
...
@@ -8,7 +8,7 @@ from binwalk.core.config import *
...
@@ -8,7 +8,7 @@ from binwalk.core.config import *
from
binwalk.core.compat
import
*
from
binwalk.core.compat
import
*
from
binwalk.core.module
import
Module
,
Option
,
Kwarg
,
show_help
from
binwalk.core.module
import
Module
,
Option
,
Kwarg
,
show_help
class
Configuration
():
class
Configuration
(
Module
):
TITLE
=
"General"
TITLE
=
"General"
...
@@ -108,6 +108,7 @@ class Configuration():
...
@@ -108,6 +108,7 @@ class Configuration():
return
self
return
self
def
_cleanup
(
self
):
def
_cleanup
(
self
):
if
hasattr
(
self
,
'target_files'
):
for
fp
in
self
.
target_files
:
for
fp
in
self
.
target_files
:
fp
.
close
()
fp
.
close
()
...
...
src/binwalk/plugins/lzmamod.py
View file @
5ce83d5a
...
@@ -19,7 +19,7 @@ class Plugin:
...
@@ -19,7 +19,7 @@ class Plugin:
if
self
.
enabled
:
if
self
.
enabled
:
# Replace the existing LZMA extraction command with our own
# Replace the existing LZMA extraction command with our own
rules
=
self
.
extractor
.
get_rules
()
rules
=
self
.
module
.
extractor
.
get_rules
()
for
i
in
range
(
0
,
len
(
rules
)):
for
i
in
range
(
0
,
len
(
rules
)):
if
rules
[
i
][
'regex'
]
.
match
(
self
.
SIGNATURE
):
if
rules
[
i
][
'regex'
]
.
match
(
self
.
SIGNATURE
):
self
.
original_cmd
=
rules
[
i
][
'cmd'
]
self
.
original_cmd
=
rules
[
i
][
'cmd'
]
...
...
src/binwalk/plugins/zlib.py
View file @
5ce83d5a
import
ctypes
import
ctypes
import
ctypes.util
import
ctypes.util
from
binwalk.common
import
BlockFile
from
binwalk.co
re.co
mmon
import
BlockFile
class
Plugin
:
class
Plugin
:
'''
'''
...
...
src/setup.py
View file @
5ce83d5a
...
@@ -97,7 +97,7 @@ os.chdir(working_directory)
...
@@ -97,7 +97,7 @@ os.chdir(working_directory)
print
(
"generating binwalk magic file"
)
print
(
"generating binwalk magic file"
)
magic_files
=
listdir
(
"magic"
)
magic_files
=
listdir
(
"magic"
)
magic_files
.
sort
()
magic_files
.
sort
()
fd
=
open
(
"binwalk/magic
s
/binwalk"
,
"wb"
)
fd
=
open
(
"binwalk/magic/binwalk"
,
"wb"
)
for
magic
in
magic_files
:
for
magic
in
magic_files
:
fpath
=
path
.
join
(
"magic"
,
magic
)
fpath
=
path
.
join
(
"magic"
,
magic
)
if
path
.
isfile
(
fpath
):
if
path
.
isfile
(
fpath
):
...
@@ -105,7 +105,7 @@ for magic in magic_files:
...
@@ -105,7 +105,7 @@ for magic in magic_files:
fd
.
close
()
fd
.
close
()
# The data files to install along with the binwalk module
# The data files to install along with the binwalk module
install_data_files
=
[
"magic
s/*"
,
"configs/*"
,
"plugins/*"
,
"modules
/*"
]
install_data_files
=
[
"magic
/*"
,
"config/*"
,
"plugins/*"
,
"modules/*"
,
"core
/*"
]
# Install the binwalk module, script and support files
# Install the binwalk module, script and support files
setup
(
name
=
"binwalk"
,
setup
(
name
=
"binwalk"
,
...
...
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