Skip to content

Commit 789b1d2

Browse files
docs: readme
1 parent 41790f2 commit 789b1d2

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Lua Bytecode Parser CE
2+
3+
A versatile Lua 5.3 bytecode parser that supports both standard Lua bytecode and Cheat Engine modified format.
4+
5+
**Key Features:**
6+
- ✅ Read both standard Lua bytecode and Cheat Engine format
7+
- ✅ Write standard Lua bytecode format
8+
- ✅ Clear analysis of bytecode structure
9+
- ✅ Easy-to-use C++ library integration
10+
11+
## Quick Start
12+
13+
### Command Line Usage
14+
```bash
15+
parser.exe input.luac [output.luac]
16+
```
17+
18+
**Example Output:**
19+
```
20+
> parser luac.out
21+
22+
Function Prototype:
23+
Source: "@test.lua"
24+
Line Defined: 0
25+
Last Line Defined: 0
26+
Num Params: 0
27+
Is Vararg: 1
28+
Max Stack Size: 2
29+
Code (2 instructions):
30+
0000 0x00000001
31+
0001 0x00800026
32+
Constants:
33+
[0] NUMBER (integer) 1
34+
Upvalues:
35+
[0] _ENV (Instack=1, Idx=0)
36+
Local Variables:
37+
[0] a (Scope: PC 1-2)
38+
End Function Prototype
39+
```
40+
41+
### Library Integration
42+
```cpp
43+
// Parse bytecode
44+
LuaBytecodeParser parser(bytecode_data);
45+
auto main_proto = parser.parse();
46+
47+
// Write bytecode
48+
std::ofstream out_file("output.luac", std::ios::binary);
49+
LuaBytecodeWriter writer(out_file);
50+
writer.write(*main_proto);
51+
```
52+
53+
---
54+
55+
# Lua 字节码解析器 CE
56+
57+
支持标准 Lua 5.3 字节码和 Cheat Engine 修改格式的解析工具
58+
59+
**核心功能:**
60+
- ✅ 读取标准格式和 CE 修改格式
61+
- ✅ 写入标准格式字节码
62+
- ✅ 清晰的字节码结构分析
63+
- ✅ 简单的 C++ 集成方案
64+
65+
## 快速开始
66+
67+
### 命令行使用
68+
```bash
69+
parser.exe 输入文件.luac [输出文件.luac]
70+
```
71+
72+
**示例输出:**
73+
```
74+
> parser luac.out
75+
76+
函数原型:
77+
源文件: "@test.lua"
78+
起始行: 0
79+
结束行: 0
80+
参数数量: 0
81+
可变参数: 是
82+
最大栈大小: 2
83+
指令 (2条):
84+
0000 0x00000001
85+
0001 0x00800026
86+
常量:
87+
[0] 数值 (整型) 1
88+
上值:
89+
[0] _ENV (在栈中=1, 索引=0)
90+
局部变量:
91+
[0] a (作用域: PC 1-2)
92+
结束函数原型
93+
```
94+
95+
### 库集成
96+
```cpp
97+
// 解析字节码
98+
LuaBytecodeParser parser(bytecode_data);
99+
auto main_proto = parser.parse();
100+
101+
// 写入字节码
102+
std::ofstream out_file("output.luac", std::ios::binary);
103+
LuaBytecodeWriter writer(out_file);
104+
writer.write(*main_proto);
105+
```

0 commit comments

Comments
 (0)