Protecting Source Code

BlitzMax Forums/BlitzMax Beginners Area/Protecting Source Code

lukehedman(Posted 2009) [#1]
Is there a way to compile a program so that the source code can't be taken, but the file can still be imported for use in other programs?

Would I have to use a .dll for this? Are .dlls even protected?

Thanks!


Gabriel(Posted 2009) [#2]
Is there a way to compile a program so that the source code can't be taken

The source code can never be taken when you compile a program. Technically it's possible to decompile or disassemble, but you end up with something which bears little relation to the original.

but the file can still be imported for use in other programs?

I have no idea what "imported for use in other programs" means in this context. Programs run, they're self-contained. Compiled or not you don't generally import them for use in other programs. Explain what you mean/need precisely and maybe we can answer that one.


GaryV(Posted 2009) [#3]
I think he is meaning compiling to a lib?


Gabriel(Posted 2009) [#4]
Oh you might be right. That would fit with not being able to use the source code, because you generally distribute libraries in Blitz3D and BlitzPlus as source code.

Well if that is indeed what you mean, then yes, you can. You can distribute them as DLL's and BlitzMax can create DLL's, but a module is probably best. Modules are compiled to a chunk of binary code which is statically linked to the program which uses them. The source code is not required so you can keep the source private if you wish, but the module is still bound into the final exe, so you don't have messy dll's floating around.


GaryV(Posted 2009) [#5]
It was just a "guess" ;)


lukehedman(Posted 2009) [#6]
That's exactly what I meant Gabriel. Sorry I wasn't more clear guys. I'll investigate modules and DLLs more.

So if I'm understanding this, I could build a module and give the binary to someone else, who could then link it to a exe and use its features. I'm assuming I'd need to let users know what the input and output methods are.

If that's the case...

w00t!