Really? But that would make every open source software a free software...Robin wrote:Minor point: this thread is about hidden source, not closed source. Everything that falls under copyright law is closed source by default.
Closed source love2d games...
Re: Closed source love2d games...
Re: Closed source love2d games...
Nope, if anything, it's the other way around. Free software means that the license of the code must meet certain standards. See also here.undef wrote:Really? But that would make every open source software a free software...
Back to the original topic: While you certainly make it harder to get to the code, it is still there, embedded into love.dll. Case in point, this is your code (extracted using a text editor):
Code: Select all
angle = 0
function love.draw()
love.graphics.translate(500,200)
love.graphics.rotate(math.rad(angle))
love.graphics.rectangle("fill", 0, 0, 60, 120 )
angle = angle + 20
end
Code: Select all
function love.conf(t)
t.title = "Proof of concept" -- The title of the window the game is in (string)
t.author = "HerryBiscuit" -- The author of the game (string)
t.identity = nil -- The name of the save directory (string)
--t.version = 0.9 -- The LÖVE version this game was made for (number)
t.console = false -- Attach a console (boolean, Windows only)
t.window.width = 800 -- The window width (number)
t.window.height = 600 -- The window height (number)
t.window.fullscreen = false -- Enable fullscreen (boolean)
t.window.vsync = true -- Enable vertical sync (boolean)
t.window.fsaa = 0 -- The number of FSAA-buffers (number)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.audio = true -- Enable the audio module (boolean)
t.modules.keyboard = true -- Enable the keyboard module (boolean)
t.modules.event = true -- Enable the event module (boolean)
t.modules.image = true -- Enable the image module (boolean)
t.modules.graphics = true -- Enable the graphics module (boolean)
t.modules.timer = true -- Enable the timer module (boolean)
t.modules.mouse = true -- Enable the mouse module (boolean)
t.modules.sound = true -- Enable the sound module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
end
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Closed source love2d games...
And I should have read on and noticed vrld had beat me to it, but I opened a hex editor and found two files directly below boot.lua:
Starting at an offset of roughly 0x0025560C in love.dll.
Code: Select all
angle = 0
function love.draw()
love.graphics.translate(500,200)
love.graphics.rotate(math.rad(angle))
love.graphics.rectangle("fill", 0, 0, 60, 120 )
angle = angle + 20
end
Code: Select all
function love.conf(t)
t.title = "Proof of concept" -- The title of the window the game is in (string)
t.author = "HerryBiscuit" -- The author of the game (string)
t.identity = nil -- The name of the save directory (string)
--t.version = 0.9 -- The LÖVE version this game was made for (number)
t.console = false -- Attach a console (boolean, Windows only)
t.window.width = 800 -- The window width (number)
t.window.height = 600 -- The window height (number)
t.window.fullscreen = false -- Enable fullscreen (boolean)
t.window.vsync = true -- Enable vertical sync (boolean)
t.window.fsaa = 0 -- The number of FSAA-buffers (number)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.audio = true -- Enable the audio module (boolean)
t.modules.keyboard = true -- Enable the keyboard module (boolean)
t.modules.event = true -- Enable the event module (boolean)
t.modules.image = true -- Enable the image module (boolean)
t.modules.graphics = true -- Enable the graphics module (boolean)
t.modules.timer = true -- Enable the timer module (boolean)
t.modules.mouse = true -- Enable the mouse module (boolean)
t.modules.sound = true -- Enable the sound module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
end
Re: Closed source love2d games...
Thanks for writing this, Herry.
Re: Closed source love2d games...
Damn I was looking in the wrong place.
-
- Citizen
- Posts: 66
- Joined: Tue Jan 14, 2014 11:03 pm
Re: Closed source love2d games...
Would be interesting to know how you did it.
Re: Closed source love2d games...
In case "you" means bartbes or myself: Open love.dll in vim (or any decent text editor) and search for "Proof of concept". Done.gianmichele wrote:Would be interesting to know how you did it.
Re: Closed source love2d games...
I think the only useful method of 'hiding' the source is compiling to bytecode (luajit -b mycode.lua mycode.out). Then the visible source is simply a shim that adds a bytecode loader. Of course, there are disassemblers and people still could easily distribute modified versions of your game.
This is also a really bad idea on platforms where you don't ship Love with your game, since LuaJIT (and her bytecode) may change. For example, I've produced a proof of concept but it will only work with the latest builds (with LuaJIT 2.1.0). So more useful is the code:
main.lua
conf.lua
Using the old main.lua and conf.lua: main.out is created by luajit -b main.lua main.out and conf.out is created by replacing t. with _G. in conf.lua then running luajit -b conf.lua conf.out. I suspect the best way to do this is to create a package loader.
This is also a really bad idea on platforms where you don't ship Love with your game, since LuaJIT (and her bytecode) may change. For example, I've produced a proof of concept but it will only work with the latest builds (with LuaJIT 2.1.0). So more useful is the code:
main.lua
Code: Select all
local bc, size = love.filesystem.read('main.out')
loadstring(bc)()
Code: Select all
function love.conf(t)
local bc, size = love.filesystem.read('conf.out')
local f = loadstring(bc)
setfenv(f, t)
f()
end
-
- Prole
- Posts: 5
- Joined: Mon Dec 15, 2014 8:37 pm
- Contact:
Re: Closed source love2d games...
damn.. i did not know this was possible... ill have to figure out a workaround.,. BACK TO THE DEV CAVE!vrld wrote:Back to the original topic: While you certainly make it harder to get to the code, it is still there, embedded into love.dll. Case in point, this is your code (extracted using a text editor):
even if i can't avoid this problem then ill just slap some copyright or something to say not to extract the source or ill just go back to SDL C++
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Closed source love2d games...
Legally, that's the default anyway. But what seems to work well is guilt-tripping: "pls don't use my source code I need the money ppl throw at my game to feed my cats, you don't want to be responsible for the malnutrition and eventual death of my cats, do you? LOOK AT HOW CUTE MY DYING CATS ARE! let them live, I beg of you"herrybiscuit wrote:even if i can't avoid this problem then ill just slap some copyright or something to say not to extract the source or ill just go back to SDL C++
Something like that.
Help us help you: attach a .love.
Who is online
Users browsing this forum: No registered users and 1 guest