rizin/test/db/cmd/cmd_disassembly
Riccardo Schirone 144ba639dc
Convert s commands to newshell (#375)
* Rename `sj`/`s*` and move them under `sH`. Remove `s=`
* Rename `s-*` to `sH-`
* Use `sd` for "seek delta", which moves relative to the current offset
* Enforce <cmd> <arg> syntax. So no more `s+16` but `s +16`. Command
  `sHr` is for redo history, `sHu` for undo history. If one wants to move
  relative to the current address, they need to do `sd +10`/`sd -10`.
* Remove `ss` commands in favour of `cmd.seek.silent`. This was anyway
  used mainly for scripts, so no need to replicate all `s` commands
  under `ss`.

Change a bit rz_core_seek API to avoid dupped entries in seek history.
2021-01-20 10:30:20 +08:00

190 lines
2.4 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NAME=pD@x:90
FILE=-
CMDS=<<EOF
e asm.arch=x86
e asm.bits= 32
e asm.bytes=true
pD@x:90
EOF
EXPECT=<<EOF
0x00000000 90 nop
EOF
RUN
NAME=pd@x:90
FILE=-
CMDS=<<EOF
e asm.arch=x86
e asm.bits= 32
e asm.bytes=true
pd@x:90
EOF
EXPECT=<<EOF
0x00000000 90 nop
EOF
RUN
NAME=pd@x:90909090
FILE=-
CMDS=<<EOF
e asm.bytes=true
e asm.arch=x86
e asm.bits=32
pd@x:90909090
EOF
EXPECT=<<EOF
0x00000000 90 nop
0x00000001 90 nop
0x00000002 90 nop
0x00000003 90 nop
EOF
RUN
NAME=pd@x:909090
FILE=-
CMDS=<<EOF
e asm.bytes=true
e asm.arch=x86
e asm.bits= 32
pd@x:909090
EOF
EXPECT=<<EOF
0x00000000 90 nop
0x00000001 90 nop
0x00000002 90 nop
EOF
RUN
NAME=pd 4;?=
FILE=-
CMDS=<<EOF
wx 00000000000000000000
e asm.arch=x86
e asm.bytes=true
e asm.bits=32
pd 4
?=
EOF
EXPECT=<<EOF
0x00000000 0000 add byte [eax], al
0x00000002 0000 add byte [eax], al
0x00000004 0000 add byte [eax], al
0x00000006 0000 add byte [eax], al
0x8
EOF
RUN
NAME=pd 4 > /dev/null; ?=
FILE=-
CMDS=<<EOF
wx 00000000000000000000
e asm.arch=x86
e asm.bits=32
pd 4 > /dev/null
?=
EOF
EXPECT=<<EOF
0x8
EOF
RUN
NAME=wx e9010f;?v $l
FILE=-
CMDS=<<EOF
wx e9010f
e asm.arch=x86
e asm.bits=16
?vi $l
pi 1
ao 1~size[1]
EOF
EXPECT=<<EOF
3
jmp 0xf04
3
EOF
RUN
NAME=dis-16/32/64
FILE=-
CMDS=<<EOF
wx e99300 e869390000 e828350000
e asm.arch=x86
e asm.segoff=1
e asm.bits=16
pi 1
sd +3
e asm.segoff=0
e asm.bits=32
pi 1
sd +5
e asm.bits=64
pi 1
EOF
EXPECT=<<EOF
jmp 0x96
call 0x3971
call 0x3535
EOF
RUN
NAME=unaligned arm code
FILE=-
CMDS=<<EOF
wx 00000000
e asm.bits=16
e asm.arch=arm
pi 1 @ 1
EOF
EXPECT=<<EOF
unaligned
EOF
RUN
NAME=unaligned arm code
FILE=-
CMDS=<<EOF
wx 00000000
e asm.bits=32
e asm.arch=arm
pi 1 @ 2
EOF
EXPECT=<<EOF
unaligned
EOF
RUN
NAME=unaligned x86 issue
FILE=-
CMDS=<<EOF
wx 00000000
e asm.arch=arm
e asm.bits=16
pi 2
e asm.arch=x86
pi 1 @ 1
EOF
EXPECT=<<EOF
movs r0, r0
movs r0, r0
add byte [bx + si], al
EOF
RUN
NAME=reflines on last line
FILE=-
CMDS=<<EOF
e asm.arch=x86
e asm.bits=32
e scr.utf8=0
e asm.lines.bb=1
e asm.comments=0
wx 803d1ca0040833740ceb1c83c004a318a0088ffd2a118a00408b1085d275eb
pd 12~?=
pd 13~?=
EOF
EXPECT=<<EOF
3
3
EOF
RUN