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
60d2b1d4
Commit
60d2b1d4
authored
Nov 20, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed python2.6 bug in BlockFile
parent
2c439f43
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
tinfl.c
src/C/miniz/tinfl.c
+8
-1
common.py
src/binwalk/common.py
+6
-0
bincast
src/binwalk/magic/bincast
+2
-2
No files found.
src/C/miniz/tinfl.c
View file @
60d2b1d4
...
...
@@ -262,6 +262,8 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
do
{
//printf("DECOMPRESS: %d\n", r->m_final);
//fflush(stdout);
TINFL_GET_BITS
(
3
,
r
->
m_final
,
3
);
r
->
m_type
=
r
->
m_final
>>
1
;
if
(
r
->
m_type
==
0
)
{
...
...
@@ -503,6 +505,8 @@ common_exit:
}
r
->
m_check_adler32
=
(
s2
<<
16
)
+
s1
;
if
((
status
==
TINFL_STATUS_DONE
)
&&
(
decomp_flags
&
TINFL_FLAG_PARSE_ZLIB_HEADER
)
&&
(
r
->
m_check_adler32
!=
r
->
m_z_adler32
))
status
=
TINFL_STATUS_ADLER32_MISMATCH
;
}
//printf("DECOMPRESS RETURN\n");
//fflush(stdout);
return
status
;
}
...
...
@@ -515,9 +519,12 @@ void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, siz
for
(
;
;
)
{
size_t
src_buf_size
=
src_buf_len
-
src_buf_ofs
,
dst_buf_size
=
out_buf_capacity
-
*
pOut_len
,
new_out_buf_capacity
;
//printf("DOING DECOMPRESSION\n");
//fflush(stdout);
tinfl_status
status
=
tinfl_decompress
(
&
decomp
,
(
const
mz_uint8
*
)
pSrc_buf
+
src_buf_ofs
,
&
src_buf_size
,
(
mz_uint8
*
)
pBuf
,
pBuf
?
(
mz_uint8
*
)
pBuf
+
*
pOut_len
:
NULL
,
&
dst_buf_size
,
(
flags
&
~
TINFL_FLAG_HAS_MORE_INPUT
)
|
TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF
);
printf
(
"STATUS: %d
\n
"
,
status
);
//printf("STATUS: %d\n", status);
//fflush(stdout);
if
((
status
<
0
)
||
(
status
==
TINFL_STATUS_NEEDS_MORE_INPUT
))
{
MZ_FREE
(
pBuf
);
*
pOut_len
=
0
;
return
NULL
;
...
...
src/binwalk/common.py
View file @
60d2b1d4
...
...
@@ -139,6 +139,12 @@ class BlockFile(io.FileIO):
io
.
FileIO
.
__init__
(
self
,
fname
,
mode
)
# Work around for python 2.6 where FileIO.name raises an exception
try
:
self
.
name
except
AttributeError
:
self
.
name
=
fname
self
.
seek
(
self
.
offset
)
...
...
src/binwalk/magic/bincast
View file @
60d2b1d4
0 belong x Hex: 0x%.8X
#0 string x String: %s
0 lequad x Little Endian Quad: %lld
0 bequad x Big Endian Quad: %lld
#
0 lequad x Little Endian Quad: %lld
#
0 bequad x Big Endian Quad: %lld
0 lelong x Little Endian Long: %d
0 belong x Big Endian Long: %d
0 leshort x Little Endian Short: %d
...
...
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