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
491d06e4
Commit
491d06e4
authored
Oct 02, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed firmware-mod-kit dependencies
parent
b24fe1c7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
13 deletions
+30
-13
extract.conf
src/binwalk/config/extract.conf
+6
-6
__init__.py
src/binwalk/modules/__init__.py
+1
-1
compression.py
src/binwalk/modules/compression.py
+3
-3
cpio.py
src/binwalk/plugins/cpio.py
+20
-2
archives
src/magic/archives
+0
-1
No files found.
src/binwalk/config/extract.conf
View file @
491d06e4
...
@@ -25,20 +25,20 @@
...
@@ -25,20 +25,20 @@
^
squashfs
filesystem
:
squashfs
:
sasquatch
'%e'
^
squashfs
filesystem
:
squashfs
:
sasquatch
'%e'
^
squashfs
filesystem
:
squashfs
:
unsquashfs
'%e'
^
squashfs
filesystem
:
squashfs
:
unsquashfs
'%e'
^
cramfs
filesystem
:
cramfs
:
mkdir
cramfs
-
root
&&
mount
-
t
cramfs
'%e'
cramfs
-
root
^
ext2
filesystem
:
ext2
:
mkdir
ext2
-
root
&&
mount
-
t
ext2
'%e'
ext2
-
root
^
romfs
filesystem
:
romfs
:
mkdir
romfs
-
root
&&
mount
-
t
romfs
'%e'
romfs
-
root
# These assume the firmware-mod-kit is installed to /opt/firmware-mod-kit.
# These assume the firmware-mod-kit is installed to /opt/firmware-mod-kit.
# If not, change the file paths appropriately.
# If not, change the file paths appropriately.
^
jffs2
filesystem
:
jffs2
:/
opt
/
firmware
-
mod
-
kit
/
src
/
jffs2
/
unjffs2
'%e'
#
^jffs2 filesystem:jffs2:/opt/firmware-mod-kit/src/jffs2/unjffs2 '%e'
^
ascii
cpio
archive
:
cpio
:/
opt
/
firmware
-
mod
-
kit
/
uncpio
.
sh
'%e'
#
^ascii cpio archive:cpio:/opt/firmware-mod-kit/uncpio.sh '%e'
#^squashfs filesystem:squashfs:/opt/firmware-mod-kit/unsquashfs_all.sh '%e'
#^squashfs filesystem:squashfs:/opt/firmware-mod-kit/unsquashfs_all.sh '%e'
#^cramfs filesystem:cramfs:/opt/firmware-mod-kit/uncramfs_all.sh '%e'
#^cramfs filesystem:cramfs:/opt/firmware-mod-kit/uncramfs_all.sh '%e'
#^bff volume entry:bff:/opt/firmware-mod-kit/src/bff/bffxtractor.py '%e'
#^bff volume entry:bff:/opt/firmware-mod-kit/src/bff/bffxtractor.py '%e'
#^wdk file system:wdk:/opt/firmware-mod-kit/src/firmware-tools/unwdk.py '%e'
#^wdk file system:wdk:/opt/firmware-mod-kit/src/firmware-tools/unwdk.py '%e'
#^zlib compressed data:zlib:/opt/firmware-mod-kit/src/firmware-tools/unzlib.py '%e'
#^zlib compressed data:zlib:/opt/firmware-mod-kit/src/firmware-tools/unzlib.py '%e'
^
cramfs
filesystem
:
cramfs
:
mkdir
cramfs
-
root
&&
mount
-
t
cramfs
'%e'
cramfs
-
root
^
ext2
filesystem
:
ext2
:
mkdir
ext2
-
root
&&
mount
-
t
ext2
'%e'
ext2
-
root
^
romfs
filesystem
:
romfs
:
mkdir
romfs
-
root
&&
mount
-
t
romfs
'%e'
romfs
-
root
# These will only be run if the above file paths don't exist / don't work.
# These will only be run if the above file paths don't exist / don't work.
#^squashfs filesystem:squashfs:/opt/firmware-mod-kit/trunk/unsquashfs_all.sh '%e'
#^squashfs filesystem:squashfs:/opt/firmware-mod-kit/trunk/unsquashfs_all.sh '%e'
#^jffs2 filesystem:jffs2:/opt/firmware-mod-kit/trunk/src/jffs2/unjffs2 '%e' # requires root
#^jffs2 filesystem:jffs2:/opt/firmware-mod-kit/trunk/src/jffs2/unjffs2 '%e' # requires root
...
...
src/binwalk/modules/__init__.py
View file @
491d06e4
...
@@ -5,7 +5,7 @@ from binwalk.modules.hexdiff import HexDiff
...
@@ -5,7 +5,7 @@ from binwalk.modules.hexdiff import HexDiff
from
binwalk.modules.general
import
General
from
binwalk.modules.general
import
General
from
binwalk.modules.extractor
import
Extractor
from
binwalk.modules.extractor
import
Extractor
from
binwalk.modules.entropy
import
Entropy
from
binwalk.modules.entropy
import
Entropy
from
binwalk.modules.heuristics
import
HeuristicCompressionAnalyzer
#
from binwalk.modules.heuristics import HeuristicCompressionAnalyzer
from
binwalk.modules.compression
import
RawCompression
from
binwalk.modules.compression
import
RawCompression
try
:
try
:
from
binwalk.modules.disasm
import
Disasm
from
binwalk.modules.disasm
import
Disasm
...
...
src/binwalk/modules/compression.py
View file @
491d06e4
...
@@ -27,12 +27,12 @@ class Deflate(object):
...
@@ -27,12 +27,12 @@ class Deflate(object):
# The tinfl library is built and installed with binwalk
# The tinfl library is built and installed with binwalk
self
.
tinfl
=
binwalk
.
core
.
C
.
Library
(
self
.
TINFL_NAME
,
self
.
TINFL_FUNCTIONS
)
self
.
tinfl
=
binwalk
.
core
.
C
.
Library
(
self
.
TINFL_NAME
,
self
.
TINFL_FUNCTIONS
)
# Add an extraction rule
# Add an extraction rule
if
self
.
module
.
extractor
.
enabled
:
if
self
.
module
.
extractor
.
enabled
:
self
.
module
.
extractor
.
add_rule
(
regex
=
'^
%
s'
%
self
.
DESCRIPTION
.
lower
(),
extension
=
"deflate"
,
cmd
=
self
.
_
extractor
)
self
.
module
.
extractor
.
add_rule
(
regex
=
'^
%
s'
%
self
.
DESCRIPTION
.
lower
(),
extension
=
"deflate"
,
cmd
=
self
.
extractor
)
def
_
extractor
(
self
,
file_name
):
def
extractor
(
self
,
file_name
):
out_file
=
os
.
path
.
splitext
(
file_name
)[
0
]
out_file
=
os
.
path
.
splitext
(
file_name
)[
0
]
self
.
tinfl
.
inflate_raw_file
(
file_name
,
out_file
)
self
.
tinfl
.
inflate_raw_file
(
file_name
,
out_file
)
...
...
src/binwalk/plugins/cpio.py
View file @
491d06e4
...
@@ -2,11 +2,29 @@ import binwalk.core.plugin
...
@@ -2,11 +2,29 @@ import binwalk.core.plugin
class
CPIOPlugin
(
binwalk
.
core
.
plugin
.
Plugin
):
class
CPIOPlugin
(
binwalk
.
core
.
plugin
.
Plugin
):
'''
'''
Ensures that ASCII CPIO archive entries only get extracted once.
Ensures that ASCII CPIO archive entries only get extracted once.
'''
'''
# CPIO_OUT_DIR = "cpio-root"
MODULES
=
[
'Signature'
]
MODULES
=
[
'Signature'
]
# def init(self):
# if self.module.extractor.enabled:
# self.module.extractor.add_rule(regex="^ascii cpio archive",
# extension="cpio",
# cmd=self.extractor)
# def extractor(self, fname):
# out_dir = os.path.join(os.path.split(fname)[0], self.CPIO_OUT_DIR)
# try:
# os.mkdir(out_dir)
# except OSError:
# return
# # Lazy.
# os.system("cd '%s' && cpio -d -i --no-absolute-filenames < '%s' 2>&1 1>/dev/null" % (out_dir, fname))
def
pre_scan
(
self
):
def
pre_scan
(
self
):
# Be sure to re-set this at the beginning of every scan
# Be sure to re-set this at the beginning of every scan
self
.
found_archive
=
False
self
.
found_archive
=
False
...
@@ -28,7 +46,7 @@ class CPIOPlugin(binwalk.core.plugin.Plugin):
...
@@ -28,7 +46,7 @@ class CPIOPlugin(binwalk.core.plugin.Plugin):
self
.
found_archive
=
False
self
.
found_archive
=
False
result
.
extract
=
False
result
.
extract
=
False
else
:
else
:
# The first entry has already been found and this is not the last entry, or the last entry
# The first entry has already been found and this is not the last entry, or the last entry
# has not yet been found. Don't extract.
# has not yet been found. Don't extract.
result
.
extract
=
False
result
.
extract
=
False
else
:
else
:
...
...
src/magic/archives
View file @
491d06e4
...
@@ -175,7 +175,6 @@
...
@@ -175,7 +175,6 @@
>54 string x {jump-to-offset:0x%.8s+110+
>54 string x {jump-to-offset:0x%.8s+110+
>94 string x \b0x%.8s}
>94 string x \b0x%.8s}
# HP Printer Job Language
# HP Printer Job Language
# The header found on Win95 HP plot files is the "Silliest Thing possible"
# The header found on Win95 HP plot files is the "Silliest Thing possible"
# (TM)
# (TM)
...
...
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