rizin/test/db/cmd/cmd_pxw
billow 0908b65bc3
Convert px[ dDhHwWqQol] to rzshell
* `pxd` -> `pxd 4`
* `pxd<N> [len]` -> `pxd <N> [len]`
* expose APIs:
- `rz_core_print_cmp`
- `rz_core_print_dump`
- `rz_core_print_hexdump_`
- `rz_core_print_hexdump_byline`
* test for `pxW` `pxH`
* move `void rz_print_section` -> `const char *rz_print_section`
* `pxd` -> `pxd[ hwq]`
* `pxc`
* `pxAv` -> `pxAl`
* `pxt.` -> removed ?
* `px/` -> keep
* `pxf` -> TODO: not found old code ?
2022-08-04 09:11:22 +08:00

151 lines
2.1 KiB
Text

NAME=pxw cfg.bigendian=true (elf64)
FILE=bins/elf/analysis/hello-linux-x86_64
CMDS=<<EOF
e cfg.bigendian=true
pxw 16
EOF
EXPECT=<<EOF
0x00400410 0x31ed4989 0xd15e4889 0xe24883e4 0xf0505449 1.I..^H..H...PTI
EOF
RUN
NAME=pxw cfg.bigendian=false (elf64)
FILE=bins/elf/analysis/hello-linux-x86_64
CMDS=<<EOF
e cfg.bigendian=false
pxw 16
EOF
EXPECT=<<EOF
0x00400410 0x8949ed31 0x89485ed1 0xe48348e2 0x495450f0 1.I..^H..H...PTI
EOF
RUN
NAME=pxw cfg.bigendian=false (pe32)
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e cfg.bigendian=false
pxw 16
EOF
EXPECT=<<EOF
0x00401280 0x83e58955 0x04c708ec 0x00000124 0xc815ff00 U.......$.......
EOF
RUN
NAME=pxw cfg.bigendian=true (pe32)
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e cfg.bigendian=true
pxw 16
EOF
EXPECT=<<EOF
0x00401280 0x5589e583 0xec08c704 0x24010000 0x00ff15c8 U.......$.......
EOF
RUN
NAME=pxw offsets 16
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e hex.cols=16
pxw 32~[0]
EOF
EXPECT=<<EOF
0x00401280
0x00401290
EOF
RUN
NAME=pxw offsets 12
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e hex.cols=12
pxw 32~[0]
EOF
EXPECT=<<EOF
0x00401280
0x0040128c
0x00401298
EOF
RUN
NAME=pxw offsets 10
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e hex.cols=10
pxw 32~[0]
EOF
EXPECT=<<EOF
0x00401280
0x0040128a
0x00401294
0x0040129e
EOF
RUN
NAME=pxw offsets
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e hex.cols=8
pxw 32~[0]
EOF
EXPECT=<<EOF
0x00401280
0x00401288
0x00401290
0x00401298
EOF
RUN
NAME=pxw bytes < 4
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e hex.cols=8
pxw 2~[1]
EOF
EXPECT=<<EOF
0x00008955
EOF
RUN
NAME=pxw bytes between 4 and 8
FILE=bins/pe/hello-mingw32
CMDS=<<EOF
e hex.cols=8
pxw 7~[1]
pxw 7~[2]
EOF
EXPECT=<<EOF
0x83e58955
U...
EOF
RUN
NAME=pxW
FILE=bins/elf/sse2-add
CMDS=<<EOF
s 0x00000760
pxW 0xc
e hex.section=true
s 0x00000724
pxW 0xc
EOF
EXPECT=<<EOF
0x00000760 0x00000014 segment.LOAD0+20
0x00000764 0x00000000 segment.LOAD0
0x00000768 0x00527a01
.eh_frame_hdr 0x00000724 0x3b031b01
.eh_frame_hdr 0x00000728 0x00000038 segment.LOAD0+56
.eh_frame_hdr 0x0000072c 0x00000006 segment.LOAD0+6
EOF
RUN
NAME=pxq foo-bar
FILE==
CMDS=<<EOF
f foo @ 10
f bar @ 2
pxq foo-bar~?
EOF
EXPECT=<<EOF
1
EOF
RUN