Drunk AI!
Clearly this is not right!
Clearly this is not right!
Implemented some fake lighting!
Last weekend I was trying to integrate LuaJIT into my custom game engine but I was getting this strange lua runtime error:
After a bit of googling I couldn't really find an answer, all the examples I found just worked. So I started to look a little deeper.
By looking at all of the final symbols from the binary I could see my test_ffi
function was missing. From here I was fairly certain clang was stripping all of the dead code that wasn't being directly called. Which was causing my problem as I was using the FFI interface to export my C++ wrappers to lua. After a few more hours of googling I found a stackoverflow question about dead code striping that led me to adding this -Wl,-force_load,libstatic.a
, to my linker command.
The symbol was now being correct "exported" from the static library to the host binary and not bring stripped. The output now worked correctly.
Below is all the source code used. You can also use -Wl,-all_load
, which forces all symbols / functions to be imported even if unused. This will dramatically increase the size of the binary.
You can find all the source code on my github. Which includes a simple standalone single binary version, the above static library version and a dynamic library version. The code is written for OSX and a brew based install of LuaJIT. I didn't test if this was a issue on gcc or msvc++.
For the past several months I have been researching modern OpenGL and finding resources has been a bit rough. The following are several tutorials / code examples that I used to learn more about creating and working with a Modern OpenGL 3.3+ context. Almost everything I found was using the old style OpenGL 1.x or 2.x methods of rendering. I hope that someone else will find this useful and save themselves a few hours of Googling to find this info.
I noticed there was not any reverse TCP shell code for 64-bit OSX. In fact, there is almost no 64-bit shell code for OSX. The only code I could find was here. This guy's blog post about 64-bit ASM on OSX helped with this project. It works great on 64-bit and 32-bit kernels. This is my first attempt at writing my own shell code; there are still optimizations left to do.