rizin/test/db/io/baddr
Riccardo Schirone 1c78aee3cd
Convert i commands to rzshell (#1238)
* Start to create some RzBinObject specific API

Adding some unit tests

Fix for new relocs storage system

Fix test_bin unit test for oob-write

* Add `iA` command to newshell

Add `ie`/`iee` commands

Add support for `is`/`iE` commands

Add support for `ii` command

Add support for `il` command

Add support for `iM` command

Add support for `ir` command

Add support for `iS`/`iSS` commands

Add support for `iz` command

Add support for `i` command

Add support for `ic` command

Add support for `iC` command

Add support for `ih` and `iHH` commands

Add support for `iI` command

Add support for `iL` command

Fix descriptions of commands already converted

Add support for `idp` commands

Add support for `iD` command

Add support for `im` commands

Add support for `iR` command

Add support for `it` command

Add support for `iV` commands

Add support for `iw` command

Add support for `ix` commands

Add support for `iZ` command

Add support for `ik` command

Add support for `is.` command

Add support for `iS.` command

Reduce arguments in print_arch

Few Doxygen and ownership annotations

Add support for `iS=` command

Add support for `izz` and `izzz` commands

Add support for `ib` command

Add support for `ic*` command

Put section flags as the last field of the table

* Proper language detection.

* Rewritten blang.c

* implemented `icc/icm/icf <class name>`

* ignore blocks when printing langs

Remove num from `iA` output

* Fixed flags on java and added class column

Add support for `ia` commands

Fix `iCj` command

* RzBin: add rz_bin_object_sections_mapping_list API

* Fix rz-bin for new API

Remove unused va var in rz-bin.c

Fix `iA`/`-A` output

* implemented classdump_cpp

* Support namespaces

Use `icc`, `icl` does not exist anymore

Update output of broken tests for `icc`

Add `rz_return_*()` asserts in new `*_print()` functions

* Provide rz_core_bin_print API

* Select which parts to print also based on the mode

* Return bool from all `rz_core_bin_*_print()` API

* Use RzBinFile in new `rz_core_bin_*_print()` API

* Restore `dbg_dmi` test

* Remove oldshell handlers for `i` commands

* Remove `ieq` call in rizin, not needed

* Allow NULL `bf` in `rz_cmd_info_handler()`

* Re-add support for RZ_BIN_PREFIX for symbols/sections/segments/imports/relocs

* Move `ib` command to `obR`

* Show 'N/A' in `i` command when info are not available

* Assert on bf->o, just to be sure

* Make error messages clearer in `idp` commands

Co-authored-by: wargio <wargio@libero.it>
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
2021-09-04 22:37:05 +08:00

110 lines
1.9 KiB
Text

NAME=1: io.baddr
FILE=bins/elf/analysis/pie
CMDS=?v entry0
EXPECT=<<EOF
0x450
EOF
RUN
NAME=2: io.baddr
FILE=bins/elf/analysis/pie
ARGS=-B 0xf00000
CMDS=?v entry0
EXPECT=<<EOF
0xf00450
EOF
RUN
NAME=io.baddr entry0 data
FILE=bins/elf/analysis/pie
CMDS=<<EOF
ie:paddr:quiet
ie:vaddr:quiet
p8 10 @ 0x00000450
EOF
EXPECT=<<EOF
0x00000450
0x00000450
31ed5e89e183e4f05054
EOF
RUN
NAME=io.baddr -B entry0 data
FILE=bins/elf/analysis/pie
ARGS=-B 0x100000
CMDS=p8 10 @ 0x00100450
EXPECT=<<EOF
31ed5e89e183e4f05054
EOF
RUN
NAME=io.baddr -x86_32 entry0 data
FILE=bins/mach0/fatmach0-3true
ARGS=-a x86 -b 32
CMDS=<<EOF
ie:paddr:quiet
ie:vaddr:quiet
p8 10 @ 0x00001f44
p8 10 @ 0x00005f44
EOF
EXPECT=<<EOF
0x00005f44
0x00001f44
6a0089e583e4f083ec10
6a0089e583e4f083ec10
EOF
RUN
NAME=4: io.baddr
FILE=bins/elf/analysis/pie
ARGS=-B 0xf00000
CMDS=<<EOF
p8 10 @ 0x00f00450
EOF
EXPECT=<<EOF
31ed5e89e183e4f05054
EOF
RUN
NAME=e bin.baddr
FILE=bins/elf/analysis/hello-linux-x86_64
CMDS=?v `e bin.baddr`
EXPECT=<<EOF
0x400000
EOF
RUN
NAME=e bin.baddr changed
FILE=bins/elf/analysis/hello-linux-x86_64
ARGS=-B 0xf00000
CMDS=?v `e bin.baddr`
EXPECT=<<EOF
0xf00000
EOF
RUN
NAME=bin.baddr and anal
FILE=bins/elf/analysis/pie
ARGS=-B 0xf00000
CMDS=<<EOF
aaa
afl~$
EOF
EXPECT=<<EOF
0x00f003ec 3 35 sym._init
0x00f00420 1 6 sym.imp.__cxa_finalize
0x00f00430 1 6 loc.imp.__gmon_start
0x00f00440 1 6 sym.imp.__libc_start_main
0x00f00450 1 49 entry0
0x00f00482 1 4 fcn.00f00482
0x00f00490 1 4 sym.__x86.get_pc_thunk.bx
0x00f004a0 4 61 sym.deregister_tm_clones
0x00f004e0 4 71 sym.register_tm_clones
0x00f00530 5 71 sym.__do_global_dtors_aux
0x00f00580 4 69 -> 60 entry.init0
0x00f005c5 1 4 main
0x00f005d0 4 97 sym.__libc_csu_init
0x00f00640 1 2 sym.__libc_csu_fini
0x00f00644 1 20 sym._fini
EOF
RUN