luaffi's People
luaffi's Issues
ffi.cast 生成__fastcall约定的函数 有bug
__fastcall 约定的 前2个参数 是以寄存器 ecx, edx 传进函数里 剩余参数通过栈保存进函数
在函数执行完毕时,通过栈传进的参数需要 ret size 来弹出平衡栈
然而 ffi.cast 生成的 fastcall函数 在计算参数size时 没有忽略掉 前2个参数 造成堆栈错误
在 call_x86.dasc 的
int x86_return_size(lua_State* L, int usr, const struct ctype* ct)
这个函数里 没有区分stdcall 跟fastcall 只根据 参数数量来计算 ret size 导致崩溃
例如 7个参数 去掉前2个 剩余5个参数 正确应该 ret 0x14 在生成代码时 生成的是 ret 0x1c 从而导致 运行fastcall函数后堆栈不平衡 而产生崩溃。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.