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
c975737a
Commit
c975737a
authored
Dec 02, 2013
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated string-len to operate similarly to raw-replace
parent
35446a60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
10 deletions
+1
-10
smartsignature.py
src/binwalk/smartsignature.py
+1
-10
No files found.
src/binwalk/smartsignature.py
View file @
c975737a
...
...
@@ -264,18 +264,9 @@ class SmartSignature:
except
:
string_length
=
'0'
# If the keyword is nested (e.g., {file-offset:{string-len:%s}}), then the returned
# data string needs to end with KEYWORD_DELIM_END. Note that this only allows for
# one-level nesting.
if
data
.
endswith
(
self
.
KEYWORD_DELIM_END
*
2
):
end_char
=
self
.
KEYWORD_DELIM_END
else
:
end_char
=
''
# Strip out *everything* after the string-len keyword, including the keyword itself.
# Failure to do so can potentially allow keyword injection from a maliciously created file.
data
=
data
.
split
(
self
.
KEYWORDS
[
'string-len'
])[
0
]
+
string_length
+
end_char
data
=
data
.
replace
(
self
.
KEYWORDS
[
'string-len-replace'
],
string_length
)
data
=
data
.
split
(
self
.
KEYWORDS
[
'string-len'
])[
0
]
.
replace
(
self
.
KEYWORDS
[
'string-len-replace'
],
string_length
)
return
data
def
_strip_tags
(
self
,
data
):
...
...
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