Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, 1 invisible), 465 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 5 1 2 3 4 5
super simple filepacker #161374
10/16/07 17:51
10/16/07 17:51
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
super_simple_filepacker.zip
i think the source is self-explanatory...

there seems to be a small problem in unpack.c. the loop seems to run once too often. i get one printf() too much. maybe someone can figure out how to fix this?

Re: super simple filepacker [Re: ventilator] #161375
10/16/07 18:01
10/16/07 18:01
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Thanks!

Could you make an example for encryption? When I hardcode the password into my Lite-C program and compile it to EXE, the password is protected, I guess?

Cheers, Christian.

Last edited by HeelX; 10/16/07 18:03.
Re: super simple filepacker [Re: HeelX] #161376
10/16/07 18:18
10/16/07 18:18
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
no, all strings in an exe can be seen in a hex editor, so your plain text password wouldn't be that safe. but you could encrypt the password too.

encryption could be added quite easily but i don't think it's really necessary. it's a custom format anyway which can't simply be opened with winzip. you could further customize it so that it is more difficult to figure out for other gamestudio users. in the end all encryption is quite useless since with all filepackers your data will land in ram unencrypted anyway and there are plenty of tools for accessing it there.

Re: super simple filepacker [Re: ventilator] #161377
10/16/07 19:15
10/16/07 19:15
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Ok... I think its fine in its current state. Thanks

Re: super simple filepacker [Re: HeelX] #161378
10/17/07 08:48
10/17/07 08:48
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
did anyone have a look at why the loop runs once too often in unpack.c? i guess i don't use feof() correctly? i could solve it differently but using feof() would be more elegant if it worked.

Re: super simple filepacker [Re: ventilator] #161379
10/17/07 19:45
10/17/07 19:45
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
TripleX Offline
Expert
TripleX  Offline
Expert

Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
if i remember right, feof is executed after a failed fread instruction because of an feof error.

==>

while(!feof(fp))
{
long length;
fread(&length, sizeof(long), 1, fp);
if(feof(fp)) { break; }

no very elegant, but.. it should work

Re: super simple filepacker [Re: TripleX] #161380
10/18/07 07:38
10/18/07 07:38
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
thanks! it was the first time that i used feof().

i have solved it like that now:

long length;
while(fread(&length, sizeof(long), 1, fp)) // while not eof
{

please download it again if you have the old version!

Re: super simple filepacker [Re: ventilator] #161381
10/18/07 09:02
10/18/07 09:02
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
just for fun i have added encryption support.

the key isn't text but 4 numbers so it shouldn't be that easy to find it in the exe with a hex editor. but since other gamestudio users who can experiment with the filepacker source could do comparisons of the surrounding bytes or something like that you maybe should move the key around a bit (into a different function of your script or so).

(keep my second post in this thread in mind.)



<edit>...of course encryption is useless for the free lite-c since you can't really hide the source code and the key there. so i would remove the encryption part of the script when using it with the free lite-c.</edit>

Re: super simple filepacker [Re: ventilator] #161382
10/18/07 16:51
10/18/07 16:51
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Thanks!

Re: super simple filepacker [Re: HeelX] #161383
02/08/08 23:03
02/08/08 23:03
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
pack.c crashes at first addfile, using 7.07 ???

edit: nvm i forgot to copy zlib dll.

Last edited by Quadraxas; 02/08/08 23:06.

3333333333
Page 1 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1