rizin/test/db/cmd/cmd_psj
Riccardo Schirone d20b026ce2
Finish conversion of w commands to rzshell (#2412)
* Convert 'wz' to rzshell
* Remove 'wt' commands in favour of > operator
* Convert 'ww' command to rzshell
* Convert 'wm' command to rzshell
* Convert 'wd' command to rzshell
* Convert 'wu' command to rzshell
* Convert 'wo' commands to rzshell
* Fix 'w' tests
2022-03-16 11:20:29 +00:00

60 lines
1.1 KiB
Text
Raw Blame History

NAME=psj ascii
FILE=malloc://128
CMDS=<<EOF
wx 72697a696e20697320636f6f6c
psj 13
EOF
EXPECT=<<EOF
{"string":"rizin is cool","offset":0,"section":"unknown","length":13,"type":"8bit"}
EOF
RUN
NAME=psj ascii 2
FILE=bins/elf/analysis/hello-android-arm
CMDS=<<EOF
s 0x00008358
psj 11
EOF
EXPECT=<<EOF
{"string":"Hello World","offset":33624,"section":".rodata","length":11,"type":"8bit"}
EOF
RUN
NAME=psj utf8
FILE=malloc://128
CMDS=<<EOF
wx e9bb91e5aea2
psj 6
EOF
EXPECT=<<EOF
{"string":"\u00e9\u00bb\u0091\u00e5\u00ae\u00a2","offset":0,"section":"unknown","length":6,"type":"utf8"}
EOF
RUN
NAME=psj utf8 (#9064)
FILE==
CMDS=<<EOF
wz "...\"..<2E><><EFBFBD><EFBFBD>..."
psj 13
EOF
EXPECT=<<EOF
{"string":"...\"..\u00ef\u00bf\u00bd\u00ef\u00bf\u00bd\u00ef","offset":0,"section":"unknown","length":13,"type":"utf8"}
EOF
RUN
NAME=psj utf32le
FILE=bins/elf/crackme0x00b
CMDS=psj 32 @ obj.pass.1964
EXPECT=<<EOF
{"string":"w0wgreat","offset":134520896,"section":".data","length":8,"type":"utf32le"}
EOF
RUN
NAME=psj utf32be
FILE=bins/elf/crackme0x00b
CMDS=psj 32 @ 0x0804a03d
EXPECT=<<EOF
{"string":"w0wgreat","offset":134520893,"section":".data","length":8,"type":"utf32be"}
EOF
RUN