diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-06-01 17:49:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-06-01 17:49:32 (GMT) |
commit | f6252e57c770fea10439659f35a69a783ff849d3 (patch) | |
tree | efc64ca7703648e439483ee6f4c14db855d7f952 /src/format/elf/e_elf.c | |
parent | 1b8152d6f95b03f81aa6a4043c23a45a9f74c418 (diff) |
Provided found MIPS routines.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@69 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf/e_elf.c')
-rw-r--r-- | src/format/elf/e_elf.c | 28 |
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; } |