Apart from obvious big endian parsing bugs, this also tests `il` with xbe, since that had endianness issues too and was previously untested. To be able to have meaningful tests there, extra entries for the explicit kernel and xapi pointers found in the xbe header have been removed, since these always seem to point into the regular library array anyway and would thus result in duplicates. This fixes test/db/formats/xbe on OpenBSD/sparc64.
81 lines
1.7 KiB
Text
81 lines
1.7 KiB
Text
NAME=loading an xbe file
|
|
FILE=bins/xbe/default.xbe
|
|
CMDS=q!
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=entrypoint decoding
|
|
FILE=bins/xbe/default.xbe
|
|
CMDS=ie
|
|
EXPECT=<<EOF
|
|
vaddr paddr hvaddr haddr type
|
|
----------------------------------------------------
|
|
0x00011000 0x00001000 ---------- ---------- program
|
|
EOF
|
|
RUN
|
|
|
|
NAME=corrupted section data
|
|
FILE=bins/xbe/default.xbe
|
|
CMDS=p8 16
|
|
EXPECT=<<EOF
|
|
81ec08040000535556576a01e88f0100
|
|
EOF
|
|
RUN
|
|
|
|
NAME=decoding the thunk table
|
|
FILE=bins/xbe/default.xbe
|
|
CMDS=is
|
|
EXPECT=<<EOF
|
|
nth paddr vaddr bind type size lib name
|
|
--------------------------------------------------------
|
|
0 0x000016c0 0x000116c0 NONE NONE 4 kt.sprintf
|
|
EOF
|
|
RUN
|
|
|
|
NAME=section header decoding
|
|
BROKEN=1
|
|
FILE=bins/xbe/default.xbe
|
|
CMDS=iS
|
|
EXPECT=<<EOF
|
|
[Sections]
|
|
00 0x00001000 1728 0x00011000 1728 -r-x .0
|
|
01 0x00002000 24 0x000116c0 24 -r-- .1
|
|
02 0x00003000 28280 0x000116e0 1257188 -rw- .2
|
|
03 0x0000a000 60 0x001445e0 64 -rwx .3
|
|
04 0x0000b000 164 0x00144620 1188 -r-- .4
|
|
EOF
|
|
RUN
|
|
|
|
NAME=section header in r2
|
|
BROKEN=1
|
|
FILE=bins/xbe/default.xbe
|
|
CMDS=S
|
|
EXPECT=<<EOF
|
|
[00:00] * pa=0x00001000 r-x va=0x00011000 sz=0x06c0 vsz=0x06c0 .0
|
|
[00:01] . pa=0x00002000 r-- va=0x000116c0 sz=0x0018 vsz=0x0018 .1
|
|
[00:02] . pa=0x00003000 rw- va=0x000116e0 sz=0x6e78 vsz=0x132ee4 .2
|
|
[00:03] . pa=0x0000a000 rwx va=0x001445e0 sz=0x003c vsz=0x0040 .3
|
|
[00:04] . pa=0x0000b000 r-- va=0x00144620 sz=0x00a4 vsz=0x04a4 .4
|
|
EOF
|
|
RUN
|
|
|
|
NAME=loading crashy xbe file
|
|
FILE=bins/xbe/crash.xbe
|
|
CMDS=q!
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=xbe library versions
|
|
FILE=bins/xbe/nxdk-hello-dummy-libs.xbe
|
|
CMDS=il
|
|
EXPECT=<<EOF
|
|
library
|
|
--------------
|
|
RIZIN0 42.5.0
|
|
RIZIN1 42.6.1
|
|
RIZIN2 42.7.2
|
|
RIZIN3 42.8.3
|
|
EOF
|
|
RUN
|