Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
85d240fa
Commit
85d240fa
authored
May 06, 2012
by
Alejandro Mery
Browse files
bin2fex: refactored script_bin_head including the array of sections
parent
315a590a
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin2fex.c
View file @
85d240fa
...
...
@@ -194,19 +194,16 @@ static int decompile_section(void *bin, size_t UNUSED(bin_size),
static
int
decompile
(
void
*
bin
,
size_t
bin_size
,
FILE
*
out
)
{
int
i
;
struct
{
struct
script_bin_head
head
;
struct
script_bin_section
sections
[];
}
*
script
=
bin
;
struct
script_bin_head
*
script
=
bin
;
pr_info
(
"version: %d.%d.%d
\n
"
,
script
->
head
.
version
[
0
],
script
->
head
.
version
[
1
],
script
->
head
.
version
[
2
]);
pr_info
(
"version: %d.%d.%d
\n
"
,
script
->
version
[
0
],
script
->
version
[
1
],
script
->
version
[
2
]);
pr_info
(
"size: %zu (%d sections)
\n
"
,
bin_size
,
script
->
head
.
sections
);
script
->
sections
);
/* TODO: SANITY: compare head.sections with bin_size */
for
(
i
=
0
;
i
<
script
->
head
.
sections
;
i
++
)
{
struct
script_bin_section
*
section
=
&
script
->
section
s
[
i
];
for
(
i
=
0
;
i
<
script
->
sections
;
i
++
)
{
struct
script_bin_section
*
section
=
&
script
->
section
[
i
];
if
(
!
decompile_section
(
bin
,
bin_size
,
section
,
out
))
return
1
;
/* failure */
...
...
bin2fex.h
View file @
85d240fa
...
...
@@ -19,17 +19,18 @@
#include <stdint.h>
struct
script_bin_head
{
int32_t
sections
;
int32_t
version
[
3
];
};
struct
script_bin_section
{
char
name
[
32
];
int32_t
length
;
int32_t
offset
;
};
struct
script_bin_head
{
int32_t
sections
;
int32_t
version
[
3
];
struct
script_bin_section
section
[];
};
struct
script_bin_entry
{
char
name
[
32
];
int32_t
offset
;
...
...
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