praydog/luagenny
GitHub: praydog/luagenny
为 sdkgenny 提供 Lua 绑定,简化结构解析与自动化分析。
Stars: 3 | Forks: 4
# luagenny 
Lua 绑定 [sdkgenny](https://github.com/cursey/sdkgenny)
## 使用此项目的工程
* [regenny](https://github.com/cursey/regenny) - 用于交互式重构结构并生成头文件的逆向工程工具
* 可以使用 Lua API 的 REPL 或运行脚本来对结构进行便捷/自动化的分析
* 参考初始的 [Pull Request](https://github.com/cursey/regenny/pull/10) 查看示例
## 示例
```
PS F:\Programming\projects\sdkgenny-lua\build\Debug> .\test.exe
0x223aa80d010
> baz = sdkgenny.StructOverlay(0x223aa80d010, parsed:global_ns():struct("Baz"))
> print(baz.things:address())
2352207548688
> print(baz.things[0])
sol.luagenny::api::StructOverlay: 00000223AA7D8338
> print(baz.things[0].abc)
0
> print(baz.things[1].abc)
2
> print(baz.things[2].abc)
4
> print(baz.hello)
Hello, world!
> print(baz.im_true)
true
> print(baz.im_false)
false
> print(baz.im_also_true)
true
> print(baz.ta.hours)
40
```
使用的 gennyfile
```
constexpr auto gennyfile = R"(
type int 4 [[i32]]
type float 4 [[f32]]
type ushort 2 [[u16]]
type str 8 [[utf8*]]
type wstr 8 [[utf16*]]
type bool 1 [[bool]]
type uintptr_t 8 [[u64]]
type char 1
type wchar_t 2
struct RTTITest{}
enum Place {
EARTH = 1,
MOON = 2,
MARS = 3,
}
struct Date {
ushort nWeekDay : 3
ushort nMonthDay : 6
ushort nMonth : 5
ushort nYear : 8
}
struct Foo {
int a
int b
float c
Place p
Place bf1 : 4
Place bf2 : 2
}
struct Bar {
int d
Foo* foo
int[4][3] m
Date date
}
struct Thing {
int abc
}
struct Person {
int age
}
struct Student : Person {
float gpa
}
struct Faculty : Person {
int wage
}
struct TA : Student, Faculty {
int hours
}
struct Baz : Bar 0x100 {
TA ta
int e
int thing
int* f
Foo g
Thing* things
char* hello [[utf8*]]
//wchar_t* wide_hello [[utf16*]]
//char[32] intrusive_hello [[utf8*]]
bool im_true +40
bool im_false
bool im_also_true
//RTTITest* test + 5
}
struct RTTITest 0x100 {
uintptr_t** vtable
}
)";
```
标签:C++绑定, DNS解析, Lua API, Lua绑定, REPL, rizin, sdkgenny, SOC Prime, 云安全监控, 云资产清单, 代码生成, 内存布局, 开发工具, 开源项目, 渗透测试工具, 类型系统, 结构体解析, 自动化分析, 跨站脚本, 跨语言调用, 逆向工程, 静态分析