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
feb1cce5
Commit
feb1cce5
authored
Mar 26, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments/docs to core code files
parent
0424af6d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
8 deletions
+37
-8
C.py
src/binwalk/core/C.py
+1
-0
display.py
src/binwalk/core/display.py
+3
-0
filter.py
src/binwalk/core/filter.py
+2
-1
magic.py
src/binwalk/core/magic.py
+4
-0
module.py
src/binwalk/core/module.py
+5
-0
parser.py
src/binwalk/core/parser.py
+7
-0
plugin.py
src/binwalk/core/plugin.py
+9
-7
settings.py
src/binwalk/core/settings.py
+2
-0
smart.py
src/binwalk/core/smart.py
+4
-0
No files found.
src/binwalk/core/C.py
View file @
feb1cce5
...
...
@@ -119,6 +119,7 @@ class Library(object):
lib_path
=
ctypes
.
util
.
find_library
(
library
)
# If ctypes failed to find the library, check the common paths listed in system_paths
if
not
lib_path
:
for
path
in
system_paths
[
sys
.
platform
]:
if
os
.
path
.
exists
(
path
):
...
...
src/binwalk/core/display.py
View file @
feb1cce5
# Code to handle displaying and logging of results.
# Anything in binwalk that prints results to screen should use this class.
import
sys
import
csv
as
pycsv
import
datetime
...
...
src/binwalk/core/filter.py
View file @
feb1cce5
# Code for filtering of results (e.g., removing invalid results)
import
re
import
binwalk.core.common
as
common
from
binwalk.core.smart
import
Signature
...
...
@@ -34,7 +36,6 @@ class FilterExclude(FilterType):
class
Filter
(
object
):
'''
Class to filter results based on include/exclude rules and false positive detection.
An instance of this class is available via the Binwalk.filter object.
Note that all filter strings should be in lower case.
'''
...
...
src/binwalk/core/magic.py
View file @
feb1cce5
# Python wrapper for the libmagic library.
# Although libmagic comes with its own wrapper, there are compatibility issues with older libmagic versions
# as well as unofficial libmagic Python wrappers, so it's easier to just have our own wrapper.
import
binwalk.core.C
import
binwalk.core.common
from
binwalk.core.compat
import
*
...
...
src/binwalk/core/module.py
View file @
feb1cce5
# Core code relating to binwalk modules and supporting classes.
# In particular, the Module class (base class for all binwalk modules)
# and the Modules class (main class for managing and executing binwalk modules)
# are most critical.
import
io
import
os
import
sys
...
...
src/binwalk/core/parser.py
View file @
feb1cce5
# Code for performing minimal parsing of libmagic-compatible signature files.
# This allows for building a single signature file from multiple other signature files,
# and for parsing out the initial magic signature bytes for each signature (used for
# pre-processing of data to limit the number of actual calls into libmagic).
#
# Also performs splitting/formatting of libmagic result text.
import
io
import
re
import
os.path
...
...
src/binwalk/core/plugin.py
View file @
feb1cce5
# Core code for supporting and managing plugins.
import
os
import
sys
import
imp
...
...
@@ -140,17 +142,17 @@ class Plugins(object):
Returns a dictionary of:
{
'user'
: {
'modules' : [list, of, module, names],
'descriptions'
: {'module_name' : 'module pydoc string'},
'user' : {
'modules'
: [list, of, module, names],
'descriptions' : {'module_name' : 'module pydoc string'},
'enabled' : {'module_name' : True},
'path' : "path/to/module/plugin/directory"
'path'
: "path/to/module/plugin/directory"
},
'system' : {
'modules' : [list, of, module, names],
'descriptions'
: {'module_name' : 'module pydoc string'},
'modules'
: [list, of, module, names],
'descriptions' : {'module_name' : 'module pydoc string'},
'enabled' : {'module_name' : True},
'path' : "path/to/module/plugin/directory"
'path'
: "path/to/module/plugin/directory"
}
}
'''
...
...
src/binwalk/core/settings.py
View file @
feb1cce5
# Code for loading and accessing binwalk settings (extraction rules, signature files, etc).
import
os
import
binwalk.core.common
as
common
from
binwalk.core.compat
import
*
...
...
src/binwalk/core/smart.py
View file @
feb1cce5
# "Smart" parser for handling libmagic signature results. Specifically, this implements
# support for binwalk's custom libmagic signature extensions (keyword tags, string processing,
# false positive detection, etc).
import
re
import
binwalk.core.module
from
binwalk.core.compat
import
*
...
...
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