Rizin
unix-like reverse engineering framework and cli tools
analysis_luac.c File Reference
#include <rz_types.h>
#include <rz_analysis.h>
#include "librz/asm/arch/luac/lua_arch.h"

Go to the source code of this file.

Functions

int rz_lua_analysis_op (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
 

Variables

RzAnalysisPlugin rz_analysis_plugin_luac
 
RZ_API RzLibStruct rizin_plugin
 

Function Documentation

◆ rz_lua_analysis_op()

int rz_lua_analysis_op ( RzAnalysis analysis,
RzAnalysisOp op,
ut64  addr,
const ut8 data,
int  len,
RzAnalysisOpMask  mask 
)

Definition at line 9 of file analysis_luac.c.

9  {
10  if (!analysis->cpu) {
11  RZ_LOG_ERROR("Cannot get lua version\n");
12  return 0;
13  }
14  if (strcmp(analysis->cpu, "5.4") == 0) {
15  return lua54_anal_op(analysis, op, addr, data, len);
16  } else if (strcmp(analysis->cpu, "5.3") == 0) {
17  return lua53_anal_op(analysis, op, addr, data, len);
18  } else {
19  RZ_LOG_ERROR("Cannot find a suitable lua version to handle lua analysis\n");
20  }
21  return 0;
22 }
size_t len
Definition: 6502dis.c:15
int lua54_anal_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len)
Definition: analysis_54.c:6
int lua53_anal_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len)
Definition: analysis_53.c:7
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
Definition: dis.c:32
static int addr
Definition: z80asm.c:58

References addr, rz_analysis_t::cpu, len, lua53_anal_op(), lua54_anal_op(), and RZ_LOG_ERROR.

Variable Documentation

◆ rizin_plugin

RZ_API RzLibStruct rizin_plugin
Initial value:
= {
}
RzAnalysisPlugin rz_analysis_plugin_luac
Definition: analysis_luac.c:24
@ RZ_LIB_TYPE_ANALYSIS
Definition: rz_lib.h:73
#define RZ_VERSION
Definition: rz_version.h:8
const char * version
Definition: rz_analysis.h:1239

Definition at line 35 of file analysis_luac.c.

◆ rz_analysis_plugin_luac

RzAnalysisPlugin rz_analysis_plugin_luac
Initial value:
= {
.name = "luac",
.desc = "Lua bytecode analysis plugin",
.license = "LGPL3",
.arch = "luac",
.bits = 8,
.esil = false
}
int rz_lua_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
Definition: analysis_luac.c:9

Definition at line 24 of file analysis_luac.c.