resources pack

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

resources pack

Post by jojojoris »

Hi everyone,

I want to make a game but i don't want all the resource files (sprites/sounds/etc) directly accessible from the MS. Is it posible to put all the files together in a single password protected zip package? (Of course this is possible) But my real question is: How can i read/load the files from the package?

Can someone make a small example which draws a picture stored in a zip file on the screen?

If you know another compression format with password protection or is isier to use, tell me.

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

i can help you there i made(unreleased but will be) a port of minzip for the psp that lets you read zip files or write or add files too them and they can be password protected

edit: site moved
my forums are here for my ports and libraries
http://kehon.izfree.com/phpBB3/viewforu ... d678368958 i posted it there so i could keep track of it[/url]

edit:
i believe i put a sample in the zip and also to get the .h files with images i used bin2c i use oslib so it should be easy i think the sample uploads it let me know if it doesnt
Last edited by coolkehon on Thu Mar 05, 2009 3:09 am, edited 1 time in total.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Someone could easily find out the zip password and thats the end of your protection. Plus you'll have the additional overhead of decompressing stuff. You'll need to have some kind of per-user downloader or whatever to encrypt them differently for each PSP without the plaintext files ever being available at any point. That can be cracked to, but no one would go that far for homebrew. You'd best leave it in plain sight so people can do what they want with it. Just keep going with your official releases and let people do whatever crap they want. Thats the whole ideology of homebrew.

Another thing you can do is simply encrypt the files themselves with RSA or any other public key system. Thats uncrackable, without having to modify your executable the key in your executable. They will be able to decrypt your resources if they get the key, but they cant load custom resources into your application.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Torch wrote:Someone could easily find out the zip password and thats the end of your protection. Plus you'll have the additional overhead of decompressing stuff. You'll need to have some kind of per-user downloader or whatever to encrypt them differently for each PSP without the plaintext files ever being available at any point. That can be cracked to, but no one would go that far for homebrew. You'd best leave it in plain sight so people can do what they want with it. Just keep going with your official releases and let people do whatever crap they want. Thats the whole ideology of homebrew.

Another thing you can do is simply encrypt the files themselves with RSA or any other public key system. Thats uncrackable, without having to modify your executable the key in your executable. They will be able to decrypt your resources if they get the key, but they cant load custom resources into your application.
Yes but i want to know it it is possible to use a zip package to load resources. maybe using zziplib or some standard SDK lib.

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

I don't have experience with zip archives, but you can gzip each one individually and you can directly fopen them and read from them without any additional code using libz. They will be decompressed automatically as you read. Also they will be compressed automatically if you write.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

has anyone check that library i ported it works pretty good its a little confusing was to me at first but not hard at all its very easy just look at the main website oh and my website will be migrated soon somewhere else because the current one keeps going down or having msql issues just refresh it for a while and it comes up
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Is it possible to load a file direct into the memory without writing it first to the memorystick?

@coolkehon I don't see why your library should be better. http://zziplib.sourceforge.net/ it looks like this one can do the same trick.

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

There are threads on putting files into the EBOOT. Search for them. Combine that with the compression/encryption and you have what you're looking for.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Why would you need to write it. If you have a compressed file just store it in memory as you decompress.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

simply because the zziplib cannot write files to zip at least not the psp version
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

coolkehon wrote:simply because the zziplib cannot write files to zip at least not the psp version
You asked whether you could (decompress i assume) straight into memory without writing the decompressed file to memory stick. I don't see why thats not possible.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Yes i want to decompress a file direct to the memory.

But i don't know how to do it. Can someone make an example which loads a picture from a zip file and display it on the screen?

Code: Select all

int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

zzlib also provides an fopen command and can directly read from a zip.
Simply open zipfile/file.dat and read from it normally.
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Search around for a program called PBPCat.
Post Reply