summaryrefslogtreecommitdiff
path: root/src/format/elf/e_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/elf/e_elf.c')
-rw-r--r--src/format/elf/e_elf.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/format/elf/e_elf.c b/src/format/elf/e_elf.c
index 373df2b..1de4ac0 100644
--- a/src/format/elf/e_elf.c
+++ b/src/format/elf/e_elf.c
@@ -204,15 +204,15 @@ elf_format *load_elf(const uint8_t *content, off_t length)
test = read_elf_section_names(result);
- printf("ok ? %d\n", test);
+ printf("section names ok ? %d\n", test);
test = find_all_elf_strings(result);
- printf("ok ? %d\n", test);
+ printf("strings ok ? %d\n", test);
test = load_elf_symbols(result);
- printf("ok ? %d\n", test);
+ printf("symbols ok ? %d\n", test);
@@ -326,6 +326,18 @@ bin_part **get_elf_default_code_parts(const elf_format *format, size_t *count)
}
+ if (find_elf_section_content_by_name(format, ".MIPS.stubs", &offset, &size, &voffset))
+ {
+ part = create_bin_part();
+
+ set_bin_part_name(part, ".MIPS.stubs");
+ set_bin_part_values(part, offset, size, voffset);
+
+ result = (bin_part **)realloc(result, ++(*count) * sizeof(bin_part *));
+ result[*count - 1] = part;
+
+ }
+
if (find_elf_section_content_by_name(format, ".init", &offset, &size, &voffset))
{
part = create_bin_part();
@@ -583,16 +595,16 @@ GBinRoutine **get_all_elf_routines(const elf_format *format, size_t *count)
result = (GBinRoutine **)calloc(format->sym_count, sizeof(GBinRoutine *));
*count = format->sym_count;
- /*
+
for (i = 0; i < format->sym_count; i++)
{
- result[i] = create_binary_routine();
+ result[i] = g_binary_routine_new();
- set_binary_routine_offset(result[i], format->symbols[i].address);
- set_binary_routine_name(result[i], strdup(format->symbols[i].name));
+ g_binary_routine_set_address(result[i], format->symbols[i].address);
+ g_binary_routine_set_name(result[i], strdup(format->symbols[i].name));
}
- */
+
return result;
}