| View previous topic :: View next topic |
| Author |
Message |
Giuliano
Joined: 13 Sep 2005 Posts: 78
|
Posted: Tue Sep 20, 2005 9:50 am Post subject: Protected Code |
|
|
Any chance in the near future that Lua will provide some kind of way to "compile" the code so that no one else can view it ? Perhaps some kind of password scheme or something even would be nice...
I know that Lua is all about dev'ing for the PSP and being freeware but if someone is to create something in Lua and wish to keep others from stealing any code then it wouldnt be possible |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Tue Sep 20, 2005 10:15 am Post subject: |
|
|
I don't think it is possible to "hide" your code in Lua. One way I could think of is to convert Lua code to C and then compile it. I don't know if such a converter does exist. Better ask the big boys at Lua group. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
Giuliano
Joined: 13 Sep 2005 Posts: 78
|
Posted: Tue Sep 20, 2005 10:43 am Post subject: |
|
|
| I know it's not possible but I was asking if in the future it will be :) |
|
| Back to top |
|
 |
chaos
Joined: 10 Apr 2005 Posts: 135
|
Posted: Tue Sep 20, 2005 1:08 pm Post subject: |
|
|
you could write a lua obfuscator... _________________ Chaosmachine Studios: High Quality Homebrew. |
|
| Back to top |
|
 |
ksilvert
Joined: 06 Sep 2005 Posts: 5
|
Posted: Tue Sep 20, 2005 10:17 pm Post subject: |
|
|
| I could be wrong, but I thought that the .10 release included a way to compile your lua code into an eboot? I haven't tried this yet....but it may be what you're looking for. |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Tue Sep 20, 2005 10:48 pm Post subject: |
|
|
| chaos wrote: | | you could write a lua obfuscator... |
nice idea, but most of those obfuscator's are tricked easily (see javascript, just use your search and replace-tool to rebuild the code)
one way to "fuck up" the code is renaming the variables to senseless stuff (which some developers already do when they code *lol*) this would make it harder to read/understand your program
| ksilvert wrote: |
I could be wrong, but I thought that the .10 release included a way to compile your lua code into an eboot? I haven't tried this yet....but it may be what you're looking for. |
afaik is it only possible to build it so you can use your own images and have your lua in the root folder of your app (no compiling from lua2c)
greets Lumo
PS: you could even encode your lua-code and decode(and delete the files afterwards) it at runtime (with an lua-script) but where do you store the password then ;D _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
MikeHaggar
Joined: 18 Jul 2005 Posts: 116
|
Posted: Wed Sep 21, 2005 2:08 am Post subject: |
|
|
| LuMo wrote: |
one way to "fuck up" the code is renaming the variables to senseless stuff (which some developers already do when they code *lol*) this would make it harder to read/understand your program
|
I thought that was what obfuscators did? |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Wed Sep 21, 2005 2:15 am Post subject: |
|
|
obfusc... think it also formats the code different (remove spaces aso)
and change normal code to charcode (which can be read by machine)
anyway, quite the same :) _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Sep 21, 2005 2:32 am Post subject: |
|
|
Another way I could think of is to embed your Lua script(s) into Shine's LuaPlayer (with some mods) and compile the entire package. You got the bin file. No scripts visible. LP could then be able to read the scripts internally. Good idea. huh? _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Wed Sep 21, 2005 2:37 am Post subject: |
|
|
humm guess thats the best idea by now :D _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Wed Sep 21, 2005 6:03 am Post subject: |
|
|
| LuMo wrote: | | ksilvert wrote: |
I could be wrong, but I thought that the .10 release included a way to compile your lua code into an eboot? I haven't tried this yet....but it may be what you're looking for. |
afaik is it only possible to build it so you can use your own images and have your lua in the root folder of your app (no compiling from lua2c)
greets Lumo
PS: you could even encode your lua-code and decode(and delete the files afterwards) it at runtime (with an lua-script) but where do you store the password then ;D |
There are many ways to hide the code. You can use the source code from Lua Player and just substitude the boot.lua with your code, which is linked with the EBOOT.PBP file, or you can compile your Lua script with luac or from a Lua script and save it as a Lua chunk and load this later with standard Lua functions and the ultimative code hiding would be to link this Lua chunk instead of the Lua source with your EBOOT.PBP.
Decoding on-the-fly is possible, too, without saving it first to memory stick, because AFAIK Lua can execute strings as code, but this doesn't help very much, because someone can just patch the decoding function to write it to memory stick :-) |
|
| Back to top |
|
 |
Giuliano
Joined: 13 Sep 2005 Posts: 78
|
Posted: Wed Sep 21, 2005 11:44 am Post subject: |
|
|
| So making it it's own EBOOT file is the only way ? I just don't like it because it means you have to include more files and that means more bigger size for the program. If someone has a 32mb stick they want to save as much space as possible. |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Sep 21, 2005 12:51 pm Post subject: |
|
|
Is "bloated" EBOOT bigger than the combination of the regular EBOOT and all scripts required to run a program? Me thinks not so but I could be wrong. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
Oobles Site Admin
Joined: 17 Jan 2004 Posts: 362 Location: Melbourne, Australia
|
Posted: Wed Sep 21, 2005 1:36 pm Post subject: |
|
|
I haven't compiled the PSP version of LUA yet, however, doesn't LUA come with a compiler? The LuaPlayer would need to be modified to allow loading LuaByte code directly if it is not already supported.
Here's some information on it.
http://www.lua.org/manual/3.2/luac.html
It is still possible to decompile lua code using luadc which you can google for, but it will make your code a reasonable amount more obfuscated.
David. aka Oobles. |
|
| Back to top |
|
 |
|