Rizin
unix-like reverse engineering framework and cli tools
luac_specs_54.h
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 #ifndef BUILD_LUAC_54_H
5 #define BUILD_LUAC_54_H
6 
8 
9 /* Macros for bin_luac.c */
10 /* Macros/Typedefs used in luac */
11 typedef double LUA_NUMBER;
12 typedef ut64 LUA_INTEGER;
13 
14 /* Macro Functions */
15 /* type casts (a macro highlights casts in the code) */
16 #define luac_cast(t, exp) ((t)(exp))
17 #define luac_cast_num(i) luac_cast(double, (i))
18 #define luac_cast_int(i) luac_cast(int, (i))
19 
20 /* luac 5.4 spec */
21 /* Header Information */
22 #define LUAC_54_FORMAT_OFFSET 0x05
23 #define LUAC_54_LUAC_DATA_OFFSET 0x06
24 #define LUAC_54_INSTRUCTION_SIZE_OFFSET 0x0C
25 #define LUAC_54_INTEGER_SIZE_OFFSET 0x0D
26 #define LUAC_54_NUMBER_SIZE_OFFSET 0x0E
27 #define LUAC_54_INTEGER_VALID_OFFSET 0x0F
28 #define LUAC_54_NUMBER_VALID_OFFSET 0x17
29 #define LUAC_54_UPVALUES_NUMBER_OFFSET 0x1F
30 
31 #define LUAC_54_SIGNATURE_SIZE 4
32 #define LUAC_54_VERSION_SIZE 1
33 #define LUAC_54_FORMAT_SIZE 1
34 #define LUAC_54_LUAC_DATA_SIZE 6
35 #define LUAC_54_INSTRUCTION_SIZE_SIZE 1
36 #define LUAC_54_INTEGER_SIZE_SIZE 1
37 #define LUAC_54_NUMBER_SIZE_SIZE 1
38 #define LUAC_54_INTEGER_VALID_SIZE 8
39 #define LUAC_54_NUMBER_VALID_SIZE 8
40 #define LUAC_54_UPVALUES_NUMBER_SIZE 1
41 
42 #define LUAC_54_FORMAT 0 /* this is the official format */
43 #define LUAC_54_DATA "\x19\x93\r\n\x1a\n"
44 #define LUAC_54_INT_VALIDATION luac_cast_int(0x5678)
45 #define LUAC_54_NUMBER_VALIDATION luac_cast_num(370.5)
46 
47 #define LUAC_54_HDRSIZE 0x20
48 
49 /* Body */
50 #define LUAC_FILENAME_OFFSET 0x20
51 
52 #endif // BUILD_LUAC_54_H
ut64 LUA_INTEGER
Definition: luac_specs_54.h:12
double LUA_NUMBER
Definition: luac_specs_54.h:11
ut64(WINAPI *w32_GetEnabledXStateFeatures)()