* RzBin/ELF: avoid the creation of useless flags at 0 Use UT64_MAX as an error value for addresses like symbols, imports, sections, etc., and do not create flags for those because they are not meaningful. This is useful for imports that do not have an address in the virtual/file space and for non-alloc sections (e.g. .comment).
162 lines
6.6 KiB
Text
162 lines
6.6 KiB
Text
NAME=hello_srec.srec
|
|
FILE=srec://bins/srec/hello_srec.srec
|
|
CMDS=<<EOF
|
|
px 48
|
|
EOF
|
|
EXPECT=<<EOF
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0x00000000 3031 3233 3435 3637 3839 6162 6364 6566 0123456789abcdef
|
|
0x00000010 4142 4344 4546 4748 494a 4b4c 4d4e 4f50 ABCDEFGHIJKLMNOP
|
|
0x00000020 4141 4141 4242 4242 0aff ffff ffff ffff AAAABBBB........
|
|
EOF
|
|
RUN
|
|
|
|
|
|
NAME=wikipedia_example.srec
|
|
FILE=srec://bins/srec/wikipedia_example.srec
|
|
CMDS=<<EOF
|
|
px 0x50
|
|
EOF
|
|
EXPECT=<<EOF
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0x00000000 7c08 02a6 9001 0004 9421 fff0 7c6c 1b78 |........!..|l.x
|
|
0x00000010 7c8c 2378 3c60 0000 3863 0000 4bff ffe5 |.#x<`..8c..K...
|
|
0x00000020 3980 0000 7d83 6378 8001 0014 3821 0010 9...}.cx....8!..
|
|
0x00000030 7c08 03a6 4e80 0020 4865 6c6c 6f20 776f |...N.. Hello wo
|
|
0x00000040 726c 642e 0a00 ffff ffff ffff ffff ffff rld.............
|
|
EOF
|
|
RUN
|
|
|
|
|
|
NAME=address16.srec
|
|
FILE=srec://bins/srec/address16.srec
|
|
CMDS=<<EOF
|
|
px 0x100
|
|
EOF
|
|
EXPECT=<<EOF
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0x00000000 00ff 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000010 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000020 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000030 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000040 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000050 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000060 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000070 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000080 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x00000090 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x000000a0 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x000000b0 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x000000c0 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x000000d0 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x000000e0 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
0x000000f0 0004 0004 0004 0004 0004 0004 0004 0004 ................
|
|
EOF
|
|
RUN
|
|
|
|
|
|
NAME=address24.srec
|
|
FILE=srec://bins/srec/address24.srec
|
|
CMDS=<<EOF
|
|
px 4 @ 0x1000f0
|
|
EOF
|
|
EXPECT=<<EOF
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0x001000f0 0102 0304 ....
|
|
EOF
|
|
RUN
|
|
|
|
|
|
NAME=address32.srec
|
|
FILE=srec://bins/srec/address32.srec
|
|
CMDS=<<EOF
|
|
px 16 @ 0xffff0010
|
|
EOF
|
|
EXPECT=<<EOF
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0xffff0010 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f ................
|
|
EOF
|
|
RUN
|
|
|
|
|
|
NAME=arm1.bin.srec
|
|
FILE=srec://bins/srec/arm1.bin.srec
|
|
TIMEOUT=1320
|
|
CMDS=<<EOF
|
|
iI
|
|
iS
|
|
EOF
|
|
EXPECT=<<EOF
|
|
arch arm
|
|
cpu N/A
|
|
baddr 0x00008000
|
|
binsz 0x0008b9c8
|
|
bintype elf
|
|
bits 32
|
|
class ELF32
|
|
compiler GCC: (Ubuntu 4.3.2-2ubuntu9) 4.3.3 20081217 (prerelease)
|
|
dbg_file N/A
|
|
endian LE
|
|
hdr.csum N/A
|
|
guid N/A
|
|
intrp N/A
|
|
laddr 0x00000000
|
|
lang c
|
|
machine ARM
|
|
maxopsz 4
|
|
minopsz 4
|
|
os linux
|
|
cc N/A
|
|
pcalign 4
|
|
rpath NONE
|
|
subsys linux
|
|
stripped false
|
|
crypto false
|
|
havecode true
|
|
va true
|
|
sanitiz false
|
|
static true
|
|
linenum true
|
|
lsyms true
|
|
canary false
|
|
PIE false
|
|
RELROCS true
|
|
NX true
|
|
paddr size vaddr vsize align perm name type flags
|
|
------------------------------------------------------------------------------------------------------
|
|
0x00000000 0x0 ---------- 0x0 0x0 ---- NULL
|
|
0x00000114 0x20 0x00008114 0x20 0x0 -r-- .note.ABI-tag NOTE alloc
|
|
0x00000134 0x14 0x00008134 0x14 0x0 -r-x .init PROGBITS alloc,execute
|
|
0x00000150 0x5d3a8 0x00008150 0x5d3a8 0x0 -r-x .text PROGBITS alloc,execute
|
|
0x0005d4f8 0xcac 0x000654f8 0xcac 0x0 -r-x libc_freeres_fn PROGBITS alloc,execute
|
|
0x0005e1a4 0x10 0x000661a4 0x10 0x0 -r-x .fini PROGBITS alloc,execute
|
|
0x0005e1b8 0x144e0 0x000661b8 0x144e0 0x0 -r-- .rodata PROGBITS alloc
|
|
0x00072698 0x4 0x0007a698 0x4 0x0 -r-- libc_atexit PROGBITS alloc
|
|
0x0007269c 0x2c 0x0007a69c 0x2c 0x0 -r-- libc_subfreeres PROGBITS alloc
|
|
0x000726c8 0x30c 0x0007a6c8 0x30c 0x0 -r-- .ARM.extab PROGBITS alloc
|
|
0x000729d4 0x768 0x0007a9d4 0x768 0x0 -r-- .ARM.exidx LOPROC+0x00000001 alloc,link_order
|
|
0x0007313c 0x80 0x0007b13c 0x80 0x0 -r-- .eh_frame PROGBITS alloc
|
|
0x00073fb4 0x10 0x00083fb4 0x10 0x0 -rw- .tdata PROGBITS write,alloc,TLS
|
|
0x00073fc4 0x0 0x00083fc4 0x18 0x0 -rw- .tbss NOBITS write,alloc,TLS
|
|
0x00073fc4 0x4 0x00083fc4 0x4 0x0 -rw- .init_array INIT_ARRAY write,alloc
|
|
0x00073fc8 0x8 0x00083fc8 0x8 0x0 -rw- .fini_array FINI_ARRAY write,alloc
|
|
0x00073fd0 0x4 0x00083fd0 0x4 0x0 -rw- .jcr PROGBITS write,alloc
|
|
0x00073fd4 0x2c 0x00083fd4 0x2c 0x0 -rw- .data.rel.ro PROGBITS write,alloc
|
|
0x00074000 0x6c 0x00084000 0x6c 0x0 -rw- .got PROGBITS write,alloc
|
|
0x00074070 0x6e4 0x00084070 0x6e4 0x0 -rw- .data PROGBITS write,alloc
|
|
0x00074754 0x0 0x00084758 0x1880 0x0 -rw- .bss NOBITS write,alloc
|
|
0x00074754 0x0 0x00085fd8 0x14 0x0 -rw- libc_freeres_ptrs NOBITS write,alloc
|
|
0x00074754 0x4472 ---------- 0x4472 0x0 ---- .comment PROGBITS
|
|
0x00078bc8 0x58 ---------- 0x58 0x0 ---- .debug_aranges PROGBITS
|
|
0x00078c20 0x25 ---------- 0x25 0x0 ---- .debug_pubnames PROGBITS
|
|
0x00078c45 0x17b ---------- 0x17b 0x0 ---- .debug_info PROGBITS
|
|
0x00078dc0 0x6f ---------- 0x6f 0x0 ---- .debug_abbrev PROGBITS
|
|
0x00078e2f 0x130 ---------- 0x130 0x0 ---- .debug_line PROGBITS
|
|
0x00078f5f 0xa4 ---------- 0xa4 0x0 ---- .debug_str PROGBITS merge,strings
|
|
0x00079008 0x48 ---------- 0x48 0x0 ---- .debug_ranges PROGBITS
|
|
0x00079050 0x2d ---------- 0x2d 0x0 ---- .ARM.attributes LOPROC+0x00000003
|
|
0x0007907d 0x167 ---------- 0x167 0x0 ---- .shstrtab STRTAB
|
|
0x00079734 0xbf00 ---------- 0xbf00 0x0 ---- .symtab SYMTAB
|
|
0x00085634 0x6394 ---------- 0x6394 0x0 ---- .strtab STRTAB
|
|
EOF
|
|
RUN
|