Commit 491d06e4 by devttys0

Removed firmware-mod-kit dependencies

parent b24fe1c7
...@@ -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
......
...@@ -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
......
...@@ -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)
......
...@@ -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:
......
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment