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-depend
binwalk
Commits
596489cc
Commit
596489cc
authored
Nov 23, 2015
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated status server output, currently only works with signature scans; added MPFS validation.
parent
7852904f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
module.py
src/binwalk/core/module.py
+6
-3
statuserver.py
src/binwalk/core/statuserver.py
+6
-4
filesystems
src/binwalk/magic/filesystems
+3
-0
No files found.
src/binwalk/core/module.py
View file @
596489cc
...
@@ -379,7 +379,7 @@ class Module(object):
...
@@ -379,7 +379,7 @@ class Module(object):
# Reset all dependencies prior to continuing with another file.
# Reset all dependencies prior to continuing with another file.
# This is particularly important for the extractor module, which must be reset
# This is particularly important for the extractor module, which must be reset
# in order to reset it
'
s base output directory path for each file, and the
# in order to reset its base output directory path for each file, and the
# list of pending files.
# list of pending files.
self
.
reset_dependencies
()
self
.
reset_dependencies
()
...
@@ -407,10 +407,12 @@ class Module(object):
...
@@ -407,10 +407,12 @@ class Module(object):
if
fp
is
not
None
:
if
fp
is
not
None
:
self
.
current_target_file_name
=
fp
.
path
self
.
current_target_file_name
=
fp
.
path
print
"self.status.fp =
%
s"
%
fp
.
path
self
.
status
.
fp
=
fp
self
.
status
.
fp
=
fp
else
:
else
:
self
.
current_target_file_name
=
None
self
.
current_target_file_name
=
None
self
.
status
.
fp
=
fp
print
"self.status.fp = None"
self
.
status
.
fp
=
None
self
.
previous_next_file_fp
=
fp
self
.
previous_next_file_fp
=
fp
...
@@ -462,6 +464,7 @@ class Module(object):
...
@@ -462,6 +464,7 @@ class Module(object):
if
r
.
offset
and
r
.
file
and
self
.
AUTO_UPDATE_STATUS
:
if
r
.
offset
and
r
.
file
and
self
.
AUTO_UPDATE_STATUS
:
self
.
status
.
total
=
r
.
file
.
length
self
.
status
.
total
=
r
.
file
.
length
self
.
status
.
completed
=
r
.
offset
self
.
status
.
completed
=
r
.
offset
self
.
status
.
fp
=
r
.
file
if
r
.
display
:
if
r
.
display
:
display_args
=
self
.
_build_display_args
(
r
)
display_args
=
self
.
_build_display_args
(
r
)
...
@@ -609,7 +612,7 @@ class Modules(object):
...
@@ -609,7 +612,7 @@ class Modules(object):
self
.
arguments
=
[]
self
.
arguments
=
[]
self
.
executed_modules
=
{}
self
.
executed_modules
=
{}
self
.
default_dependency_modules
=
{}
self
.
default_dependency_modules
=
{}
self
.
status
=
Status
(
completed
=
0
,
total
=
0
,
f
ile
=
None
)
self
.
status
=
Status
(
completed
=
0
,
total
=
0
,
f
p
=
None
)
self
.
status_server_started
=
False
self
.
status_server_started
=
False
self
.
status_service
=
None
self
.
status_service
=
None
...
...
src/binwalk/core/statuserver.py
View file @
596489cc
# Provides scan status information via a TCP socket service.
# Provides scan status information via a TCP socket service.
import
sys
import
time
import
time
import
threading
import
threading
import
SocketServer
import
SocketServer
...
@@ -7,7 +8,7 @@ import SocketServer
...
@@ -7,7 +8,7 @@ import SocketServer
class
StatusRequestHandler
(
SocketServer
.
BaseRequestHandler
):
class
StatusRequestHandler
(
SocketServer
.
BaseRequestHandler
):
def
handle
(
self
):
def
handle
(
self
):
message_format
=
'Binwalk scan progress:
%3
d
%%
Currently at byte
%
d of
%
d total bytes in file
%
s'
message_format
=
"
%
s
%3
d
%%
[
%
d /
%
d ]"
last_status_message_len
=
0
last_status_message_len
=
0
status_message
=
''
status_message
=
''
...
@@ -20,16 +21,17 @@ class StatusRequestHandler(SocketServer.BaseRequestHandler):
...
@@ -20,16 +21,17 @@ class StatusRequestHandler(SocketServer.BaseRequestHandler):
self
.
request
.
send
(
'
\b
'
*
last_status_message_len
)
self
.
request
.
send
(
'
\b
'
*
last_status_message_len
)
percentage
=
((
float
(
self
.
server
.
binwalk
.
status
.
completed
)
/
float
(
self
.
server
.
binwalk
.
status
.
total
))
*
100
)
percentage
=
((
float
(
self
.
server
.
binwalk
.
status
.
completed
)
/
float
(
self
.
server
.
binwalk
.
status
.
total
))
*
100
)
status_message
=
message_format
%
(
percentage
,
status_message
=
message_format
%
(
self
.
server
.
binwalk
.
status
.
fp
.
path
,
percentage
,
self
.
server
.
binwalk
.
status
.
completed
,
self
.
server
.
binwalk
.
status
.
completed
,
self
.
server
.
binwalk
.
status
.
total
,
self
.
server
.
binwalk
.
status
.
total
)
self
.
server
.
binwalk
.
status
.
fp
.
path
)
last_status_message_len
=
len
(
status_message
)
last_status_message_len
=
len
(
status_message
)
self
.
request
.
send
(
status_message
)
self
.
request
.
send
(
status_message
)
except
KeyboardInterrupt
as
e
:
except
KeyboardInterrupt
as
e
:
raise
e
raise
e
except
Exception
as
e
:
except
Exception
as
e
:
#sys.stderr.write(str(e) + "\n")
pass
pass
return
return
...
...
src/binwalk/magic/filesystems
100755 → 100644
View file @
596489cc
...
@@ -68,8 +68,11 @@
...
@@ -68,8 +68,11 @@
# MPFS file system
# MPFS file system
0 string MPFS MPFS filesystem, Microchop,
0 string MPFS MPFS filesystem, Microchop,
>4 byte <0 {invalid}
>5 byte <0 {invalid}
>4 byte x version %d.
>4 byte x version %d.
>5 byte x \b%d,
>5 byte x \b%d,
>6 leshort <0 {invalid}
>6 leshort x %d file entries
>6 leshort x %d file entries
# cramfs filesystem - russell@coker.com.au
# cramfs filesystem - russell@coker.com.au
...
...
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