forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrasm2.1
115 lines (115 loc) · 2.3 KB
/
rasm2.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.Dd Sep 30, 2014
.Dt RASM2 1
.Sh NAME
.Nm rasm2
.Nd radare2 assembler and disassembler tool
.Sh SYNOPSIS
.Nm rasm2
.Op Fl ABdDeEfCLvw
.Op Fl a Ar arch
.Op Fl b Ar bits
.Op Fl c Ar cpu
.Op Fl F Ar in:out
.Op Fl o Ar offset
.Op Fl O Ar ofile
.Op Fl s Ar syntax
.Op Fl i Ar int
.Op Fl l Ar int
.Op ARG
.Sh DESCRIPTION
This tool uses r_asm to assemble and disassemble files or hexpair strings. It supports a large list of architectures which can be listed using the \-L flag.
.Pp
.Bl -tag -width Fl
.It Fl a Ar arch
Set architecture plugin
.It Fl A
Show analysis information of given hexpair string
.It Fl b Ar bits
Set architecture bits
.It Fl B
Binary input/output (\-l is mandatory for binary input)
.It Fl c Ar cpu
Select specific CPU (depends on \-a arch)
.It Fl C
Output in C format
.It Fl d
Disassemble hexpair bytes. rasm2 \-d 9090
.It Fl D
Disassemble showing hexpair and opcode
.It Fl e
Use big endian (or swap endianness if used more than once)
.It Fl E
Output disassembled instructions in ESIL format.
.It Fl f
Read data from file instead of ARG.
.It Fl F Ar in:out
Specify input and/or output filters (att2intel, x86.pseudo, ...)
.It Fl h
Show usage help message.
.It Fl l Ar int
Input/Output length
.It Fl i Ar int
Ignore/skip N bytes from the beginning of the input buffer
.It Fl L
List supported asm plugins
.It Fl o Ar offset
Offset of the opcode to assemble (default is 0)
.It Fl O Ar ofile
output to file, for example 'rasm2 \-BF a a.asm'
.It Fl s Ar syntax
Select syntax output (intel, att)
.It Fl w
Describe opcode (whats op)
.El
.Sh different than filename
.Pp
.Bl -tag -width Fl
.It Fl .intel_syntax
Use intel syntax rather than att:w
.It Fl .att_syntax
Use ATT syntax rather than flu :w
dentify the region fof aslerrger
.It Fl string
dentify the region fof aslerrger
.It Fl .ascii
.It Fl .align
.It Fl .arm
.It Fl .thumb
.It Fl .arch
.It Fl .bits
.It Fl .fill
.It Fl .kernel
.It Fl .os
.It Fl .hex
.It Fl .int16
.It Fl .short
.It Fl .int32
.It Fl .int64
.It Fl .glob
.It Fl .equ
.It Fl .org
.It Fl .text
.It Fl .data
.El
.Sh EXAMPLES
.Pp
Assemble opcode:
.Pp
$ rasm2 \-a x86 \-b 32 'mov eax, 33'
.Pp
Disassemble opcode:
.Pp
$ rasm2 \-d 90
.Sh SEE ALSO
.Pp
.Xr radare2(1) ,
.Xr rafind2(1) ,
.Xr rahash2(1) ,
.Xr rabin2(1) ,
.Xr radiff2(1) ,
.Xr ragg2(1) ,
.Xr rarun2(1) ,
.Xr rax2(1) ,
.Sh AUTHORS
.Pp
pancake <[email protected]>