2015-10-19 03:58:16 +02:00
.Dd Oct 19 , 2015
2014-09-30 11:01:45 +02:00
.Dt RABIN2 1
2014-09-30 11:37:26 +02:00
.Sh NAME
.Nm RABIN2
.Nd Binary program info extractor
2009-04-15 11:09:36 +00:00
.Sh SYNOPSIS
2010-03-12 18:46:11 +01:00
.Nm rabin2
2015-07-06 01:08:14 +02:00
.Op Fl AceghHiIsSMzlpRrLxvh
2011-12-02 03:43:08 +01:00
.Op Fl a Ar arch
.Op Fl b Ar bits
.Op Fl B Ar addr
2015-07-06 01:08:14 +02:00
.Op Fl C Ar fmt:C:[D]
2015-07-07 00:38:51 +02:00
.Op Fl D Ar lang sym|-
2011-10-12 03:24:19 +02:00
.Op Fl f Ar subbin
2014-05-19 01:42:36 +02:00
.Op Fl k Ar query
2014-08-15 03:30:45 +02:00
.Op Fl K Ar algo
2015-11-30 00:10:28 +01:00
.Op Fl O Ar binop
2011-12-02 03:43:08 +01:00
.Op Fl o Ar str
.Op Fl m Ar addr
.Op Fl @ Ar addr
.Op Fl n Ar str
.Ar file
2009-04-15 11:09:36 +00:00
.Sh DESCRIPTION
This program allows you to get information about ELF/PE/MZ and CLASS files in a simple way.
.Bl -tag -width Fl
2014-08-06 23:39:23 +02:00
.It Fl @ Ar addr
Show information (symbol, section, import) of the given address
2011-12-02 03:43:08 +01:00
.It Fl A
2015-11-05 13:37:21 +01:00
List sub-binaries and their associated arch-bits pairs
2011-12-02 03:43:08 +01:00
.It Fl a Ar arch
Set arch (x86, arm, .. accepts underscore for bits x86_32)
.It Fl b Ar bits
Set bits (32, 64, ...)
.It Fl B Ar addr
Override baddr
2015-07-06 01:08:14 +02:00
.It Fl c
2011-12-02 03:43:08 +01:00
List classes
2015-07-06 01:08:14 +02:00
.It Fl C Ar [fmt:C[:D]]
Create [elf,mach0,pe] for arm and x86-32/64 tiny binaries where 'C' is an hexpair list of the code bytes and ':D' is an optional concatenation to describe the bytes for the data section.
2014-08-06 23:39:23 +02:00
.It Fl d
Show debug/dwarf information
2015-07-07 00:38:51 +02:00
.It Fl D Ar lang symbolname|-
Demangle symbol name (or - to read from stdin) for lang (cxx, swift, java, cxx, ..)
2009-04-15 11:09:36 +00:00
.It Fl e
Show entrypoints for disk and on-memory
2011-12-02 03:43:08 +01:00
.It Fl f Ar subbin
Select sub-binary architecture. Useful for fat-mach0 binaries
2013-11-09 03:42:20 +01:00
.It Fl g
2014-08-06 23:39:23 +02:00
Show all possible information
.It Fl h
Show usage help message.
.It Fl H
Show header fields
.It Fl I
Show binary info
2009-04-15 11:09:36 +00:00
.It Fl i
2011-12-02 03:43:08 +01:00
Show imports (symbols imported from libraries)
2014-08-06 23:39:23 +02:00
.It Fl j
Output in json
2014-05-19 01:42:36 +02:00
.It Fl k Ar query
Perform SDB query on loaded file
2014-08-15 03:30:45 +02:00
.It Fl K Ar algo
2014-09-04 23:13:43 +02:00
Select a rahash2 checksum algorithm to be performed on sections listing (and maybe others in the future) i.e 'rabin2 -K md5 -S /bin/ls'
2009-04-15 11:09:36 +00:00
.It Fl l
List linked libraries to the binary
2014-08-06 23:39:23 +02:00
.It Fl L
List supported bin plugins
.It Fl M
Show address of 'main' symbol
.It Fl m Ar addr
Show source line reference from a given address
2014-10-21 04:39:37 +02:00
.It Fl N Ar minlen:maxlen
Force minimum and maximum number of chars per string (see -z and -zz). if (strlen>minlen && (!maxlen || strlen<=maxlen))
2014-08-06 23:39:23 +02:00
.It Fl n Ar str
Show information (symbol, section, import) at string offset
2011-12-02 03:43:08 +01:00
.It Fl o Ar str
Output file/folder for write operations (out by default)
2015-11-30 00:10:28 +01:00
.It Fl O Ar binop
Perform binary operation on target binary (dump, resize, change sections, ...) see '-O help' for more information
2014-08-24 10:41:32 +02:00
.It Fl p
Disable VA. Show physical addresses
2014-08-06 23:39:23 +02:00
.It Fl q
Be quiet, just show fewer data
.It Fl R
Show realocations
2009-04-15 11:09:36 +00:00
.It Fl r
Show output in radare format
2014-08-06 23:39:23 +02:00
.It Fl s
Show exported symbols
.It Fl S
Show sections
2009-04-15 11:09:36 +00:00
.It Fl v
2014-08-23 02:40:24 +02:00
Show version information
2011-12-02 03:43:08 +01:00
.It Fl x
Extract all sub binaries from a fat binary (f.ex: fatmach0)
2014-08-06 23:39:23 +02:00
.It Fl z
Show strings inside .data section (like gnu strings does)
.It Fl Z
Guess size of binary program
.It Fl zz
Shows strings from raw bins
2009-04-15 11:09:36 +00:00
.El
2015-10-06 20:52:50 -04:00
.Sh ENVIRONMENT
.Pp
2015-10-19 13:21:12 +02:00
RABIN2_LANG same as r2 -e bin.lang for rabin2
.Pp
2015-10-19 03:28:22 +02:00
RABIN2_DEMANGLE demangle symbols
.Pp
2015-10-06 20:52:50 -04:00
RABIN2_MAXSTRBUF same as r2 -e bin.maxstrbuf for rabin2
2015-10-13 03:50:14 +02:00
.Pp
RABIN2_STRFILTER same as r2 -e bin.strfilter for rabin2
.Pp
RABIN2_STRPURGE same as r2 -e bin.strpurge for rabin2
2012-10-22 02:28:42 +02:00
.Sh EXAMPLES
.Pp
List symbols of a program
.Pp
2013-04-16 19:54:26 +02:00
$ rabin2 \- s a.out
2012-10-22 02:28:42 +02:00
.Pp
Get offset of symbol
.Pp
2013-04-16 19:54:26 +02:00
$ rabin2 \- n _main a.out
2012-10-22 02:28:42 +02:00
.Pp
Get entrypoint
.Pp
2013-04-16 19:54:26 +02:00
$ rabin2 \- e a.out
2012-10-22 02:28:42 +02:00
.Pp
2014-08-23 02:40:24 +02:00
Load symbols and imports from radare2
2012-10-22 02:28:42 +02:00
.Pp
2014-08-23 02:40:24 +02:00
$ r2 -n /bin/ls
2014-08-24 10:41:32 +02:00
[0x00000000]> .!rabin2 \- prsi $FILE
2009-04-15 11:09:36 +00:00
.Sh SEE ALSO
.Pp
2010-03-12 18:46:11 +01:00
.Xr rahash2(1) ,
2011-07-19 10:45:47 +02:00
.Xr rafind2(1) ,
2010-03-12 18:46:11 +01:00
.Xr radare2(1) ,
.Xr radiff2(1) ,
.Xr rasm2(1) ,
.Xr rax2(1) ,
2011-07-19 10:45:47 +02:00
.Xr rsc2(1) ,
2011-10-12 03:24:19 +02:00
.Xr ragg2(1) ,
.Xr rarun2(1) ,
2009-04-15 11:09:36 +00:00
.Sh AUTHORS
.Pp
2013-12-31 23:52:46 -08:00
Written by pancake <pancake@nopcode.org>.