Jump to content




LUAC binary files and CC


  • You cannot reply to this topic
1 reply to this topic

#1 クデル

  • Members
  • 349 posts

Posted 08 July 2016 - 09:43 AM

I have been fiddling with luac recently, and I decided to try and execute a binary file created by it using dofile, however it likes to just throw a Java Heap Space error. Am I misinformed, or this is impossible to do within CC?

#2 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 08 July 2016 - 10:20 AM

It's not impossible, you can use string.dump to dump a function and loadstring the dump back into a function. On never versions of CC though, you only have load (which you would call with the dump and a string "b" as the third parameter) and you get a Lua-level error, something like "binary chunk loading is prohibited", but you can get around that with a modified bios.lua.

If you "compile" a Lua source with luac, it'll dump bytecode compatible with the Lua library it was built with. The last time I checked, the bytecode of the official implementation of the Lua library is incompatible with LuaJ's bytecode, so that might be why you get Java-level errors. I get a NullPointerException when I try to loadstring("\27Lua"), so it's not too well protected, you can easily get it to throw a Java-level error with invalid bytecode.

Edited by LBPHacker, 08 July 2016 - 10:21 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users