2016-02-25 09:28:54 +00:00
|
|
|
/* radare - LGPL - Copyright 2009-2016 - pancake */
|
2011-10-18 07:38:20 +00:00
|
|
|
|
2014-03-27 15:34:17 +00:00
|
|
|
#ifndef R2_CORE_H
|
|
|
|
#define R2_CORE_H
|
2009-02-05 21:08:46 +00:00
|
|
|
|
|
|
|
#include "r_types.h"
|
2011-09-09 23:30:03 +00:00
|
|
|
#include "r_magic.h"
|
2009-02-05 21:08:46 +00:00
|
|
|
#include "r_io.h"
|
2011-01-11 23:01:06 +00:00
|
|
|
#include "r_fs.h"
|
2009-02-05 21:08:46 +00:00
|
|
|
#include "r_lib.h"
|
2013-06-15 00:56:25 +00:00
|
|
|
#include "r_diff.h"
|
2011-10-04 08:10:00 +00:00
|
|
|
#include "r_egg.h"
|
2009-02-05 21:08:46 +00:00
|
|
|
#include "r_lang.h"
|
2009-02-20 15:29:12 +00:00
|
|
|
#include "r_asm.h"
|
2009-02-24 14:58:21 +00:00
|
|
|
#include "r_parse.h"
|
2009-02-15 23:57:03 +00:00
|
|
|
#include "r_anal.h"
|
2009-02-05 21:08:46 +00:00
|
|
|
#include "r_cmd.h"
|
|
|
|
#include "r_cons.h"
|
|
|
|
#include "r_print.h"
|
2009-02-09 00:54:09 +00:00
|
|
|
#include "r_search.h"
|
2010-04-08 10:29:47 +00:00
|
|
|
#include "r_sign.h"
|
2009-02-05 21:08:46 +00:00
|
|
|
#include "r_debug.h"
|
|
|
|
#include "r_flags.h"
|
|
|
|
#include "r_config.h"
|
2009-03-08 17:29:21 +00:00
|
|
|
#include "r_bin.h"
|
2011-07-13 15:41:26 +00:00
|
|
|
#include "r_hash.h"
|
2011-03-21 00:47:17 +00:00
|
|
|
#include "r_socket.h"
|
2013-12-11 11:38:56 +00:00
|
|
|
#include "r_util.h"
|
2013-06-14 00:51:33 +00:00
|
|
|
#include "r_crypto.h"
|
2014-10-30 21:58:51 +00:00
|
|
|
#include "r_bind.h"
|
2013-06-14 00:51:33 +00:00
|
|
|
|
2013-06-18 10:09:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-06-14 00:51:33 +00:00
|
|
|
R_LIB_VERSION_HEADER(r_core);
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2010-02-28 21:58:21 +00:00
|
|
|
#define R_CORE_CMD_EXIT -2
|
2013-10-27 01:34:31 +00:00
|
|
|
#define R_CORE_BLOCKSIZE 0x100
|
2014-01-04 01:15:27 +00:00
|
|
|
#define R_CORE_BLOCKSIZE_MAX 0x3200000 /* 32MB */
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2014-04-26 23:17:30 +00:00
|
|
|
#define R_CORE_ANAL_GRAPHLINES 1
|
|
|
|
#define R_CORE_ANAL_GRAPHBODY 2
|
|
|
|
#define R_CORE_ANAL_GRAPHDIFF 4
|
|
|
|
#define R_CORE_ANAL_JSON 8
|
|
|
|
#define R_CORE_ANAL_KEYVALUE 16
|
2010-03-19 03:32:42 +00:00
|
|
|
|
2010-08-24 09:58:09 +00:00
|
|
|
/* rtr */
|
|
|
|
#define RTR_PROT_RAP 0
|
|
|
|
#define RTR_PROT_TCP 1
|
|
|
|
#define RTR_PROT_UDP 2
|
2013-02-06 09:35:23 +00:00
|
|
|
#define RTR_PROT_HTTP 3
|
2010-08-24 09:58:09 +00:00
|
|
|
|
|
|
|
#define RTR_RAP_OPEN 0x01
|
|
|
|
#define RTR_RAP_CMD 0x07
|
|
|
|
#define RTR_RAP_REPLY 0x80
|
|
|
|
|
|
|
|
#define RTR_MAX_HOSTS 255
|
|
|
|
|
2014-01-09 00:09:40 +00:00
|
|
|
#define R_CORE_CMD_DEPTH 10
|
|
|
|
|
2010-08-24 09:58:09 +00:00
|
|
|
typedef struct r_core_rtr_host_t {
|
|
|
|
int proto;
|
|
|
|
char host[512];
|
|
|
|
int port;
|
|
|
|
char file[1024];
|
2011-03-21 00:47:17 +00:00
|
|
|
RSocket *fd;
|
2010-08-24 09:58:09 +00:00
|
|
|
} RCoreRtrHost;
|
2012-12-23 12:52:57 +00:00
|
|
|
|
|
|
|
typedef struct r_core_log_t {
|
|
|
|
int first;
|
|
|
|
int last;
|
|
|
|
RStrpool *sp;
|
|
|
|
} RCoreLog;
|
2010-08-24 09:58:09 +00:00
|
|
|
|
2010-01-12 01:12:18 +00:00
|
|
|
typedef struct r_core_file_t {
|
2011-02-07 08:46:01 +00:00
|
|
|
RIOMap *map;
|
2009-02-18 00:43:57 +00:00
|
|
|
int dbg;
|
2014-05-28 02:34:12 +00:00
|
|
|
RIODesc *desc;
|
2014-01-20 02:29:50 +00:00
|
|
|
RBinBind binb;
|
2014-04-23 04:02:46 +00:00
|
|
|
const struct r_core_t *core;
|
|
|
|
ut8 alive;
|
2010-01-26 00:28:33 +00:00
|
|
|
} RCoreFile;
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2016-03-14 20:12:54 +00:00
|
|
|
typedef struct r_core_times_t {
|
2016-03-18 12:39:45 +00:00
|
|
|
ut64 loadlibs_init_time;
|
|
|
|
ut64 loadlibs_time;
|
|
|
|
ut64 file_open_time;
|
2016-03-14 20:12:54 +00:00
|
|
|
} RCoreTimes;
|
|
|
|
|
2011-02-15 15:19:18 +00:00
|
|
|
#define R_CORE_ASMSTEPS 128
|
2015-10-08 18:00:31 +00:00
|
|
|
#define R_CORE_ASMQJMPS_NUM 10
|
|
|
|
#define R_CORE_ASMQJMPS_LETTERS 26
|
|
|
|
#define R_CORE_ASMQJMPS_MAX_LETTERS (26 * 26 * 26 * 26 * 26)
|
|
|
|
#define R_CORE_ASMQJMPS_LEN_LETTERS 5
|
2011-02-15 15:19:18 +00:00
|
|
|
typedef struct r_core_asmsteps_t {
|
|
|
|
ut64 offset;
|
|
|
|
int cols;
|
|
|
|
} RCoreAsmsteps;
|
|
|
|
|
2010-01-12 01:12:18 +00:00
|
|
|
typedef struct r_core_t {
|
2012-09-18 01:39:32 +00:00
|
|
|
RBin *bin;
|
|
|
|
RConfig *config;
|
2010-01-12 01:12:18 +00:00
|
|
|
ut64 offset;
|
2009-07-08 11:49:55 +00:00
|
|
|
ut32 blocksize;
|
2012-04-21 12:28:53 +00:00
|
|
|
ut32 blocksize_max;
|
2009-07-08 11:49:55 +00:00
|
|
|
ut8 *block;
|
2013-02-06 09:35:23 +00:00
|
|
|
ut8 *oobi; /* out of band input ; used for multiline or file input */
|
2014-09-20 12:43:18 +00:00
|
|
|
int oobi_len;
|
2014-03-20 16:59:08 +00:00
|
|
|
RBuffer *yank_buf;
|
2012-09-19 12:08:44 +00:00
|
|
|
int tmpseek;
|
2016-01-03 01:05:13 +00:00
|
|
|
bool vmode;
|
2009-03-20 21:05:12 +00:00
|
|
|
int interrupted; // XXX IS THIS DUPPED SOMEWHERE?
|
2009-02-05 21:08:46 +00:00
|
|
|
/* files */
|
2010-04-09 15:13:35 +00:00
|
|
|
RCons *cons;
|
2010-05-19 22:59:42 +00:00
|
|
|
RIO *io;
|
2010-04-10 23:46:07 +00:00
|
|
|
RCoreFile *file;
|
2011-02-07 08:46:01 +00:00
|
|
|
RList *files;
|
2010-05-19 22:59:42 +00:00
|
|
|
RNum *num;
|
|
|
|
RLib *lib;
|
2012-09-19 12:08:44 +00:00
|
|
|
RCmd *rcmd;
|
2010-05-19 22:59:42 +00:00
|
|
|
RAnal *anal;
|
|
|
|
RAsm *assembler;
|
2015-09-08 21:21:35 +00:00
|
|
|
/* ^^ */
|
2016-03-14 20:12:54 +00:00
|
|
|
RCoreTimes *times;
|
2010-05-19 22:59:42 +00:00
|
|
|
RParse *parser;
|
|
|
|
RPrint *print;
|
|
|
|
RLang *lang;
|
|
|
|
RDebug *dbg;
|
|
|
|
RFlag *flags;
|
|
|
|
RSearch *search;
|
2012-11-30 00:06:30 +00:00
|
|
|
RIOSection *section;
|
2010-05-19 22:59:42 +00:00
|
|
|
RSign *sign;
|
2011-01-11 23:01:06 +00:00
|
|
|
RFS *fs;
|
2011-10-04 08:10:00 +00:00
|
|
|
REgg *egg;
|
2012-12-23 12:52:57 +00:00
|
|
|
RCoreLog *log;
|
2015-07-09 21:56:55 +00:00
|
|
|
RAGraph *graph;
|
2010-06-23 15:30:16 +00:00
|
|
|
char *cmdqueue;
|
2011-08-27 18:25:37 +00:00
|
|
|
char *lastcmd;
|
|
|
|
int cmdrepeat;
|
2011-01-26 23:45:16 +00:00
|
|
|
ut64 inc;
|
2010-08-24 09:58:09 +00:00
|
|
|
int rtr_n;
|
|
|
|
RCoreRtrHost rtr_host[RTR_MAX_HOSTS];
|
2011-02-15 15:19:18 +00:00
|
|
|
int curasmstep;
|
|
|
|
RCoreAsmsteps asmsteps[R_CORE_ASMSTEPS];
|
2015-10-08 18:00:31 +00:00
|
|
|
ut64 *asmqjmps;
|
|
|
|
int asmqjmps_count;
|
|
|
|
int asmqjmps_size;
|
|
|
|
bool is_asmqjmps_letter;
|
|
|
|
bool keep_asmqjmps;
|
2011-06-04 01:14:04 +00:00
|
|
|
// visual
|
2013-02-06 09:35:23 +00:00
|
|
|
int http_up;
|
2011-06-04 01:14:04 +00:00
|
|
|
int printidx;
|
2013-07-18 20:20:23 +00:00
|
|
|
int utf8;
|
2013-10-19 22:25:37 +00:00
|
|
|
int vseek;
|
2015-10-24 20:48:44 +00:00
|
|
|
bool in_search;
|
2012-12-07 14:44:36 +00:00
|
|
|
RList *watchers;
|
2013-11-09 02:25:43 +00:00
|
|
|
RList *scriptstack;
|
2014-11-01 03:46:33 +00:00
|
|
|
RList *tasks;
|
2013-12-22 00:53:15 +00:00
|
|
|
int cmd_depth;
|
2014-01-18 15:26:09 +00:00
|
|
|
ut8 switch_file_view;
|
2014-03-05 02:52:42 +00:00
|
|
|
Sdb *sdb;
|
2014-11-07 23:45:31 +00:00
|
|
|
int incomment;
|
2016-02-25 09:28:54 +00:00
|
|
|
int curtab; // current tab
|
|
|
|
int seltab; // selected tab
|
2015-07-09 21:20:48 +00:00
|
|
|
int cmdremote;
|
2015-09-23 11:04:15 +00:00
|
|
|
char *lastsearch;
|
2015-10-20 23:51:34 +00:00
|
|
|
bool fixedblock;
|
2016-08-14 17:29:59 +00:00
|
|
|
char *cmdfilter;
|
2016-09-03 23:05:14 +00:00
|
|
|
bool break_loop;
|
2010-01-26 00:28:33 +00:00
|
|
|
} RCore;
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2014-10-30 21:58:51 +00:00
|
|
|
R_API int r_core_bind(RCore *core, RCoreBind *bnd);
|
|
|
|
|
2012-12-07 14:44:36 +00:00
|
|
|
typedef struct r_core_cmpwatch_t {
|
|
|
|
ut64 addr;
|
|
|
|
int size;
|
|
|
|
char cmd[32];
|
|
|
|
ut8 *odata;
|
|
|
|
ut8 *ndata;
|
|
|
|
} RCoreCmpWatcher;
|
|
|
|
|
2010-11-15 10:06:10 +00:00
|
|
|
typedef int (*RCoreSearchCallback)(RCore *core, ut64 from, ut8 *buf, int len);
|
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
#ifdef R_API
|
2013-06-25 00:45:12 +00:00
|
|
|
//#define r_core_ncast(x) (RCore*)(size_t)(x)
|
2012-06-12 22:51:16 +00:00
|
|
|
R_API RCons *r_core_get_cons (RCore *core);
|
2012-09-18 01:39:32 +00:00
|
|
|
R_API RBin *r_core_get_bin (RCore *core);
|
2012-06-12 22:51:16 +00:00
|
|
|
R_API RConfig *r_core_get_config (RCore *core);
|
2011-02-24 15:50:29 +00:00
|
|
|
R_API RAsmOp *r_core_disassemble (RCore *core, ut64 addr);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_init(RCore *core);
|
2015-01-13 02:40:01 +00:00
|
|
|
R_API RCore *r_core_new(void);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API RCore *r_core_free(RCore *core);
|
2012-08-13 12:14:23 +00:00
|
|
|
R_API RCore *r_core_fini(RCore *c);
|
2013-06-25 00:45:12 +00:00
|
|
|
R_API RCore *r_core_ncast(ut64 p);
|
|
|
|
R_API RCore *r_core_cast(void *p);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_config_init(RCore *core);
|
|
|
|
R_API int r_core_prompt(RCore *core, int sync);
|
|
|
|
R_API int r_core_prompt_exec(RCore *core);
|
2015-12-22 19:51:06 +00:00
|
|
|
R_API int r_core_lines_initcache (RCore *core, ut64 start_addr, ut64 end_addr);
|
|
|
|
R_API int r_core_lines_currline (RCore *core);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API void r_core_prompt_loop(RCore *core);
|
|
|
|
R_API int r_core_cmd(RCore *core, const char *cmd, int log);
|
2011-08-27 18:25:37 +00:00
|
|
|
R_API void r_core_cmd_repeat(RCore *core, int next);
|
2014-12-19 02:17:28 +00:00
|
|
|
R_API char *r_core_editor (const RCore *core, const char *file, const char *str);
|
2013-09-16 02:08:08 +00:00
|
|
|
R_API int r_core_fgets(char *buf, int len);
|
2012-07-21 10:11:21 +00:00
|
|
|
// FIXME: change (void *user) to (RCore *core)
|
2009-04-01 00:28:13 +00:00
|
|
|
R_API int r_core_cmdf(void *user, const char *fmt, ...);
|
2012-06-27 23:27:40 +00:00
|
|
|
R_API int r_core_flush(void *user, const char *cmd);
|
2009-04-01 00:28:13 +00:00
|
|
|
R_API int r_core_cmd0(void *user, const char *cmd);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API void r_core_cmd_init(RCore *core);
|
2012-09-06 01:12:54 +00:00
|
|
|
R_API int r_core_cmd_pipe(RCore *core, char *radare_cmd, char *shell_cmd);
|
2013-04-10 23:25:25 +00:00
|
|
|
R_API char *r_core_cmd_str(RCore *core, const char *cmd);
|
|
|
|
R_API char *r_core_cmd_strf(RCore *core, const char *fmt, ...);
|
2012-09-06 01:12:54 +00:00
|
|
|
R_API char *r_core_cmd_str_pipe(RCore *core, const char *cmd);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_cmd_file(RCore *core, const char *file);
|
2013-09-04 00:01:42 +00:00
|
|
|
R_API int r_core_cmd_lines(RCore *core, const char *lines);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_cmd_command(RCore *core, const char *command);
|
2013-08-17 17:53:04 +00:00
|
|
|
R_API int r_core_run_script (RCore *core, const char *file);
|
2016-01-03 01:05:13 +00:00
|
|
|
R_API bool r_core_seek(RCore *core, ut64 addr, bool rb);
|
2013-09-11 23:55:45 +00:00
|
|
|
R_API int r_core_seek_base (RCore *core, const char *hex);
|
2011-05-21 12:27:46 +00:00
|
|
|
R_API void r_core_seek_previous (RCore *core, const char *type);
|
|
|
|
R_API void r_core_seek_next (RCore *core, const char *type);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_seek_align(RCore *core, ut64 align, int count);
|
2013-03-31 02:34:46 +00:00
|
|
|
R_API int r_core_seek_archbits (RCore *core, ut64 addr);
|
2016-08-15 18:56:23 +00:00
|
|
|
R_API int r_core_block_read(RCore *core);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_block_size(RCore *core, int bsize);
|
|
|
|
R_API int r_core_read_at(RCore *core, ut64 addr, ut8 *buf, int size);
|
2014-09-18 19:27:06 +00:00
|
|
|
R_API int r_core_is_valid_offset (RCore *core, ut64 offset);
|
2014-03-28 16:06:22 +00:00
|
|
|
R_API int r_core_shift_block(RCore *core, ut64 addr, ut64 b_size, st64 dist);
|
2014-08-05 17:49:33 +00:00
|
|
|
R_API void r_core_visual_prompt_input (RCore *core);
|
2016-06-11 02:12:41 +00:00
|
|
|
R_API bool r_core_prevop_addr (RCore* core, ut64 start_addr, int numinstrs, ut64* prev_addr);
|
2015-10-29 11:54:19 +00:00
|
|
|
R_API bool r_core_visual_hudstuff(RCore *core);
|
2015-10-13 00:18:14 +00:00
|
|
|
R_API int r_core_visual_classes(RCore *core);
|
2015-03-17 00:29:28 +00:00
|
|
|
R_API int r_core_visual_types(RCore *core);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_visual(RCore *core, const char *input);
|
2016-01-04 22:00:01 +00:00
|
|
|
R_API int r_core_visual_graph(RCore *core, RAGraph *g, RAnalFunction *_fcn, int is_interactive);
|
2015-06-11 01:55:15 +00:00
|
|
|
R_API int r_core_fcn_graph(RCore *core, RAnalFunction *_fcn);
|
2015-03-05 22:33:28 +00:00
|
|
|
R_API int r_core_visual_panels(RCore *core);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_visual_cmd(RCore *core, int ch);
|
2013-10-19 22:25:37 +00:00
|
|
|
R_API void r_core_visual_seek_animation (RCore *core, ut64 addr);
|
2013-03-07 12:08:05 +00:00
|
|
|
R_API void r_core_visual_asm(RCore *core, ut64 addr);
|
2013-07-31 22:39:19 +00:00
|
|
|
R_API void r_core_visual_colors(RCore *core);
|
2015-10-08 18:00:31 +00:00
|
|
|
R_API int r_core_visual_xrefs_x(RCore *core);
|
|
|
|
R_API int r_core_visual_xrefs_X(RCore *core);
|
2015-08-31 11:57:39 +00:00
|
|
|
R_API int r_core_visual_hud(RCore *core);
|
2015-10-08 18:00:31 +00:00
|
|
|
R_API ut64 r_core_get_asmqjmps(RCore *core, const char *str);
|
|
|
|
R_API void r_core_set_asmqjmps(RCore *core, char *str, size_t len, int i);
|
2016-05-12 10:29:00 +00:00
|
|
|
R_API char* r_core_add_asmqjmp(RCore *core, ut64 addr);
|
2016-06-19 21:19:30 +00:00
|
|
|
|
2016-08-16 09:56:55 +00:00
|
|
|
R_API void r_core_anal_type_init(RCore *core);
|
|
|
|
R_API void r_core_anal_cc_init(RCore *core);
|
|
|
|
|
2016-06-19 21:19:30 +00:00
|
|
|
R_API void r_core_list_io(RCore *core);
|
2015-10-12 12:33:52 +00:00
|
|
|
/* visual marks */
|
|
|
|
R_API void r_core_visual_mark_seek(RCore *core, ut8 ch);
|
|
|
|
R_API void r_core_visual_mark(RCore *core, ut8 ch);
|
|
|
|
R_API void r_core_visual_mark_set(RCore *core, ut8 ch, ut64 addr);
|
|
|
|
R_API void r_core_visual_mark_dump(RCore *core);
|
|
|
|
R_API void r_core_visual_mark_reset(RCore *core);
|
2009-02-05 21:08:46 +00:00
|
|
|
|
2010-11-15 10:06:10 +00:00
|
|
|
R_API int r_core_search_cb(RCore *core, ut64 from, ut64 to, RCoreSearchCallback cb);
|
2011-02-04 10:30:08 +00:00
|
|
|
R_API int r_core_serve(RCore *core, RIODesc *fd);
|
2014-10-16 22:36:00 +00:00
|
|
|
R_API int r_core_file_reopen(RCore *core, const char *args, int perm, int binload);
|
2016-03-21 16:20:15 +00:00
|
|
|
R_API void r_core_file_reopen_debug(RCore *core, const char *args);
|
2014-04-23 23:04:25 +00:00
|
|
|
R_API RCoreFile * r_core_file_find_by_fd(RCore* core, ut64 fd);
|
|
|
|
R_API RCoreFile * r_core_file_find_by_name (RCore * core, const char * name);
|
2014-04-29 16:10:35 +00:00
|
|
|
R_API RCoreFile * r_core_file_cur (RCore *r);
|
2014-04-23 23:04:25 +00:00
|
|
|
R_API int r_core_file_set_by_fd(RCore *core, ut64 fd);
|
|
|
|
R_API int r_core_file_set_by_name(RCore *core, const char * name);
|
|
|
|
R_API int r_core_file_set_by_file (RCore * core, RCoreFile *cf);
|
2016-01-02 22:25:20 +00:00
|
|
|
R_API int r_core_setup_debugger (RCore *r, const char *debugbackend, bool attach);
|
2014-04-23 23:04:25 +00:00
|
|
|
|
2014-04-23 04:02:46 +00:00
|
|
|
R_API int r_core_files_free(const RCore *core, RCoreFile *cf);
|
2011-02-07 08:46:01 +00:00
|
|
|
R_API void r_core_file_free(RCoreFile *cf);
|
2014-10-07 22:44:31 +00:00
|
|
|
R_API RCoreFile *r_core_file_open(RCore *core, const char *file, int flags, ut64 loadaddr);
|
|
|
|
R_API RCoreFile *r_core_file_open_many(RCore *r, const char *file, int flags, ut64 loadaddr);
|
2014-08-29 16:45:14 +00:00
|
|
|
R_API RCoreFile *r_core_file_get_by_fd(RCore *core, int fd);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_file_close(RCore *core, RCoreFile *fh);
|
|
|
|
R_API int r_core_file_close_fd(RCore *core, int fd);
|
2014-12-19 12:46:04 +00:00
|
|
|
R_API int r_core_file_list(RCore *core, int mode);
|
2014-04-27 07:06:50 +00:00
|
|
|
R_API int r_core_file_binlist(RCore *core);
|
|
|
|
R_API int r_core_file_bin_raise(RCore *core, ut32 num);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_seek_delta(RCore *core, st64 addr);
|
2014-03-25 03:00:26 +00:00
|
|
|
R_API int r_core_extend_at(RCore *core, ut64 addr, int size);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_write_at(RCore *core, ut64 addr, const ut8 *buf, int size);
|
|
|
|
R_API int r_core_write_op(RCore *core, const char *arg, char op);
|
2014-04-23 23:04:25 +00:00
|
|
|
R_API int r_core_set_file_by_fd (RCore * core, ut64 bin_fd);
|
|
|
|
R_API int r_core_set_file_by_name (RBin * bin, const char * name);
|
|
|
|
R_API RBinFile * r_core_bin_cur (RCore *core);
|
2014-04-27 07:06:50 +00:00
|
|
|
R_API ut32 r_core_file_cur_fd (RCore *core);
|
2014-03-21 04:16:41 +00:00
|
|
|
|
2015-09-28 00:04:08 +00:00
|
|
|
R_API void r_core_debug_rr (RCore *core, RReg *reg);
|
|
|
|
|
2016-07-29 22:04:19 +00:00
|
|
|
/* project */
|
2016-08-01 11:37:25 +00:00
|
|
|
R_API void r_core_project_load(RCore *core, const char *prjfile);
|
|
|
|
R_API bool r_core_project_load_xrefs(RCore *core, const char *prjfile);
|
2016-07-29 22:04:19 +00:00
|
|
|
|
2014-03-21 04:16:41 +00:00
|
|
|
#define R_CORE_FOREIGN_ADDR -1
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_yank(RCore *core, ut64 addr, int len);
|
2014-05-23 10:39:05 +00:00
|
|
|
R_API int r_core_yank_string(RCore *core, ut64 addr, int maxlen);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_yank_paste(RCore *core, ut64 addr, int len);
|
2014-03-21 04:16:41 +00:00
|
|
|
R_API int r_core_yank_set (RCore *core, ut64 addr, const ut8 *buf, ut32 len); // set yank buffer bytes
|
2014-03-20 16:59:08 +00:00
|
|
|
R_API int r_core_yank_set_str (RCore *core, ut64 addr, const char *buf, ut32 len); // Null terminate the bytes
|
2012-08-09 10:42:44 +00:00
|
|
|
R_API int r_core_yank_to(RCore *core, const char *arg);
|
2014-03-20 16:59:08 +00:00
|
|
|
R_API int r_core_yank_dump (RCore *core, ut64 pos);
|
|
|
|
R_API int r_core_yank_hexdump (RCore *core, ut64 pos);
|
|
|
|
R_API int r_core_yank_cat (RCore *core, ut64 pos);
|
2016-03-31 03:15:20 +00:00
|
|
|
R_API int r_core_yank_cat_string (RCore *core, ut64 pos);
|
2014-03-20 16:59:08 +00:00
|
|
|
R_API int r_core_yank_hud_file (RCore *core, const char *input);
|
|
|
|
R_API int r_core_yank_hud_path (RCore *core, const char *input, int dir);
|
2014-03-22 20:44:21 +00:00
|
|
|
R_API int r_core_yank_file_ex (RCore *core, const char *input);
|
|
|
|
R_API int r_core_yank_file_all (RCore *core, const char *input);
|
2009-04-01 00:28:13 +00:00
|
|
|
|
2014-04-03 10:42:53 +00:00
|
|
|
#define R_CORE_LOADLIBS_ENV 1
|
|
|
|
#define R_CORE_LOADLIBS_HOME 2
|
|
|
|
#define R_CORE_LOADLIBS_SYSTEM 4
|
|
|
|
#define R_CORE_LOADLIBS_CONFIG 8
|
2015-10-23 00:58:48 +00:00
|
|
|
#define R_CORE_LOADLIBS_ALL UT32_MAX
|
2014-04-03 10:42:53 +00:00
|
|
|
|
|
|
|
R_API void r_core_loadlibs_init(RCore *core);
|
|
|
|
R_API int r_core_loadlibs(RCore *core, int where, const char *path);
|
2012-07-21 10:11:21 +00:00
|
|
|
// FIXME: change (void *user) -> (RCore *core)
|
2009-04-02 10:23:32 +00:00
|
|
|
R_API int r_core_cmd_buffer(void *user, const char *buf);
|
|
|
|
R_API int r_core_cmdf(void *user, const char *fmt, ...);
|
|
|
|
R_API int r_core_cmd0(void *user, const char *cmd);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API char *r_core_cmd_str(RCore *core, const char *cmd);
|
|
|
|
R_API int r_core_cmd_foreach(RCore *core, const char *cmd, char *each);
|
2015-06-01 01:05:15 +00:00
|
|
|
R_API int r_core_cmd_foreach3(RCore *core, const char *cmd, char *each);
|
2010-05-21 10:07:40 +00:00
|
|
|
R_API char *r_core_op_str(RCore *core, ut64 addr);
|
|
|
|
R_API RAnalOp *r_core_op_anal(RCore *core, ut64 addr);
|
2010-10-09 11:54:08 +00:00
|
|
|
R_API char *r_core_disassemble_instr(RCore *core, ut64 addr, int l);
|
|
|
|
R_API char *r_core_disassemble_bytes(RCore *core, ut64 addr, int b);
|
2010-02-26 20:00:03 +00:00
|
|
|
|
2016-03-22 23:44:56 +00:00
|
|
|
R_API int r_core_process_input_pade(RCore *core, const char *input, char** hex, char **asm_arch, ut32 *bits);
|
|
|
|
|
2010-02-26 20:00:03 +00:00
|
|
|
/* anal.c */
|
2013-11-03 12:47:34 +00:00
|
|
|
R_API RAnalOp* r_core_anal_op(RCore *core, ut64 addr);
|
2016-06-13 23:30:40 +00:00
|
|
|
R_API void r_core_anal_esil (RCore *core, const char *str, const char *addr);
|
2014-11-17 22:23:53 +00:00
|
|
|
R_API void r_core_anal_fcn_merge (RCore *core, ut64 addr, ut64 addr2);
|
2014-10-26 18:10:07 +00:00
|
|
|
R_API const char *r_core_anal_optype_colorfor(RCore *core, ut64 addr);
|
2014-10-15 00:24:22 +00:00
|
|
|
R_API ut64 r_core_anal_address (RCore *core, ut64 addr);
|
2014-09-22 13:00:41 +00:00
|
|
|
R_API void r_core_anal_undefine (RCore *core, ut64 off);
|
2016-06-05 22:33:11 +00:00
|
|
|
R_API void r_core_anal_hint_print (RAnal* a, ut64 addr);
|
2013-01-22 17:08:33 +00:00
|
|
|
R_API void r_core_anal_hint_list (RAnal *a, int mode);
|
2010-06-24 22:21:22 +00:00
|
|
|
R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref);
|
2015-07-11 04:53:58 +00:00
|
|
|
R_API int r_core_anal_search_xrefs(RCore *core, ut64 from, ut64 to, int rad);
|
2012-11-20 02:59:00 +00:00
|
|
|
R_API int r_core_anal_data (RCore *core, ut64 addr, int count, int depth);
|
2015-09-07 16:20:29 +00:00
|
|
|
R_API void r_core_anal_coderefs(RCore *core, ut64 addr, int gv);
|
|
|
|
R_API int r_core_anal_refs(RCore *core, const char *input);
|
2016-08-13 10:09:14 +00:00
|
|
|
R_API int r_core_esil_step(RCore *core, ut64 until_addr, const char *until_expr);
|
2012-07-19 02:54:22 +00:00
|
|
|
R_API int r_core_anal_bb(RCore *core, RAnalFunction *fcn, ut64 at, int head);
|
2015-09-12 15:53:16 +00:00
|
|
|
R_API ut64 r_core_anal_get_bbaddr(RCore *core, ut64 addr);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_anal_bb_seek(RCore *core, ut64 addr);
|
|
|
|
R_API int r_core_anal_fcn(RCore *core, ut64 at, ut64 from, int reftype, int depth);
|
2015-07-06 09:30:35 +00:00
|
|
|
R_API char *r_core_anal_fcn_autoname(RCore *core, ut64 addr, int dump);
|
2016-03-24 19:39:19 +00:00
|
|
|
R_API void r_core_anal_autoname_all_fcns(RCore *core);
|
2016-07-29 17:34:43 +00:00
|
|
|
R_API int r_core_anal_fcn_list(RCore *core, const char *input, const char *rad);
|
2016-03-07 11:54:40 +00:00
|
|
|
R_API int r_core_anal_fcn_list_size(RCore *core);
|
2014-09-23 07:35:37 +00:00
|
|
|
R_API void r_core_anal_fcn_labels(RCore *core, RAnalFunction *fcn, int rad);
|
2015-07-31 17:12:16 +00:00
|
|
|
R_API int r_core_anal_fcn_clean(RCore *core, ut64 addr);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_anal_graph(RCore *core, ut64 addr, int opts);
|
|
|
|
R_API int r_core_anal_graph_fcn(RCore *core, char *input, int opts);
|
2012-06-14 00:18:15 +00:00
|
|
|
R_API RList* r_core_anal_graph_to(RCore *core, ut64 addr, int n);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_anal_ref_list(RCore *core, int rad);
|
2010-11-27 03:20:19 +00:00
|
|
|
R_API int r_core_anal_all(RCore *core);
|
2014-03-24 23:48:42 +00:00
|
|
|
R_API RList* r_core_anal_cycles (RCore *core, int ccl);
|
2016-06-02 01:19:31 +00:00
|
|
|
R_API void r_core_anal_hint_print (RAnal* a, ut64 addr);
|
2010-03-30 22:03:59 +00:00
|
|
|
|
2016-08-13 10:09:14 +00:00
|
|
|
/*tp.c*/
|
|
|
|
R_API void r_anal_type_match(RCore *core, RAnalFunction *fcn);
|
2010-08-12 12:54:24 +00:00
|
|
|
/* asm.c */
|
2010-09-30 17:25:47 +00:00
|
|
|
typedef struct r_core_asm_hit {
|
|
|
|
char *code;
|
2010-10-06 16:04:47 +00:00
|
|
|
int len;
|
2010-09-30 17:25:47 +00:00
|
|
|
ut64 addr;
|
2013-11-24 00:44:00 +00:00
|
|
|
ut8 valid;
|
2010-09-30 17:25:47 +00:00
|
|
|
} RCoreAsmHit;
|
|
|
|
|
2013-09-11 21:41:40 +00:00
|
|
|
R_API RBuffer *r_core_syscall (RCore *core, const char *name, const char *args);
|
2013-09-15 00:24:23 +00:00
|
|
|
R_API RBuffer *r_core_syscallf (RCore *core, const char *name, const char *fmt, ...);
|
2015-01-13 02:40:01 +00:00
|
|
|
R_API RCoreAsmHit *r_core_asm_hit_new(void);
|
|
|
|
R_API RList *r_core_asm_hit_list_new(void);
|
2010-09-30 17:25:47 +00:00
|
|
|
R_API void r_core_asm_hit_free(void *_hit);
|
2016-03-22 23:44:56 +00:00
|
|
|
R_API void r_core_set_asm_configs(RCore *core, char *arch, ut32 bits, int segoff);
|
2010-08-12 12:54:24 +00:00
|
|
|
R_API char* r_core_asm_search(RCore *core, const char *input, ut64 from, ut64 to);
|
2015-07-08 18:02:36 +00:00
|
|
|
R_API RList *r_core_asm_strsearch(RCore *core, const char *input, ut64 from, ut64 to, int maxhits, int regexp);
|
2010-10-06 16:04:47 +00:00
|
|
|
R_API RList *r_core_asm_bwdisassemble (RCore *core, ut64 addr, int n, int len);
|
2013-11-24 00:44:00 +00:00
|
|
|
R_API RList *r_core_asm_back_disassemble_instr (RCore *core, ut64 addr, int len, ut32 hit_count, ut32 extra_padding);
|
|
|
|
R_API RList *r_core_asm_back_disassemble_byte (RCore *core, ut64 addr, int len, ut32 hit_count, ut32 extra_padding);
|
2014-08-23 05:23:55 +00:00
|
|
|
R_API ut32 r_core_asm_bwdis_len (RCore* core, int* len, ut64* start_addr, ut32 l);
|
2012-12-03 03:01:55 +00:00
|
|
|
R_API int r_core_print_disasm(RPrint *p, RCore *core, ut64 addr, ut8 *buf, int len, int lines, int invbreak, int nbytes);
|
2014-08-21 22:39:31 +00:00
|
|
|
R_API int r_core_print_disasm_json(RCore *core, ut64 addr, ut8 *buf, int len, int lines);
|
2013-01-22 17:08:33 +00:00
|
|
|
R_API int r_core_print_disasm_instructions (RCore *core, int len, int l);
|
2016-06-25 01:09:30 +00:00
|
|
|
R_API int r_core_print_disasm_all (RCore *core, ut64 addr, int l, int len, int mode);
|
2014-01-23 04:55:48 +00:00
|
|
|
R_API int r_core_print_fcn_disasm(RPrint *p, RCore *core, ut64 addr, int l, int invbreak, int cbytes);
|
2014-04-27 07:06:50 +00:00
|
|
|
R_API int r_core_file_bin_raise (RCore *core, ut32 binfile_idx);
|
2014-05-04 15:03:15 +00:00
|
|
|
//R_API int r_core_bin_bind(RCore *core, RBinFile *bf);
|
|
|
|
R_API int r_core_bin_set_env (RCore *r, RBinFile *binfile);
|
2014-04-23 23:04:25 +00:00
|
|
|
R_API int r_core_bin_set_by_fd (RCore *core, ut64 bin_fd);
|
|
|
|
R_API int r_core_bin_set_by_name (RCore *core, const char *name);
|
2014-01-11 06:56:02 +00:00
|
|
|
R_API int r_core_bin_reload(RCore *core, const char *file, ut64 baseaddr);
|
|
|
|
R_API int r_core_bin_load(RCore *core, const char *file, ut64 baseaddr);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API int r_core_hash_load(RCore *core, const char *file);
|
2014-10-16 22:04:52 +00:00
|
|
|
R_API int r_core_bin_list(RCore *core, int mode);
|
2014-05-13 03:57:51 +00:00
|
|
|
R_API int r_core_bin_raise (RCore *core, ut32 binfile_idx, ut32 obj_idx);
|
|
|
|
R_API int r_core_bin_delete (RCore *core, ut32 binfile_idx, ut32 binobj_idx);
|
2011-01-20 22:28:20 +00:00
|
|
|
|
2014-01-11 06:56:02 +00:00
|
|
|
// XXX - this is kinda hacky, maybe there should be a way to
|
2013-12-06 05:51:17 +00:00
|
|
|
// refresh the bin environment without specific calls?
|
|
|
|
R_API int r_core_bin_refresh_strings(RCore *core);
|
2015-04-16 04:42:07 +00:00
|
|
|
R_API int r_core_pseudo_code (RCore *core, const char *input);
|
2013-12-06 05:51:17 +00:00
|
|
|
|
2010-05-28 00:44:51 +00:00
|
|
|
/* gdiff.c */
|
2016-03-22 11:55:36 +00:00
|
|
|
R_API int r_core_gdiff(RCore *core1, RCore *core2);
|
2014-12-22 10:04:12 +00:00
|
|
|
R_API int r_core_gdiff_fcn(RCore *c, ut64 addr, ut64 addr2);
|
2010-05-28 00:44:51 +00:00
|
|
|
|
2010-03-30 22:03:59 +00:00
|
|
|
R_API int r_core_project_open(RCore *core, const char *file);
|
2015-01-22 01:54:58 +00:00
|
|
|
R_API int r_core_project_cat(RCore *core, const char *name);
|
2015-01-21 23:30:19 +00:00
|
|
|
R_API int r_core_project_delete(RCore *core, const char *prjfile);
|
2015-01-21 22:47:49 +00:00
|
|
|
R_API int r_core_project_list(RCore *core, int mode);
|
2016-04-06 20:49:25 +00:00
|
|
|
R_API bool r_core_project_save_rdb(RCore *core, const char *file, int opts);
|
|
|
|
R_API bool r_core_project_save(RCore *core, const char *file);
|
2010-05-24 16:51:01 +00:00
|
|
|
R_API char *r_core_project_info(RCore *core, const char *file);
|
2015-02-10 00:36:02 +00:00
|
|
|
R_API char *r_core_project_notes_file (RCore *core, const char *file);
|
|
|
|
|
2011-02-04 10:30:08 +00:00
|
|
|
R_API char *r_core_sysenv_begin(RCore *core, const char *cmd);
|
|
|
|
R_API void r_core_sysenv_end(RCore *core, const char *cmd);
|
2014-06-20 11:25:17 +00:00
|
|
|
R_API void r_core_sysenv_help(const RCore* core);
|
2010-05-28 00:44:51 +00:00
|
|
|
|
2016-04-21 19:19:01 +00:00
|
|
|
R_API void fcn_callconv (RCore *core, RAnalFunction *fcn);
|
2011-11-12 03:20:22 +00:00
|
|
|
/* bin.c */
|
2011-11-23 01:29:09 +00:00
|
|
|
#define R_CORE_BIN_PRINT 0x000
|
|
|
|
#define R_CORE_BIN_RADARE 0x001
|
|
|
|
#define R_CORE_BIN_SET 0x002
|
2012-11-02 02:35:50 +00:00
|
|
|
#define R_CORE_BIN_SIMPLE 0x004
|
|
|
|
#define R_CORE_BIN_JSON 0x008
|
2015-10-14 13:53:48 +00:00
|
|
|
#define R_CORE_BIN_ARRAY 0x010
|
2016-05-23 17:33:36 +00:00
|
|
|
#define R_CORE_BIN_SIMPLEST 0x020
|
2011-11-12 03:20:22 +00:00
|
|
|
|
|
|
|
#define R_CORE_BIN_ACC_STRINGS 0x001
|
2012-08-14 00:37:42 +00:00
|
|
|
#define R_CORE_BIN_ACC_INFO 0x002
|
|
|
|
#define R_CORE_BIN_ACC_MAIN 0x004
|
2011-11-12 03:20:22 +00:00
|
|
|
#define R_CORE_BIN_ACC_ENTRIES 0x008
|
|
|
|
#define R_CORE_BIN_ACC_RELOCS 0x010
|
|
|
|
#define R_CORE_BIN_ACC_IMPORTS 0x020
|
|
|
|
#define R_CORE_BIN_ACC_SYMBOLS 0x040
|
|
|
|
#define R_CORE_BIN_ACC_SECTIONS 0x080
|
|
|
|
#define R_CORE_BIN_ACC_FIELDS 0x100
|
2012-08-14 00:37:42 +00:00
|
|
|
#define R_CORE_BIN_ACC_LIBS 0x200
|
2011-11-12 16:15:05 +00:00
|
|
|
#define R_CORE_BIN_ACC_CLASSES 0x400
|
2012-08-14 00:37:42 +00:00
|
|
|
#define R_CORE_BIN_ACC_DWARF 0x800
|
2014-10-13 08:20:45 +00:00
|
|
|
#define R_CORE_BIN_ACC_PDB 0x2000
|
2012-08-23 10:46:55 +00:00
|
|
|
#define R_CORE_BIN_ACC_SIZE 0x1000
|
2015-03-18 21:03:59 +00:00
|
|
|
#define R_CORE_BIN_ACC_MEM 0x4000
|
2015-09-23 10:23:03 +00:00
|
|
|
#define R_CORE_BIN_ACC_EXPORTS 0x8000
|
2016-02-19 22:34:56 +00:00
|
|
|
#define R_CORE_BIN_ACC_VERSIONINFO 0x10000
|
2016-05-09 21:42:28 +00:00
|
|
|
#define R_CORE_BIN_ACC_SIGNATURE 0x20000
|
2015-03-18 21:03:59 +00:00
|
|
|
#define R_CORE_BIN_ACC_ALL 0x4FFF
|
2011-11-12 03:20:22 +00:00
|
|
|
|
2016-04-06 20:49:25 +00:00
|
|
|
#define R_CORE_PRJ_FLAGS 0x0001
|
|
|
|
#define R_CORE_PRJ_EVAL 0x0002
|
|
|
|
#define R_CORE_PRJ_IO_MAPS 0x0004
|
|
|
|
#define R_CORE_PRJ_SECTIONS 0x0008
|
|
|
|
#define R_CORE_PRJ_META 0x0010
|
|
|
|
#define R_CORE_PRJ_XREFS 0x0020
|
|
|
|
#define R_CORE_PRJ_FCNS 0x0040
|
|
|
|
#define R_CORE_PRJ_ANAL_HINTS 0x0080
|
|
|
|
#define R_CORE_PRJ_ANAL_TYPES 0x0100
|
|
|
|
#define R_CORE_PRJ_ANAL_MACROS 0x0200
|
|
|
|
#define R_CORE_PRJ_ANAL_SEEK 0x0400
|
2016-06-14 21:34:42 +00:00
|
|
|
#define R_CORE_PRJ_DBG_BREAK 0x0800
|
2016-04-06 20:49:25 +00:00
|
|
|
#define R_CORE_PRJ_ALL 0xFFFF
|
|
|
|
|
2011-11-12 03:20:22 +00:00
|
|
|
typedef struct r_core_bin_filter_t {
|
|
|
|
ut64 offset;
|
2012-02-27 01:40:27 +00:00
|
|
|
const char *name;
|
2011-11-12 03:20:22 +00:00
|
|
|
} RCoreBinFilter;
|
|
|
|
|
2015-08-28 18:14:26 +00:00
|
|
|
R_API int r_core_bin_info (RCore *core, int action, int mode, int va, RCoreBinFilter *filter, const char *chksum);
|
2014-09-14 09:52:30 +00:00
|
|
|
R_API int r_core_bin_set_arch_bits (RCore *r, const char *name, const char * arch, ut16 bits);
|
2014-05-04 15:03:15 +00:00
|
|
|
R_API int r_core_bin_update_arch_bits (RCore *r);
|
2010-08-24 09:58:09 +00:00
|
|
|
/* rtr */
|
2012-11-05 01:00:34 +00:00
|
|
|
R_API int r_core_rtr_cmds (RCore *core, const char *port);
|
|
|
|
R_API char *r_core_rtr_cmds_query (RCore *core, const char *host, const char *port, const char *cmd);
|
2010-08-24 09:58:09 +00:00
|
|
|
R_API void r_core_rtr_help(RCore *core);
|
|
|
|
R_API void r_core_rtr_pushout(RCore *core, const char *input);
|
|
|
|
R_API void r_core_rtr_list(RCore *core);
|
|
|
|
R_API void r_core_rtr_add(RCore *core, const char *input);
|
|
|
|
R_API void r_core_rtr_remove(RCore *core, const char *input);
|
|
|
|
R_API void r_core_rtr_session(RCore *core, const char *input);
|
|
|
|
R_API void r_core_rtr_cmd(RCore *core, const char *input);
|
2013-01-24 02:48:24 +00:00
|
|
|
R_API int r_core_rtr_http(RCore *core, int launch, const char *path);
|
2014-04-11 00:22:41 +00:00
|
|
|
R_API int r_core_rtr_http_stop(RCore *u);
|
2011-06-04 01:14:04 +00:00
|
|
|
|
|
|
|
R_API void r_core_visual_define (RCore *core);
|
2011-07-11 20:52:05 +00:00
|
|
|
R_API void r_core_visual_config (RCore *core);
|
|
|
|
R_API void r_core_visual_mounts (RCore *core);
|
|
|
|
R_API void r_core_visual_anal (RCore *core);
|
|
|
|
R_API void r_core_seek_next (RCore *core, const char *type);
|
2011-06-04 01:14:04 +00:00
|
|
|
R_API void r_core_seek_previous (RCore *core, const char *type);
|
|
|
|
R_API void r_core_visual_define (RCore *core);
|
2011-07-11 20:52:05 +00:00
|
|
|
R_API int r_core_visual_trackflags (RCore *core);
|
2011-11-23 01:29:09 +00:00
|
|
|
R_API int r_core_visual_comments (RCore *core);
|
2013-12-31 12:09:50 +00:00
|
|
|
R_API int r_core_visual_prompt (RCore *core);
|
2011-07-05 23:40:14 +00:00
|
|
|
R_API int r_core_search_preludes(RCore *core);
|
2011-07-06 09:48:16 +00:00
|
|
|
R_API int r_core_search_prelude(RCore *core, ut64 from, ut64 to, const ut8 *buf, int blen, const ut8 *mask, int mlen);
|
2015-05-22 05:05:00 +00:00
|
|
|
R_API RList* /*<RIOMap*>*/ r_core_get_boundaries_prot (RCore *core, int protection, const char *mode, ut64 *from, ut64 *to);
|
2014-10-07 23:34:56 +00:00
|
|
|
R_API RList* /*<RIOMap*>*/ r_core_get_boundaries (RCore *core, const char *mode, ut64 *from, ut64 *to);
|
2015-06-21 22:22:18 +00:00
|
|
|
R_API RList* r_core_get_boundaries_ok(RCore *core);
|
2011-06-04 01:14:04 +00:00
|
|
|
|
2011-09-09 07:49:55 +00:00
|
|
|
R_API int r_core_patch (RCore *core, const char *patch);
|
|
|
|
|
2015-09-15 09:22:32 +00:00
|
|
|
R_API void r_core_hack_help(const RCore *core);
|
2011-10-10 23:21:38 +00:00
|
|
|
R_API int r_core_hack(RCore *core, const char *op);
|
2015-04-03 02:04:46 +00:00
|
|
|
R_API int r_core_dump(RCore *core, const char *file, ut64 addr, ut64 size, int append);
|
2012-07-21 10:11:21 +00:00
|
|
|
R_API void r_core_diff_show(RCore *core, RCore *core2);
|
2011-10-10 23:21:38 +00:00
|
|
|
|
2012-12-07 14:44:36 +00:00
|
|
|
/* watchers */
|
2012-12-07 15:00:36 +00:00
|
|
|
R_API void r_core_cmpwatch_free (RCoreCmpWatcher *w);
|
|
|
|
R_API RCoreCmpWatcher *r_core_cmpwatch_get (RCore *core, ut64 addr);
|
2012-12-07 14:44:36 +00:00
|
|
|
R_API int r_core_cmpwatch_add (RCore *core, ut64 addr, int size, const char *cmd);
|
|
|
|
R_API int r_core_cmpwatch_del (RCore *core, ut64 addr);
|
|
|
|
R_API int r_core_cmpwatch_update (RCore *core, ut64 addr);
|
|
|
|
R_API int r_core_cmpwatch_show (RCore *core, ut64 addr, int mode);
|
|
|
|
R_API int r_core_cmpwatch_revert (RCore *core, ut64 addr);
|
|
|
|
|
2012-12-23 12:52:57 +00:00
|
|
|
/* logs */
|
|
|
|
R_API void r_core_log_free(RCoreLog *log);
|
|
|
|
R_API void r_core_log_init (RCoreLog *log);
|
2015-01-13 02:40:01 +00:00
|
|
|
R_API RCoreLog *r_core_log_new (void);
|
2012-12-23 12:52:57 +00:00
|
|
|
R_API int r_core_log_list(RCore *core, int n, int count, char fmt);
|
|
|
|
R_API void r_core_log_add(RCore *core, const char *msg);
|
|
|
|
R_API void r_core_log_del(RCore *core, int n);
|
|
|
|
|
2014-06-11 14:03:20 +00:00
|
|
|
/* help */
|
2014-06-23 23:01:27 +00:00
|
|
|
R_API void r_core_cmd_help(const RCore *core, const char * help[]);
|
2014-01-18 15:26:09 +00:00
|
|
|
|
2013-02-06 09:35:23 +00:00
|
|
|
/* anal stats */
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ut32 youarehere;
|
|
|
|
ut32 flags;
|
2013-02-07 02:09:53 +00:00
|
|
|
ut32 comments;
|
|
|
|
ut32 functions;
|
2013-02-06 09:35:23 +00:00
|
|
|
ut32 symbols;
|
2013-02-07 02:09:53 +00:00
|
|
|
ut32 strings;
|
2013-02-06 09:35:23 +00:00
|
|
|
ut32 imports;
|
|
|
|
} RCoreAnalStatsItem;
|
|
|
|
typedef struct {
|
|
|
|
RCoreAnalStatsItem *block;
|
|
|
|
} RCoreAnalStats;
|
|
|
|
|
2015-06-04 20:58:08 +00:00
|
|
|
R_API char *r_core_anal_hasrefs(RCore *core, ut64 value);
|
2013-02-06 09:35:23 +00:00
|
|
|
R_API RCoreAnalStats* r_core_anal_get_stats (RCore *a, ut64 from, ut64 to, ut64 step);
|
|
|
|
R_API void r_core_anal_stats_free (RCoreAnalStats *s);
|
2016-08-27 15:04:18 +00:00
|
|
|
R_API void r_core_anal_list_vtables(void *core, bool printJson);
|
2016-08-15 23:14:02 +00:00
|
|
|
|
2014-02-18 03:03:07 +00:00
|
|
|
R_API void r_core_syscmd_ls(const char *input);
|
2014-08-15 00:04:20 +00:00
|
|
|
R_API void r_core_syscmd_cat(const char *file);
|
2015-04-02 13:30:21 +00:00
|
|
|
R_API void r_core_syscmd_mkdir(const char *dir);
|
2013-02-06 09:35:23 +00:00
|
|
|
|
2015-10-29 10:54:00 +00:00
|
|
|
// TODO : move into debug or syscall++
|
|
|
|
R_API char *cmd_syscall_dostr(RCore *core, int num);
|
2014-11-01 03:46:33 +00:00
|
|
|
/* tasks */
|
|
|
|
|
|
|
|
typedef void (*RCoreTaskCallback)(void *user, char *out);
|
|
|
|
|
|
|
|
typedef struct r_core_task_t {
|
|
|
|
int id;
|
|
|
|
char state;
|
|
|
|
void *user;
|
|
|
|
RCore *core;
|
|
|
|
RThreadMsg *msg;
|
|
|
|
RCoreTaskCallback cb;
|
|
|
|
} RCoreTask;
|
|
|
|
|
|
|
|
R_API RCoreTask *r_core_task_get (RCore *core, int id);
|
|
|
|
R_API void r_core_task_list (RCore *core, int mode);
|
|
|
|
R_API RCoreTask *r_core_task_new (RCore *core, const char *cmd, RCoreTaskCallback cb, void *user);
|
|
|
|
R_API void r_core_task_run(RCore *core, RCoreTask *_task);
|
|
|
|
R_API void r_core_task_run_bg(RCore *core, RCoreTask *_task);
|
|
|
|
R_API RCoreTask *r_core_task_add (RCore *core, RCoreTask *task);
|
|
|
|
R_API void r_core_task_add_bg (RCore *core, RCoreTask *task);
|
|
|
|
R_API int r_core_task_del (RCore *core, int id);
|
2014-11-02 01:01:09 +00:00
|
|
|
R_API void r_core_task_join (RCore *core, RCoreTask *task);
|
2014-11-01 03:46:33 +00:00
|
|
|
|
2014-03-17 23:05:44 +00:00
|
|
|
/* PLUGINS */
|
2014-04-01 15:09:07 +00:00
|
|
|
extern RCorePlugin r_core_plugin_java;
|
2014-11-13 02:36:48 +00:00
|
|
|
extern RCorePlugin r_core_plugin_anal;
|
2014-03-17 23:05:44 +00:00
|
|
|
|
2009-12-24 02:17:53 +00:00
|
|
|
#endif
|
2009-03-06 00:00:41 +00:00
|
|
|
|
2013-06-18 10:09:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-02-05 21:08:46 +00:00
|
|
|
#endif
|