rabin2 is the command-line front-end of the file analysis library in radare2. These commands are equivalent to the i (info) module. For more information on file analysis, see the Binary Info — The I Module page.
We will use the -i and -E flags for imports and exports. These intentionally match the ii and iE commands inside radare2.
; Importsrabin2 -i ./args[Imports]nth vaddr bind type lib name―――――――――――――――――――――――――――――――――――――1 0x08049040 GLOBAL FUNC __libc_start_main2 0x08049050 GLOBAL FUNC fflush3 0x08049060 GLOBAL FUNC gets4 0x08049070 GLOBAL FUNC puts5 0x08049080 GLOBAL FUNC system6 ---------- WEAK NOTYPE __gmon_start__7 ---------- GLOBAL OBJ stdout; Exportsrabin2 -E ./args[Exports]nth paddr vaddr bind type size lib name demangled――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――8 0x00002004 0x0804a004 GLOBAL OBJ 4 _IO_stdin_used19 0x000010e0 0x080490e0 GLOBAL FUNC 4 __x86.get_pc_thunk.bx23 ---------- 0x0804c028 GLOBAL NOTYPE 0 _edata24 0x00001258 0x08049258 GLOBAL FUNC 0 _fini25 0x00003020 0x0804c020 GLOBAL NOTYPE 0 __data_start29 0x00003024 0x0804c024 GLOBAL OBJ 0 __dso_handle30 0x00002004 0x0804a004 GLOBAL OBJ 4 _IO_stdin_used31 0x000011a6 0x080491a6 GLOBAL FUNC 73 win32 ---------- 0x0804c02c GLOBAL NOTYPE 0 _end33 0x000010d0 0x080490d0 GLOBAL FUNC 5 _dl_relocate_static_pie34 0x00001090 0x08049090 GLOBAL FUNC 49 _start35 0x00002000 0x0804a000 GLOBAL OBJ 4 _fp_hw37 ---------- 0x0804c028 GLOBAL NOTYPE 0 __bss_start38 0x0000123c 0x0804923c GLOBAL FUNC 24 main39 0x00001254 0x08049254 GLOBAL FUNC 0 __x86.get_pc_thunk.ax40 0x000011ef 0x080491ef GLOBAL FUNC 77 read_in41 ---------- 0x0804c028 GLOBAL OBJ 0 __TMC_END__42 0x00001000 0x08049000 GLOBAL FUNC 0 _initSymbols and strings will be found using the -s and -z flag. This mimics doing is and iz inside radare2.
; Symbolsrabin2 -s ./args[Symbols]nth paddr vaddr bind type size lib name demangled―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――8 0x00002004 0x0804a004 GLOBAL OBJ 4 _IO_stdin_used1 ---------- 0x00000000 LOCAL FILE 0 crt1.o2 0x000001cc 0x080481cc LOCAL OBJ 32 __abi_tag3 ---------- 0x00000000 LOCAL FILE 0 crtstuff.c4 0x000010f0 0x080490f0 LOCAL FUNC 0 deregister_tm_clones5 0x00001130 0x08049130 LOCAL FUNC 0 register_tm_clones6 0x00001170 0x08049170 LOCAL FUNC 0 __do_global_dtors_aux7 ---------- 0x0804c028 LOCAL OBJ 1 completed.08 0x00002f0c 0x0804bf0c LOCAL OBJ 0 __do_global_dtors_aux_fini_array_entry9 0x000011a0 0x080491a0 LOCAL FUNC 0 frame_dummy10 0x00002f08 0x0804bf08 LOCAL OBJ 0 __frame_dummy_init_array_entry11 ---------- 0x00000000 LOCAL FILE 0 args.c12 ---------- 0x00000000 LOCAL FILE 0 crtstuff.c13 0x0000215c 0x0804a15c LOCAL OBJ 0 __FRAME_END__14 ---------- 0x00000000 LOCAL FILE 015 0x00002f10 0x0804bf10 LOCAL OBJ 0 _DYNAMIC16 0x00002038 0x0804a038 LOCAL NOTYPE 0 __GNU_EH_FRAME_HDR17 0x00003000 0x0804c000 LOCAL OBJ 0 _GLOBAL_OFFSET_TABLE_19 0x000010e0 0x080490e0 GLOBAL FUNC 4 __x86.get_pc_thunk.bxUse the -S flag for program sections. This mimics the iS command inside radare2.
rabin2 -S ./args[Sections]nth paddr size vaddr vsize perm type name―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――0 0x00000000 0x0 0x00000000 0x0 ---- NULL1 0x00000194 0x13 0x08048194 0x13 -r-- PROGBITS .interp2 0x000001a8 0x24 0x080481a8 0x24 -r-- NOTE .note.gnu.build-id3 0x000001cc 0x20 0x080481cc 0x20 -r-- NOTE .note.ABI-tag4 0x000001ec 0x20 0x080481ec 0x20 -r-- GNU_HASH .gnu.hash5 0x0000020c 0x90 0x0804820c 0x90 -r-- DYNSYM .dynsym6 0x0000029c 0x6f 0x0804829c 0x6f -r-- STRTAB .dynstr7 0x0000030c 0x12 0x0804830c 0x12 -r-- GNU_VERSYM .gnu.version8 0x00000320 0x30 0x08048320 0x30 -r-- GNU_VERNEED .gnu.version_r9 0x00000350 0x10 0x08048350 0x10 -r-- REL .rel.dyn10 0x00000360 0x28 0x08048360 0x28 -r-- REL .rel.plt11 0x00001000 0x24 0x08049000 0x24 -r-x PROGBITS .init12 0x00001030 0x60 0x08049030 0x60 -r-x PROGBITS .plt13 0x00001090 0x1c8 0x08049090 0x1c8 -r-x PROGBITS .text14 0x00001258 0x18 0x08049258 0x18 -r-x PROGBITS .fini15 0x00002000 0x37 0x0804a000 0x37 -r-- PROGBITS .rodata16 0x00002038 0x44 0x0804a038 0x44 -r-- PROGBITS .eh_frame_hdr17 0x0000207c 0xe4 0x0804a07c 0xe4 -r-- PROGBITS .eh_frame18 0x00002f08 0x4 0x0804bf08 0x4 -rw- INIT_ARRAY .init_arrayrabin2 -hUsage: rabin2 [-AcdeEghHiIjlLMqrRsSUvVxzZ] [-@ at] [-a arch] [-b bits] [-B addr] [-C F:C:D] [-f str] [-m addr] [-n str] [-N m:M] [-P[-P] pdb] [-o str] [-O str] [-k query] [-D lang mangledsymbol] file -@ [addr] show section, symbol or import at addr -A list sub-binaries and their arch-bits pairs -a [arch] set arch (x86, arm, .. or <arch>_<bits>) -b [bits] set bits (32, 64 ...) -B [addr] override base address (pie bins) -c list classes -cc list classes in header format -C [fmt:C:D] create [elf,mach0,pe] with Code and Data hexpairs (see -a) -d show debug/dwarf information -D lang name demangle symbol name (-D all for bin.demangle=true) -e program entrypoint -ee constructor/destructor entrypoints -E globally exportable symbols -f [str] select sub-bin named str -F [binfmt] force to use that bin plugin (ignore header check) -g same as -SMZIHVResizcld -SS -SSS -ee (show all info) -G [addr] load address . offset to header -h this help message -H header fields -i imports (symbols imported from libraries) -I binary info -j output in json