Once a texture is loaded, can it be 'compiled'....

Community Forums/General Help/Once a texture is loaded, can it be 'compiled'....

Blitzplotter(Posted 2015) [#1]
....as part of the Blitz3D binary?

I'm happy using textures and models compiled using the 'load Image' ' load AnimImage' methods.

However some 3rd party models have limitations in that require the 3rd party assets need to be obfuscated - Anyone had experience of achieving this goal?

Thanks, Blitzplotter.


videz(Posted 2015) [#2]

....as part of the Blitz3D binary?



Do you mean as single file exe? If yes then try using Terabit's datapak utility.


GfK(Posted 2015) [#3]
Terabit's thing is pointless. It unpacks to temporary files on the hard drive and still uses regular loading methods after that. The level of protection offered is virtually zero.

If you're tied to Blitz3D you'd be better off with something like Molebox.


Blitzplotter(Posted 2015) [#4]
Thanks for the quick Feedback, it was something that I couldn't see a way around.

I have been using InnoScript, which works great - however there is no obfuscation (as far as I'm aware) which is associated with it.

Also, I'm curious as to how the B3D pre-compiled code approaches loading textures/models which will become obfuscated.... (that is to say someone cannot navigate around inside the program's installation directory and extract the textures/models that way).


Blitzplotter(Posted 2015) [#5]
just had a quick peek at Molebox - its features look EXACTLY like what I need - cheers ;)


videz(Posted 2015) [#6]
I wouldn't be interested in protecting my assets sensitively. Top gaming companies have tried it before but have no success in doing so.

technically this will only work if you're going to use a virtual files system like molebox that Gfk mentioned, which is a paid solution btw..

I have tried terabit's solution, models and textures works ok, but with sounds it doesn't do cleanups and leave it on your hard drive.


GfK(Posted 2015) [#7]
I wouldn't be interested in protecting my assets sensitively. Top gaming companies have tried it before but have no success in doing so.
But Blitzplotter *is* interested in this - from what he said it's mandatory with some of the royalty-free assets he's using.

technically this will only work if you're going to use a virtual files system like molebox that Gfk mentioned, which is a paid solution btw..

No, Molebox isn't free. But it isn't hugely expensive, either, for an individual licence.

But if it is too expensive for you, http://www.3alternatives.com/free-alternatives-molebox-virtulization-solution


xlsior(Posted 2015) [#8]
just had a quick peek at Molebox - its features look EXACTLY like what I need - cheers ;)


Just one word of warning: while molebox works well, every so often a molebox protected exe may trigger a false positive in some antivirus programs, because your exe's layout will end up sharing some similarities with certain virus/malware programs whose authors also used the same version of molebox.

Typically it can be fixed by reporting yours as a false positive, but it could add some hassle and potentially customer questions/concerns.


Blitzplotter(Posted 2015) [#9]
But Blitzplotter *is* interested in this - from what he said it's mandatory with some of the royalty-free assets he's using.


Yeah, that is my issue - if I had the time to learn how to model, rig and skin my own models then I wouldn't have any issues - however - that time just doesn't exist. Not that I wouldn't mind having the time to learn how to create my own assets - I need that elusive lottery win for that ;)

@xlsior - thanks for the heads up - I'll put this in the faq.

@videz - I currently do not have any sounds in my program - but I may include some - there is a sound api that has caught my interest.

@GfK, thanks for the link to the alternatives as well - all very good advice that is really appreciated.


videz(Posted 2015) [#10]
I would still be scratching my head if I'd be up for their lowest $150 individual license with a free blitz3d solution. I'd rather invest long term and pay for the Blitzmax $80~ license and get something going with the available modules, if there is one or rather write my own solution. But you can create a DLL too with Blitz3D userlibs but that's another discussion.

BTW, thanks for the alternative links Gfk


videz(Posted 2015) [#11]
Follow up with the links: 2 non working, enigmaprotector is also $150 single license..

Maybe free alternative??


Blitzplotter(Posted 2015) [#12]
@videz, as GfK eluded its not my code that I have written in Blitz3D I'm bothered about obfuscating - that is already pretty well obfuscated (thank you Mr Sibly & those nice chaps at BRL ;). It is the third party material - this means stuff made by other people.

Also, with respect to :

I would still be scratching my head if I'd be up for their lowest $150 individual license with a free blitz3d solution
That could be depedent upon how much effort you had expended creating a program.

One last thing, Blitz3D might (now) be free - however this is not a significant concern for me. I'm pleased Blitz3D is getting more exposure - and I for one will be crediting it in any Software I release (if ever....)


videz(Posted 2015) [#13]
Don't mind me, I'm just saying my approach on things, as everyone does.

At the end, it all comes down to your decision and your experience with it. I hope it works out. :-)


GfK(Posted 2015) [#14]
Follow up with the links: 2 non working, enigmaprotector is also $150 single license..
Enigma Virtual Box is free - which is the product my original link suggested (not Enigma Protector).


Blitzplotter(Posted 2015) [#15]
Cheers Videz, thanks GfK for the clarification.


videz(Posted 2015) [#16]
double post


videz(Posted 2015) [#17]
Ok thanks GFx. The resource link leads me to the protector page.. found it, good find


Matty(Posted 2015) [#18]
Out of interest, if the meshes arent animated (since from memory you cant create bones in code) would encrypting them yourself be sufficient and then recreate the meshes in code at runtime?


Zethrax(Posted 2015) [#19]
Regarding Molebox and anti-virus false-positives I just came upon this on their website ( http://www.molebox.com/molebox-vs-features.shtml ).

Unique executable template for every customer. This helps preventing antivirus false positives since applications of different users look less similar.



Blitzplotter(Posted 2015) [#20]
@Matty, they are animated.

@Zethrax, thanks for the feedback, appriecated.


virtlands(Posted 2015) [#21]
Hi BlitzPlotter,....
You can also embed files, using a complex technique that I demonstrated in the following old post ::

Asked by Sir Gak, " Is there a way to embed a sound or graphic file in a Blitz3D program... ? "

--> http://www.blitzbasic.com/Community/posts.php?topic=102923#1236384

You may download the sample code from my OneDrive :: http://1drv.ms/1zp2JHf



Matty(Posted 2015) [#22]
I assume this is for blitz3d?

I know that for Java, and I assume blitzmax, it is possible to extend the base InputStream class and override the read() method - you can basically handle any decryption in that of your encrypted resources at the individual byte level....it may not necessarily be the strongest world's best form of encryption but the file certainly won't be openable in any available packages....

Not sure if it is possible to do that with blitz3d(since the internal file io stuff is hidden from the user) but since the source is available .....


Blitzplotter(Posted 2015) [#23]
@Virtlands - thanks for the advice, really appreciated ;)


Blitzplotter(Posted 2015) [#24]
@VirtLands - could you hi-light the definition for the FreeImage_Unload function? Cheers....


Function FiUnload(dib)
 ;Frees a FreeImage bitmap, a wrapper function
 ;Returns nothing

 FreeImage_Unload(dib)

End Function



I've downloaded the FreeImage directory, was kinda hoping the dll would've sufficed....

found this within the FreeImage header file:-

// Allocate / Clone / Unload routines ---------------------------------------

DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Allocate(int width, int height, int bpp, unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateT(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib);
DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib);


So... do I have to compile FreeImage.c to make a FreeImage.o that I can reference within the Attachfiles1.bb ? I thought depositing the FreeImage.dll within my B3D userlibs directory might've sufficed.


Blitzplotter(Posted 2015) [#25]
I need to maybe dig into this-

http://www.blitzbasic.com/sdkspecs/sdkspecs/userlibs_specs.txt

Specifically, the last bit about the creation of a decls file...

http://www.blitzbasic.com/Community/posts.php?topic=63955


Blitzplotter(Posted 2015) [#26]
This one helped, somewhat :)

http://www.blitzbasic.com/codearcs/codearcs.php?code=1732


steve_ancell(Posted 2015) [#27]
Just look into ReadPixel/WritePixel. You can then create a simple program that puts all that pixel data into Data statements, and then put those Data statements into your game and write a simple routine that builds images from that data inside that game before compiling it.

I know the above is crude, but it's also free.


Blitzplotter(Posted 2015) [#28]
steve, thanks for the additional option, choice is good.