* Split `rz_core_print_disasm_json` as: `rz_core_print_disasm_json` and `rz_core_disasm` * Use `rz_str_enc_string_as_type` in `ds_init` * Refactor `rz_core_print_disasm` and `rz_core_handle_backwards_disasm` * Add `rz_core_asm_bb_middle` * Move global `disasm_texts` to `RzDisasmState` * Rewrite `core_analysis_bytes_standard` with `rz_core_analysis_bytes` * Add `test_rz_core_print_disasm` and `test_rz_core_analysis_bytes` * Rewrite `rz_core_print_disasm` with `RzCmdStateOutput` * `pdi` -> `pdq` in tests * `pdi` -> `pDq` in tests * `pid` -> `pdq` in tests * `pId` -> `pDq` in tests * `pij` -> `pdj` in tests * `pIj` -> `pDj` in tests * `pdeqq` -> `pdeQ` in tests * Remove `pDJ` from `test/db/json/`
167 lines
3.6 KiB
Text
167 lines
3.6 KiB
Text
NAME=load 16 bits omf
|
|
FILE=bins/omf/hello_world
|
|
CMDS=iI~bits
|
|
EXPECT=<<EOF
|
|
bits 16
|
|
EOF
|
|
RUN
|
|
|
|
NAME=entry point 16 bits omf
|
|
FILE=bins/omf/hello_world
|
|
CMDS=ie:quiet
|
|
EXPECT=<<EOF
|
|
0x00001000 0x00000073 ---------- ---------- program
|
|
EOF
|
|
RUN
|
|
|
|
NAME=symbols 16 bits omf
|
|
FILE=bins/omf/hello_world
|
|
CMDS=is
|
|
EXPECT=<<EOF
|
|
nth paddr vaddr bind type size lib name
|
|
----------------------------------------------------
|
|
1 0x00000073 0x00001000 NONE NONE 0 _start
|
|
EOF
|
|
RUN
|
|
|
|
NAME=sections 16 bits omf
|
|
FILE=bins/omf/hello_world
|
|
CMDS=iS
|
|
EXPECT=<<EOF
|
|
paddr size vaddr vsize align perm name type flags
|
|
--------------------------------------------------------------
|
|
0x00000073 0x13 0x00001000 0x13 0x0 -rwx text_1
|
|
0x00000095 0xe 0x00001013 0xe 0x0 -rwx data_1
|
|
EOF
|
|
RUN
|
|
|
|
NAME=maps 16 bits omf
|
|
FILE=bins/omf/hello_world
|
|
CMDS=oml
|
|
EXPECT=<<EOF
|
|
1 fd: 3 +0x00000073 0x00001000 * 0x00001012 r-x fmap.text_1
|
|
2 fd: 3 +0x00000095 0x00001013 - 0x00001020 r-x fmap.data_1
|
|
EOF
|
|
RUN
|
|
|
|
NAME=sections 16 bits omf - content
|
|
FILE=bins/omf/hello_world
|
|
CMDS=px 16 @ section.text_1; px 16 @ section.data_1
|
|
EXPECT=<<EOF
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0000:1000 ba0e 00b9 0000 bb01 00b8 0400 cd80 b801 ................
|
|
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
0000:1013 4865 6c6c 6f2c 2077 6f72 6c64 210a ffff Hello, world!...
|
|
EOF
|
|
RUN
|
|
|
|
NAME=virtual address 16 bits omf
|
|
FILE=bins/omf/hello_world
|
|
CMDS=e asm.bytes=true;pdq 1~mov[1];
|
|
EXPECT=<<EOF
|
|
ba0e00
|
|
EOF
|
|
RUN
|
|
|
|
NAME=load 32 bits omf
|
|
FILE=bins/omf/hello_world32
|
|
CMDS=e asm.bytes=true; iI~bits;
|
|
EXPECT=<<EOF
|
|
bits 32
|
|
EOF
|
|
RUN
|
|
|
|
NAME=entry point 32 bits omf
|
|
FILE=bins/omf/hello_world32
|
|
CMDS=ie:quiet
|
|
EXPECT=<<EOF
|
|
0x00001000 0x00000074 ---------- ---------- program
|
|
EOF
|
|
RUN
|
|
|
|
NAME=symbols 32 bits omf
|
|
FILE=bins/omf/hello_world32
|
|
CMDS=is
|
|
EXPECT=<<EOF
|
|
nth paddr vaddr bind type size lib name
|
|
----------------------------------------------------
|
|
1 0x00000074 0x00001000 NONE NONE 0 _start
|
|
EOF
|
|
RUN
|
|
|
|
NAME=sections 32 bits omf
|
|
FILE=bins/omf/hello_world32
|
|
CMDS=iS
|
|
EXPECT=<<EOF
|
|
paddr size vaddr vsize align perm name type flags
|
|
---------------------------------------------------------------
|
|
0x00000074 0x1d 0x00001000 0x1d 0x0 -rwx .text_1
|
|
0x000000a3 0xe 0x0000101d 0xe 0x0 -rwx .data_1
|
|
EOF
|
|
RUN
|
|
|
|
NAME=maps 32 bits omf
|
|
FILE=bins/omf/hello_world32
|
|
CMDS=oml
|
|
EXPECT=<<EOF
|
|
1 fd: 3 +0x00000074 0x00001000 * 0x0000101c r-x fmap..text_1
|
|
2 fd: 3 +0x000000a3 0x0000101d - 0x0000102a r-x fmap..data_1
|
|
EOF
|
|
RUN
|
|
|
|
NAME=virtual address 32 bits omf
|
|
FILE=bins/omf/hello_world32
|
|
CMDS=e asm.bytes=true; pdq 1~mov[1]
|
|
EXPECT=<<EOF
|
|
ba0e000000
|
|
EOF
|
|
RUN
|
|
|
|
NAME=multiple symbols omf
|
|
FILE=bins/omf/multi_pubdef
|
|
CMDS=is
|
|
EXPECT=<<EOF
|
|
nth paddr vaddr bind type size lib name
|
|
-----------------------------------------------------------
|
|
1 0x00000084 0x00001000 NONE NONE 0 _start
|
|
2 0x00000097 0x00001013 NONE NONE 0 second_symbol
|
|
EOF
|
|
RUN
|
|
|
|
NAME=null checksum omf
|
|
FILE=bins/omf/null_checks
|
|
CMDS=is
|
|
EXPECT=<<EOF
|
|
nth paddr vaddr bind type size lib name
|
|
----------------------------------------------------
|
|
1 0x00000073 0x00001000 NONE NONE 0 _start
|
|
EOF
|
|
RUN
|
|
|
|
NAME=invalide index segment omf
|
|
FILE=bins/omf/invalid_idx
|
|
CMDS=q!
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=invalide string size pubdef record omf
|
|
FILE=bins/omf/invalid_str_pubdef
|
|
CMDS=q!
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=invalide string size lnames record omf
|
|
FILE=bins/omf/invalid_str_lname
|
|
CMDS=q!
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|
|
|
|
NAME=invalide record size omf
|
|
FILE=bins/omf/invalid_size
|
|
CMDS=q!
|
|
EXPECT=<<EOF
|
|
EOF
|
|
RUN
|