Commit c0580cef authored by Alejandro Mery's avatar Alejandro Mery
Browse files

bin2fex: cleaned decompile_section loop

parent d62de0d4
......@@ -37,12 +37,16 @@ static int decompile_section(void *bin, size_t bin_size,
struct script_section *section,
int out, const char* out_named)
{
int i;
struct script_section_entry *entries = PTR(bin, section->offset<<2);
for (i=0; i<section->length; i++) {
pr_info("%s.%s\t(entry:%d, offset:%d, pattern:0x%05x)\n",
section->name, entries[i].name, i,
entries[i].offset, entries[i].pattern);
struct script_section_entry *entry = PTR(bin, section->offset<<2);
int i = section->length;
for (; i--; entry++) {
unsigned type, length;
type = (entry->pattern >> 16) & 0xffff;
length = (entry->pattern >> 0) & 0xffff;
pr_info("%s.%s\t(offset:%d, type:%d, length:%d)\n",
section->name, entry->name,
entry->offset, type, length);
}
return 1; /* success */
......
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