Rizin
unix-like reverse engineering framework and cli tools
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
b
d
e
h
i
k
n
p
r
s
w
Properties
Events
Related Functions
Files
File List
File Members
All
$
.
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
.
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
▼
Rizin
Clone the Rizin project and keep it updated
Contributor Covenant Code of Conduct
How to report issues
DEVELOPERS
README
AVR (arduino, atmega128, ..)
Brainfuck support for rizin
Calling Conventions profiles
Cross-compilation
Rizin Debugger Internals
Conditional breakpoints
ESIL
FLIRT
Connecting rizin with gdb
What is GProbe?
Packaging
RAP protocol
Release process
RzIL
Command parsing and command handling
SIOL - Simple IO Layer
WinDBG
Install Rizin
README
SDB (string database)
Security Policy
README
Capstone Engine
COMPILE
Xcode Project for Capstone
Rizin libdemangle
cabextract
CONTRIBUTING
Project Maintainers
README
Supported platforms
libzip API changes
INSTALL
NEWS
README
Security Policy
Before next release
Projects for various integrated development environments (IDE)
gen_manual - a program for automatic generation of manual from source code
Meson build system for lz4
Snap Packaging
LZ4 Block Format Description
LZ4 Frame Format Description
LZ4 Streaming API Example : Double Buffer
LZ4 Streaming API Example : Line by Line Text Compression
LZ4 API Example : Dictionary Random Access
LZ4 examples
LZ4 Streaming API Basics
LZ4 Windows binary package
LZ4 - Library Files
lz4(1) – lz4, unlz4, lz4cat - Compress or decompress .lz4 files
Command Line Interface for LZ4 library
LZ4 - Extremely fast compression
Programs and scripts for automated testing of LZ4
LICENSE
ptrace-wrap
rizin-shell-parser
spp
<tt>tree-sitter-config</tt>
<tt>tree-sitter-loader</tt>
Tree-sitter CLI
CONTRIBUTING\ilineb
index\ilineb
section-2-using-parsers\ilineb
section-3-creating-parsers\ilineb
section-4-syntax-highlighting\ilineb
section-5-implementation\ilineb
section-6-contributing\ilineb
section-8-code-navigation-systems\ilineb
<tt>tree-sitter-highlight</tt>
Rust Tree-sitter
Web Tree-sitter
Subdirectories
ICU Parts
tree-sitter
<tt>tree-sitter-tags</tt>
tree-sitter-c
tree-sitter-c
xxHash - Extremely fast hash algorithm
Todo List
►
Modules
►
Namespaces
►
Classes
▼
Files
►
File List
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Events
Friends
Macros
Modules
Pages
rz-run.c
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2011-2020 pancake <pancake@nopcode.org>
2
// SPDX-License-Identifier: LGPL-3.0-only
3
4
#include <
rz_util.h
>
5
#include <
rz_main.h
>
6
#include <
rz_socket.h
>
7
8
#if __UNIX__
9
static
void
fwd(
int
sig) {
10
/* do nothing? send kill signal to remote process */
11
}
12
13
static
void
rz_run_tty(
void
) {
14
/* TODO: Implement in native code */
15
rz_sys_xsystem
(
"tty"
);
16
close
(1);
17
dup2
(2, 1);
18
rz_sys_signal
(SIGINT, fwd);
19
for
(;;) {
20
sleep(1);
21
}
22
}
23
#endif
24
25
RZ_API
int
rz_main_rz_run
(
int
argc,
const
char
**
argv
) {
26
RzRunProfile
*
p
;
27
int
i
, ret;
28
if
(argc == 1 || !strcmp(
argv
[1],
"-h"
)) {
29
printf
(
"Usage: rz-run -v|-t|script.rr2 [directive ..]\n"
);
30
printf
(
"%s"
,
rz_run_help
());
31
return
1;
32
}
33
if
(!strcmp(
argv
[1],
"-v"
)) {
34
return
rz_main_version_print
(
"rz-run"
);
35
}
36
const
char
*
file
=
argv
[1];
37
if
(!strcmp(
file
,
"-t"
)) {
38
#if __UNIX__
39
rz_run_tty();
40
return
0;
41
#else
42
eprintf
(
"Not supported\n"
);
43
return
1;
44
#endif
45
}
46
if
(*
file
&& !strchr(
file
,
'='
)) {
47
p
=
rz_run_new
(
file
);
48
}
else
{
49
bool
noMoreDirectives =
false
;
50
int
directiveIndex = 0;
51
p
=
rz_run_new
(
NULL
);
52
for
(
i
= *
file
? 1 : 2;
i
< argc;
i
++) {
53
if
(!strcmp(
argv
[
i
],
"--"
)) {
54
noMoreDirectives =
true
;
55
continue
;
56
}
57
if
(noMoreDirectives) {
58
const
char
*word =
argv
[
i
];
59
char
*
line
= directiveIndex
60
?
rz_str_newf
(
"arg%d=%s"
, directiveIndex, word)
61
:
rz_str_newf
(
"program=%s"
, word);
62
rz_run_parseline
(
p
,
line
);
63
directiveIndex++;
64
free
(
line
);
65
}
else
{
66
rz_run_parseline
(
p
,
argv
[
i
]);
67
}
68
}
69
}
70
if
(!
p
) {
71
return
1;
72
}
73
ret =
rz_run_config_env
(
p
);
74
if
(ret) {
75
printf
(
"error while configuring the environment.\n"
);
76
rz_run_free
(
p
);
77
return
1;
78
}
79
ret =
rz_run_start
(
p
);
80
rz_run_free
(
p
);
81
return
ret;
82
}
i
lzma_index ** i
Definition:
index.h:629
RZ_API
#define RZ_API
Definition:
core_plugin_example.c:36
NULL
#define NULL
Definition:
cris-opc.c:27
printf
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition:
cs_driver.c:93
close
static static fork const void static count close
Definition:
sflib.h:33
free
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition:
ht_inc.c:130
p
void * p
Definition:
libc.cpp:67
rz_main_rz_run
RZ_API int rz_main_rz_run(int argc, const char **argv)
Definition:
rz-run.c:25
argv
static static fork const void static count static fd const char const char static newpath char char argv
Definition:
sflib.h:40
dup2
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname unsigned long static filedes void static end_data_segment static handler static getegid char static len static pgid const char static path dup2
Definition:
sflib.h:94
setup.line
line
Definition:
setup.py:34
eprintf
#define eprintf(x, y...)
Definition:
rlcc.c:7
rz_main.h
rz_main_version_print
RZ_API int rz_main_version_print(const char *program)
Definition:
main.c:49
rz_socket.h
rz_run_free
RZ_API void rz_run_free(RzRunProfile *r)
Definition:
run.c:122
rz_run_new
RZ_API RzRunProfile * rz_run_new(const char *str)
Definition:
run.c:86
rz_run_help
RZ_API const char * rz_run_help(void)
Definition:
run.c:630
rz_run_parseline
RZ_API bool rz_run_parseline(RzRunProfile *p, const char *b)
Definition:
run.c:479
rz_run_start
RZ_API int rz_run_start(RzRunProfile *p)
Definition:
run.c:1081
rz_run_config_env
RZ_API int rz_run_config_env(RzRunProfile *p)
Definition:
run.c:809
rz_str_newf
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
rz_sys_xsystem
#define rz_sys_xsystem(cmd)
Definition:
rz_sys.h:83
rz_sys_signal
RZ_API int rz_sys_signal(int sig, void(*handler)(int))
Definition:
sys.c:178
rz_util.h
file
Definition:
gzappend.c:170
rz_run_profile_t
Definition:
rz_socket.h:212
librz
main
rz-run.c
Generated by
1.9.1