Distributing EGGS

Is there any way so that I can hide .egg files while distributing my application.


One way would be to distribute only the bam version of your egg files .
it’s a binary version of the egg file that will load several times faster.
If your user does not have the bam2egg executable, he will not be able to reverse engineer the bam file.

+> this is an option of packpanda shown in manual

Also you could use pencrypt/decrypt utilities in bin folder to crytp the files

Note that Bam files are linked to a specific version of panda.
So bam file from panda1.2 are not usable in panda 1.3.

Note alos,By default, when panda load an egg file, it create a cache version as a bam file to process it faster the next time.

I have seen ALICE. The (model)files used are .a2w or .a2c
Is there a way where I can create my own Extention files, like in ALICE they have done.
I am not able to see code for those files.

Smriti Sharma, .a2c are just zip files they dont hide their contents very well. Panda supports a multifile, a kind of like a big data file that you can mount as a virtual file system. The multifiles can be zipped and encrypted providing you maximum security. Some one would have to spend some trying to get at your models. They would have easier time running one of the nvidea tools that writes every currently rendered model, texture, and shader to file.

as a side note some of those alice models are available for you to use as eggs www.panda3d.org/artcats.php

Also panda can load egg.pz files which are eggs zipped with the panda zip tool. And finally you can name your egg files what ever you like … like .exe yet panda would complain about the extension so you can use the egg library directly to load the file
egg = EggData()
model = NodePath(loadEggData(egg))

just as if you called

#model = loader.loadModel(‘breeze.exe’)
so you can name your files .a2c if you really like :slight_smile:

What module I need to import for this code to run?

I did following code:

import direct.directbase.DirectStart
from direct.task import Task
from direct.actor import Actor
import math
from pandac.PandaModules import * 
from pandac.PandaModules import EggData
from pandac.PandaModules import Filename
from pandac.PandaModules import PandaNode,NodePath,Camera,TextNode

egg = EggData() 
model = NodePath(loadEggData(egg)) 
environ = loader.loadModel("models/world.exe")



Its giving following error:

Any help is appreciated.

Look at the first error, it says that the extension of world.exe is not recognised, it will try to continue anyway with ‘None’ as model and that is the cause of the NoneType error which cannot be reparented…

Long story short, Treeform is wrong. Panda can not load .exe files as models, make your world model one of the formats listed in the error message.
Maybe there is a way around, by specifying some kind of type, but i have no experience on that. You need to make your models .bam or .egg or .mb etc.

WOW, pro-rsoft, soooo loud and wrong :laughing: :laughing: :laughing:
I guess the problem is simply language barrier. Tell me if english isn’t your native tongue dance.
treeform clearly wrote :

It means the previous 3 lines should replace the way you load models, if you want it that way. So you don’t need to use loadModel anymore :

environ = loader.loadModel("models/world.exe")

treeform obviously commented that line already.

A clean way to replace loader.loadModel so it accept any file extension would be :

def myModel(modelName):
    egg = EggData()
    return NodePath(loadEggData(egg))

usage :
environ = myModel(“models/world.exe”)

But unfortunately, loadEggData simply can’t find the textures if your model isn’t in your current working directory, just like your case. Fortunately there is loadEggFile.

def myModel(modelPath):
    return NodePath(loadEggFile(modelPath))

Unfortunately (again :astonished: ), by loading the .egg yourself, model cache is not available, so it will be loaded sloooooowly.

Redefining the default-model-extension to .exe or whatever doesn’t help, since the model loader uses the file extension for decision making, the loading process is distinguished by the file extension.

So, if you really want a quick, dirty, and silly work around, simply by renaming the extension before loading, and restore it after loading. But that’s just too risky. If there is something going wrong during loading, you’re screwed, the extension wouldn’t get restored, so in the future the original extension wouldn’t be found. I doubt using try…finally helps ensuring the extension restoration.

def myModel(modelPath):
    os.rename(origName,newName) # alter the camouflage extension to egg
    os.rename(newName,origName) # restore it back after loading
    return model

I wouldn’t recommend it.
Just use .bam, end of problem.

Dudes the best method is multifiles! The egg-data rename to .exe method is just a joke … i guess you guys don’t get it. You are not GEEEEEEEEEEEEKS enough to see it! Security by obscuration never works! Never! Encrypt now please. But if you are just starting out why worry? Encryption is a bit harder and more troublesome and besides who will know what an bam file is?

Ah, reminds me off the old days when Fravia’s Castle still has been online, with tons of reverse-engineering lore, and cracking still has been a measurement for computer skills.

Mind if I join the pissing contest?

File encryption is nice and cheap to implement, but it is a joke too. Please keep in mind that Panda3D is an open source engine, so memory layout is kinda well documented. You just need to dump your memory and read the model data from there, where it is unencrypted. A GOOD joke, but still a joke.

If you want halfway decent security the only way to go is to run your application on a terminal server, and just serve the rendered images to the user, 60 times a second. Users only have a thin client, without access to your crackable application code and without access to your crackable data. Oh, and don’t forget to place the terminal server behind a good firewall/intrusion detection system. For example twin GeNUGate 800. Not too expensive at merely about 80000 Euro.

Seriously: How much is your code or data worth so you need anything more than .pyc or .bam files? Like treeform said, don’t worry about security at this level.


/me totally agrees with enn0x