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
4989aba0
Commit
4989aba0
authored
Nov 15, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update.py now fetches updates from github.
parent
feb152b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
binwalk
src/bin/binwalk
+3
-1
config.py
src/binwalk/config.py
+5
-1
update.py
src/binwalk/update.py
+19
-2
No files found.
src/bin/binwalk
View file @
4989aba0
...
@@ -390,9 +390,11 @@ def main():
...
@@ -390,9 +390,11 @@ def main():
elif
opt
in
(
"-u"
,
"--update"
):
elif
opt
in
(
"-u"
,
"--update"
):
try
:
try
:
sys
.
stdout
.
write
(
"Updating signatures..."
)
sys
.
stdout
.
write
(
"Updating signatures..."
)
if
verbose
:
sys
.
stdout
.
write
(
"
\n
"
)
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
binwalk
.
Update
()
.
update
()
binwalk
.
Update
(
verbose
)
.
update
()
sys
.
stdout
.
write
(
"done.
\n
"
)
sys
.
stdout
.
write
(
"done.
\n
"
)
sys
.
exit
(
0
)
sys
.
exit
(
0
)
...
...
src/binwalk/config.py
View file @
4989aba0
...
@@ -48,7 +48,9 @@ class Config:
...
@@ -48,7 +48,9 @@ class Config:
BINWALK_MAGIC_FILE
=
"binwalk"
BINWALK_MAGIC_FILE
=
"binwalk"
BINCAST_MAGIC_FILE
=
"bincast"
BINCAST_MAGIC_FILE
=
"bincast"
BINARCH_MAGIC_FILE
=
"binarch"
BINARCH_MAGIC_FILE
=
"binarch"
ZLIB_MAGIC_FILE
=
"zlib"
COMPRESSD_MAGIC_FILE
=
"compressd"
def
__init__
(
self
):
def
__init__
(
self
):
'''
'''
Class constructor. Enumerates file paths and populates self.paths.
Class constructor. Enumerates file paths and populates self.paths.
...
@@ -75,6 +77,8 @@ class Config:
...
@@ -75,6 +77,8 @@ class Config:
self
.
paths
[
'system'
][
self
.
BINWALK_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINWALK_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
BINWALK_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINWALK_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
BINCAST_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINCAST_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
BINCAST_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINCAST_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
BINARCH_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINARCH_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
BINARCH_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
BINARCH_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
ZLIB_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
ZLIB_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
COMPRESSD_MAGIC_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_MAGIC_DIR
,
self
.
COMPRESSD_MAGIC_FILE
)
self
.
paths
[
'system'
][
self
.
EXTRACT_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_CONFIG_DIR
,
self
.
EXTRACT_FILE
)
self
.
paths
[
'system'
][
self
.
EXTRACT_FILE
]
=
self
.
_system_path
(
self
.
BINWALK_CONFIG_DIR
,
self
.
EXTRACT_FILE
)
self
.
paths
[
'system'
][
self
.
PLUGINS
]
=
self
.
_system_path
(
self
.
BINWALK_PLUGINS_DIR
)
self
.
paths
[
'system'
][
self
.
PLUGINS
]
=
self
.
_system_path
(
self
.
BINWALK_PLUGINS_DIR
)
...
...
src/binwalk/update.py
View file @
4989aba0
...
@@ -12,14 +12,19 @@ class Update:
...
@@ -12,14 +12,19 @@ class Update:
Update().update()
Update().update()
'''
'''
BASE_URL
=
"http
://binwalk.googlecode.com/svn/trunk
/src/binwalk/"
BASE_URL
=
"http
s://raw.github.com/devttys0/binwalk/master
/src/binwalk/"
MAGIC_PREFIX
=
"magic/"
MAGIC_PREFIX
=
"magic/"
CONFIG_PREFIX
=
"config/"
CONFIG_PREFIX
=
"config/"
def
__init__
(
self
):
def
__init__
(
self
,
verbose
=
False
):
'''
'''
Class constructor.
Class constructor.
@verbose - Verbose flag.
Returns None.
'''
'''
self
.
verbose
=
verbose
self
.
config
=
Config
()
self
.
config
=
Config
()
def
update
(
self
):
def
update
(
self
):
...
@@ -33,6 +38,7 @@ class Update:
...
@@ -33,6 +38,7 @@ class Update:
self
.
update_binarch
()
self
.
update_binarch
()
self
.
update_extract
()
self
.
update_extract
()
self
.
update_zlib
()
self
.
update_zlib
()
self
.
update_compressd
()
def
_do_update_from_svn
(
self
,
prefix
,
fname
):
def
_do_update_from_svn
(
self
,
prefix
,
fname
):
'''
'''
...
@@ -54,6 +60,9 @@ class Update:
...
@@ -54,6 +60,9 @@ class Update:
url
=
self
.
BASE_URL
+
prefix
+
fname
url
=
self
.
BASE_URL
+
prefix
+
fname
try
:
try
:
if
self
.
verbose
:
print
"Fetching
%
s..."
%
url
data
=
urllib2
.
urlopen
(
url
)
.
read
()
data
=
urllib2
.
urlopen
(
url
)
.
read
()
open
(
self
.
config
.
paths
[
'system'
][
fname
],
"wb"
)
.
write
(
data
)
open
(
self
.
config
.
paths
[
'system'
][
fname
],
"wb"
)
.
write
(
data
)
except
Exception
,
e
:
except
Exception
,
e
:
...
@@ -91,6 +100,14 @@ class Update:
...
@@ -91,6 +100,14 @@ class Update:
'''
'''
self
.
_do_update_from_svn
(
self
.
MAGIC_PREFIX
,
self
.
config
.
ZLIB_MAGIC_FILE
)
self
.
_do_update_from_svn
(
self
.
MAGIC_PREFIX
,
self
.
config
.
ZLIB_MAGIC_FILE
)
def
update_compressd
(
self
):
'''
Updates the compress'd signature file.
Returns None.
'''
self
.
_do_update_from_svn
(
self
.
MAGIC_PREFIX
,
self
.
config
.
COMPRESSD_MAGIC_FILE
)
def
update_extract
(
self
):
def
update_extract
(
self
):
'''
'''
Updates the extract.conf file.
Updates the extract.conf file.
...
...
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