Rizin
unix-like reverse engineering framework and cli tools
analysis_luac.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-only
2 // SPDX-FileCopyrightText: 2021 Heersin <teablearcher@gmail.com>
3 
4 #include <rz_types.h>
5 #include <rz_analysis.h>
6 
8 
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 }
23 
25  .name = "luac",
26  .desc = "Lua bytecode analysis plugin",
27  .license = "LGPL3",
28  .arch = "luac",
29  .bits = 8,
30  .op = &rz_lua_analysis_op,
31  .esil = false
32 };
33 
34 #ifndef RZ_PLUGIN_INCORE
37  .data = &rz_analysis_plugin_luac,
39 };
40 #endif
size_t len
Definition: 6502dis.c:15
#define mask()
RzAnalysisPlugin rz_analysis_plugin_luac
Definition: analysis_luac.c:24
RZ_API RzLibStruct rizin_plugin
Definition: analysis_luac.c:35
int rz_lua_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
Definition: analysis_luac.c:9
#define RZ_API
uint8_t ut8
Definition: lh5801.h:11
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
RzAnalysisOpMask
Definition: rz_analysis.h:439
@ RZ_LIB_TYPE_ANALYSIS
Definition: rz_lib.h:73
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
#define RZ_VERSION
Definition: rz_version.h:8
const char * version
Definition: rz_analysis.h:1239
Definition: dis.c:32
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58