• Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Thank you for your responses and suggestions. But I don't think I was clear enough about what I meant by 'produce a disassembly'... I am developing a ppc assembly debugger for which I have my own crude disassembler. I would like to make this disassembly output a bit less crude by including program labels that may still be present in the ELF. To do this, I will need to understand the ELF data structure rather than relying on someone else's program or library.

    At some point I will very likely also want to create my own ELF loader for this debugger so a language neutral explanation of ELF data structures would be very helpful as I don't like my chances of figuring this out via binary editor...

    Code:
    0000 7f454c46 01020100 00000000 00000000 .ELF............ 
    0010 00010014 00000001 00000000 00000000 ................
    0020 00000070 00000000 00340000 00000028 ...p.....4.....(
    0030 00060003 48000008 60000000 4e800020 ....H...`...N..
    0040 deadbeef 002e7379 6d746162 002e7374 Þ.¾ï..symtab..st
    0050 72746162 002e7368 73747274 6162002e rtab..shstrtab..
    0060 74657874 002e726f 64617461 00000000 text..rodata....
    0070 00000000 00000000 00000000 00000000 ................
    0080 00000000 00000000 00000000 00000000 ................
    0090 00000000 00000000 0000001b 00000001 ................
    00a0 00000006 00000000 00000034 0000000c ...........4....
    00b0 00000000 00000000 00000004 00000000 ................
    00c0 00000021 00000001 00000002 00000000 ...!............
    00d0 00000040 00000004 00000000 00000000 ...@............
    00e0 00000004 00000000 00000011 00000003 ................
    00f0 00000000 00000000 00000044 00000029 ...........D...)
    0100 00000000 00000000 00000001 00000000 ................
    0110 00000001 00000002 00000000 00000000 ................
    0120 00000160 00000050 00000005 00000004 ...`...P........
    0130 00000004 00000010 00000009 00000003 ................
    0140 00000000 00000000 000001b0 0000000e ...........°....
    0150 00000000 00000000 00000001 00000000 ................
    0160 00000000 00000000 00000000 00000000 ................
    0170 00000000 00000000 00000000 03000001 ................
    0180 00000000 00000000 00000000 03000002 ................
    0190 00000001 00000008 00000000 00000001 ................
    01a0 00000005 00000000 00000004 11000002 ................
    01b0 00666f6f 005f5f61 626f785f 5f000000 .foo.__abox__...

    Which started life rather innocently as -

    .text

    b foo

    nop

    foo: blr

    .rodata

    .global __abox__
    __abox__:
    .word 0xdeadbeef
    .type __abox__,@object
    .size __abox__,4


    See? Not much fun...
    PPC assembly ain't so bad... ;)
  • »18.05.11 - 00:05
    Profile Visit Website