Jump to content


Photo

Resource Dll


  • Please log in to reply
49 replies to this topic

#1 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 09 June 2008 - 10:21 PM

I made my (first) DLL using c++ and it helps you protect external resources to a maximum of 2G per datafile, but it can be split in to sections. When creating a datafile, you must supply a key that you will need again to extract the resources. There are currently only 2 functions on the dll (not including the initialization). The first will compress a folder (keeping the folders in tact) into a data file. The second function decompresses/decrypts it to a specified folder.

This is an easy, safe way to protect your external resources. No other program will be able to see, extract or use your files when you have encryption enabled.

Depending on how this project turns out, I may build a nice program for managing your resources and easily packing them up for distribution.


Current Features:
Compress a folder (keeping structure the same) with encryption (optional)
Decompress a folder (Key needed if encryption enabled.
Splitting a datafile in to byte-sections (eg. 3 files of 3mb or 1 file of 9mb)
Very safe encryption

Planned Features:
Extract one file at a time
Extract one folder at a time
Add one folder at a time
Add one file at a time
Extract one file type at a time

Download:
This includes a gmk with all of the needed scripts and the main dll.
Download

Please report any bugs, suggestions or feedback!

Edited by Revel, 20 June 2009 - 01:06 AM.

  • 0

#2 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 09 June 2008 - 10:24 PM

Very good! Can you please supply a GM6 link for meh?
  • 0

#3 liverol

liverol

    GMC Member

  • GMC Member
  • 179 posts

Posted 10 June 2008 - 05:17 AM

amazing!!
can't wait for the full version!
keep up this nice work!!
  • 0

#4 Lukearentz

Lukearentz

    My Two Cents

  • New Member
  • 2587 posts

Posted 10 June 2008 - 05:52 AM

Hmm, I seem to be having some trouble.
The initialize code doesn't seem to work properly for me
___________________________________________
ERROR in
action number 1
of Create Event
for object object1:

Error defining an external function.

Also
/* Opens a datafile for writing. */
/*Argument 0 - The key for the file (Needed later to decompress)
  Argument 1 - Name of the resource file (eg. Data.dat) (Need full path)
  Argument 2 - Folder you want to compress into resource file
  Argument 3 - Split the resource file into byte chunks. (0 for no split)
  Returns: (1) Successful or (0) An error has occured.
  */
external_call(global.defTestDLL_Compress_Folder,argument0,ar
gument1,argument2,argument4);
Is that a typo or should it actually say argument4, I would have thought it would be 3 not 4
  • 0
I have left the GMC, and my domain is no longer registered to me.
All previous links will not work, for any information/links please PM me, and I may be able to help you

#5 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 10 June 2008 - 12:10 PM

Hmm, I seem to be having some trouble.
The initialize code doesn't seem to work properly for me

___________________________________________
ERROR in
action number 1
of Create Event
for object object1:

Error defining an external function.

Umm...did you extract the ZIP and/or have the DLL in the same place?
  • 0

#6 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 10 June 2008 - 10:14 PM

@Lukearentz.

Thanks for catching that typo. Ill re upload the fixed version.


Any other bugs/suggestions?

Edited by Revel, 10 June 2008 - 10:15 PM.

  • 0

#7 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 11 June 2008 - 12:40 AM

Suggestion: Add a GM6 link for GM6 and GM7 users. It will allow more people to download as not everyone uses GM7...for...I told you :D

Suggestion 2: More descriptions, what type of file does it make?
  • 0

#8 coolist

coolist

    The Coolist

  • New Member
  • 913 posts

Posted 11 June 2008 - 02:07 AM

Heres the scripts you need GMREC:

#define resource_init_dll
//Needed before you can use DLL.
dll="rsource.dll"
global.defTestDLL_Init=external_define(dll,"init",dll_stdcall,ty_real,0);
global.defTestDLL_Extract=external_define(dll,"extract_all",dll_stdcall,ty_real,3,ty_string,ty_string,ty_
string);
global.defTestDLL_Compress_Folder=external_define(dll,"compress_folder",dll_stdcall,ty_real,4,ty_string,ty_string,ty_
string,ty_real);


external_call(global.defTestDLL_Init);
#define resource_extract
/*Extracts all files and folders in data file to a specified location*/

/*Argument 0 - The Encryption key (blank for no encryption)
  Argument 1 - The Data file to extract from (Need full path)
  Argument 2 - The Path where the extracted files should be extracted to.
	Returns (1) if it was successfull, and (0) if there was an error. Errors
	can happen from invalid paths and invalid keys.
  */
external_call(global.defTestDLL_Extract,argument0,argument1,
argument2);
#define resource_compress_folder
/* Opens a datafile for writing. */
/*Argument 0 - The key for the file (Needed later to decompress)
  Argument 1 - Name of the resource file (eg. Data.dat) (Need full path)
  Argument 2 - Folder you want to compress into resource file
  Argument 3 - Split the resource file into byte chunks. (0 for no split)
  Returns: (1) Successful or (0) An error has occured.
  */
external_call(global.defTestDLL_Compress_Folder,argument0,ar
gument1,argument2,argument3);

>>These scripts were copied directly from the file and not edited, I take no credit in making them, if the creator wants me to remove them he can PM me<<

Edited by coolist, 11 June 2008 - 02:10 AM.

  • 0

#9 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 12 June 2008 - 12:51 AM

@GMREC1111

You are able to make any file extension you want.

I assumed that if I didn't post anything, then people would assume they could use whatever.
  • 0

#10 Lukearentz

Lukearentz

    My Two Cents

  • New Member
  • 2587 posts

Posted 12 June 2008 - 01:50 AM

Umm...did you extract the ZIP and/or have the DLL in the same place?

I am not that dumb, But just as an interesting fact, when you are using winrar if you double click the exe it will extract all the files to a temp directory before running it. That means that it doesn't need to be extracted unless there is a file you need to keep such as save games. As long as the user doesn't close that winrar window while playing everything should be alright.
  • 0
I have left the GMC, and my domain is no longer registered to me.
All previous links will not work, for any information/links please PM me, and I may be able to help you

#11 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 12 June 2008 - 02:02 AM

Could be a function mistype or an issue with compatibility.
  • 0

#12 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 12 June 2008 - 03:48 AM

Actually, I use WinRAR as my main zip/RAR extraction tool and some dlls and resources require you to extract properly first.

But lets not get off topic about winRAR.
  • 0

#13 Marchal_Mig12

Marchal_Mig12

    The Rhouan

  • GMC Member
  • 1182 posts
  • Version:GM:Studio

Posted 14 June 2008 - 09:10 PM

_______________________________________
ERROR in
action number 1
of Create Event
for object object1:

Error defining an external function.

Too bad there is something wrong :)
  • 0

#14 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 15 June 2008 - 12:07 AM

*sigh*

Extract the files.
  • 0

#15 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 15 June 2008 - 05:13 PM

didn't give an error but it never made the data file
Here is my code
resource_init_dll();
resource_compress_folder("hi",working_directory+"Data.dat",working_directory+"Online",0);

so I tried to see what it would return using
resource_init_dll();
a = resource_compress_folder("hi",working_directory+"Data.dat",working_directory+"Online",0);
show_message(a);

the message was blank.
I tried making it an exe because the folder probably didn't exist in the temp folder but it still didn't work.
Folder Online does exist in the folder with the exe.
  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#16 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 15 June 2008 - 05:24 PM

you need to replace this:

a = resource_compress_folder("hi",working_directory+"Data.dat",working_directory+"Online",0);

with this:

a = resource_compress_folder("hi",working_directory+"\Data.dat",working_directory+"\Online",0);

you need a slash before the filename. the working_directory does not include it.



Also, if anyone could think of a better name for this dll, that would be great.

Edited by Revel, 15 June 2008 - 05:28 PM.

  • 0

#17 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 15 June 2008 - 08:46 PM

Its always something simple isn't it :whistle:

Anyway ya it works. Good job. I definitely plan on using thing.
Do you mine if I upload a gm5 or 6 version? (works in gm5 so it should in gm6)


Name I just though of

Revel's resource revolution :)



anyway whats the licensed?
Would you let us rename the dll? (i'd still give credit)

Edited by fire_soul453, 15 June 2008 - 09:07 PM.

  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#18 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 15 June 2008 - 09:25 PM

Rename the DLL to whatever you want. Credit would be nice though Just a simple: "Resource DLL by Revel Games".


Also, you don't have to name your files <something>.dat. You can use whatever extension you want.

And u don't mind if you upload anything.
  • 0

#19 BigB0ss

BigB0ss

    GMC Member

  • New Member
  • 103 posts

Posted 16 June 2008 - 09:07 AM

»» GM6 DOWNLOAD
  • 0
(\ /)
( . .) ~Copy & Paste To Help
C(")(") Bunny Take Over The World~


Add me to MSN: ajax_3963@hotmail.com

#20 Lukearentz

Lukearentz

    My Two Cents

  • New Member
  • 2587 posts

Posted 16 June 2008 - 09:11 AM

Maybe calling it something like Squish. Lol a really simple Kid style name.
Just an idea.
  • 0
I have left the GMC, and my domain is no longer registered to me.
All previous links will not work, for any information/links please PM me, and I may be able to help you

#21 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 16 June 2008 - 03:03 PM

gm5 version plus example code (can be opened in gm5, gm6, or gm7, and works without any modifications)
Mirror 1

Edited by fire_soul453, 16 June 2008 - 03:10 PM.

  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#22 LoopStan

LoopStan

    North-See Developer

  • GMC Member
  • 1398 posts

Posted 22 June 2008 - 05:33 AM

I dont know if its just me, but is willhostforfood.com having a 500 internal server error? Thanks for the mirror, but sitll.

DLl: I realy like it! It is quite nice and works efficiantly. Thanks, Cant wait for the full version!
  • 0

Posted Image


#23 cbrad24

cbrad24

    GMC Member

  • New Member
  • 96 posts

Posted 22 June 2008 - 08:59 AM

Yes, Thanks alot for mirror. Wilhostforfood is down :) .
This dll is PERFECT!!! I was gona make a folder protection utility program and this is what I need.

Edited by cbrad24, 22 June 2008 - 08:59 AM.

  • 0

#24 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 26 June 2008 - 12:07 AM

thanks for the comments!
  • 0

#25 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 16 August 2008 - 04:24 PM

So you stopped working on it? I would love to see some of those features you mentioned
  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#26 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 16 August 2008 - 04:34 PM

I´m a bit slow with these things and have never used encryption so... could you (Revel) or anyone make a wee example that show how it should be used in a real game? Or at least post the process step by step as I feel that this would be ideal for my game... I don´t want my sprites, tiles and sounds ripped by anyone as there is over a year of hard work in them...
  • 0

U1FVsm3.png

40799.png


#27 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 16 August 2008 - 10:16 PM

I´m a bit slow with these things and have never used encryption so... could you (Revel) or anyone make a wee example that show how it should be used in a real game? Or at least post the process step by step as I feel that this would be ideal for my game... I don´t want my sprites, tiles and sounds ripped by anyone as there is over a year of hard work in them...


Ok first put all your files in a folder. Then use something like this

resource_init_dll(); // int the dll
resource_compress_folder("This is your key",working_directory+\"this is your file you would like to hide all your files in",working_directory+\"this is the folder you have all your stuff in",0);

The 0 is how many parts you want to split the file into. (0 for no splitting)

Then you have your file. You do not need to

In your game you put
resource_extract("This is your key",working_directory+\"this is your file you would like to hide all your files in",temp_directory+"\resources");//use this to decompress a file into a folder

It simple. Just look at the scripts. They explain how to use them. Also look at the example I posted. (look up or here)


Other than that you will have to ask a more specific question

Edited by fire_soul453, 16 August 2008 - 10:17 PM.

  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#28 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 17 August 2008 - 06:13 AM

Okay, thanks fire_soul! I got that working fine...

And thanks to Revel for an incredibly useful dll...
  • 0

U1FVsm3.png

40799.png


#29 Twix

Twix

    GMC Member

  • New Member
  • 3 posts

Posted 19 August 2008 - 08:42 PM

Hey everyone, I'm getting error.. I'm using GM6.. Please have a look at my files, maybe you know how to fix it..

http://willhostforfo...hp?fileid=31226

Thanks..

EDIT - If you've succesfully fixed it, please upload it.. Thanks again..

Edited by Twix, 19 August 2008 - 08:43 PM.

  • 0

#30 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 19 August 2008 - 10:27 PM

Your problem is that it dont know what \ is.
You need to put that in the ""
Like
resource_compress_folder("KEYNUMBER01",working_directory+"\Data.lol",working_directory+"\Data",0);

  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#31 Twix

Twix

    GMC Member

  • New Member
  • 3 posts

Posted 20 August 2008 - 07:09 AM

Okay, thanks, you've fixed this error, but now I'm getting another..

ERROR in
action number 1
of Create Event
for object object1:

Error defining an external function.

Look at the example, am I missng something?.. http://willhostforfo...ad&fileid=31278

Damn..

Edited by Twix, 20 August 2008 - 02:37 PM.

  • 0

#32 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 20 August 2008 - 09:08 PM

It runs fine for me. Did you move the dll? Or change in the code where its located? Or accidentally delete it?
  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#33 Twix

Twix

    GMC Member

  • New Member
  • 3 posts

Posted 21 August 2008 - 08:25 AM

As you can see, I have the .dll in my test foldier, or do I have to put it in somewhere else too? Oh and I didn't change the scripts where it's located, I did nothing.. Even if I download any other people examples like this, it gives me the same error..

Thanks for reply.

Edited by Twix, 21 August 2008 - 08:28 AM.

  • 0

#34 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 04 September 2008 - 06:27 PM

I´m getting exactly the same error as Twix... I tested this (see above post) a while back and it worked perfectly, but now for some reason I´m getting this error... Anyone know why?
  • 0

U1FVsm3.png

40799.png


#35 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 04 September 2008 - 10:43 PM

What OS are you running?
  • 0

#36 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 05 September 2008 - 05:56 AM

Windows XP with the sp2 and actualized... The curious thing is that it has worked in the past... Oh and I´ve downloaded all of the various versions from the other posts and I get the same result...

Edit. After talking with ragnarak he suggested that it might be because the dll needs MSVCR90.DLL to work. Ive downloaded this as a search revealed that I dont have this on my computer, but after putting it in the system32 folder of windows and in the same folder where I have your rsource.dll I still get the same error...

ERROR in
action number 1
of Create Event
for object object1:

Error defining an external function.

Edited by Mark13673, 05 September 2008 - 09:16 PM.

  • 0

U1FVsm3.png

40799.png


#37 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 30 January 2009 - 05:54 PM

Thanks fiDumppi for reporting a broken link!
Got it all fixed up.
  • 0

#38 Janx

Janx

    GMC Member

  • New Member
  • 12 posts

Posted 16 February 2009 - 09:27 PM

hey, i'm using the DLL,
i can run my game 100%, but, when i sent it to my friend, he got an error:
Error defining an external function.

Yes, i send the dll too, and all files he need.

I think i can run the game because i have another DLL that your dll uses, but my friend doesnt have =/

Do your Dll, uses any other dll?? If use, can u tellme which?

Or, why my friend got the error?

Thx
  • 0

#39 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 17 February 2009 - 02:50 PM

It does require Cabinet.dll which I believe is on Windows 98 and later.
  • 0

#40 Human Road

Human Road

    GMC Member

  • New Member
  • 109 posts
  • Version:Unknown

Posted 17 February 2009 - 03:46 PM

@Revel: Will you add a mirror please? That link is not working for me.
  • 0

#41 Marchal_Mig12

Marchal_Mig12

    The Rhouan

  • GMC Member
  • 1182 posts
  • Version:GM:Studio

Posted 27 February 2009 - 02:58 AM

Amazing dll, good compression level, low size dll and only 3 functions. That is awesome. Great for external loading. I will definitely use this later.

Miguel
  • 0

#42 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2750 posts
  • Version:GM:Studio

Posted 07 March 2009 - 01:39 PM

Even with the Cabinet.dll it doesnt work for everybody.
It works finr for me and 8 more people I test my game with, but 2 others get the same bug as most here.
Even with the Cabinet.dll it doesnt work.

Any solution here?
Or can you recommend me another good ressource dll?
I was looking for a simple one and found yours to be working good for me...but as it seems not for everybody.
  • 0

iBNKRoX.png


#43 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 07 March 2009 - 05:43 PM

I'm sorry for the inconvenience. I did not realize this before, but you need MSVCR90.DLL as well. Try putting that in your system 32 and see if everything works.


edit:
I think you might be able to put it in the same folder as the resource dll. Try that and if it doesn't work then put it in system 32.

Edited by Revel, 07 March 2009 - 05:46 PM.

  • 0

#44 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 1506 posts
  • Version:GM:Studio

Posted 12 March 2009 - 06:16 AM

can there be multiple external sections for resources so there is more than 2G aloud in space?
  • 0

Assuming I helped you out in a questions and answers topic won't you return the favour by helping me with one my coding problems, or recommend some one who can chat to me over pms about helping and how to overcome my obstacles, after all lets just say I did help you or them or many people with similar problems, in that topic.

Here i have a topic for those of you struggling with type writer text and mugshots in your games especially if it is a rpg see the link below for more info

http://gmc.yoyogames...howtopic=619103

almost no code needed, only uses two events.

click here for the l8est version of feed the alien pizza, it has some major polished up features.


#45 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 12 March 2009 - 07:02 AM

Revel, why in March are you saying that you did not realize something when I posted here in September letting you know about this problem? And I did as you suggest but never did get it to work, which is a shame as it seemed like one of the easiest to use resource dlls here, but if it relies on a dll which people may or may not have on their PC, then I risk any potential players of my game not being able to play it if I use this...
  • 0

U1FVsm3.png

40799.png


#46 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 20 June 2009 - 01:04 AM

Hello everybody!

I made a brand new Resource DLL that does not have any dependencies! Its alot more powerful (It does not use .CAB file procedures) and It has amazing encryption power.

Check it out Here!

Mods, you can close this topic now.

Edited by Revel, 20 June 2009 - 01:05 AM.

  • 0

#47 Recreate

Recreate

    Furry

  • GMC Member
  • 2992 posts
  • Version:GM:Studio

Posted 20 June 2009 - 01:10 AM

So what this did is just made renamed cabinet files?
  • 0

If the post that you are reading was created prior to 2011. For the safety of the general public, It is not to be regarded under any circumstances.
Please don't ask me to join your group at anything.


#48 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 20 June 2009 - 01:27 AM

No, it was a library used for Creating, and managing Archive files which were based off of the cabinet files.
  • 0

#49 lucb1e

lucb1e

    GMC Member

  • GMC Member
  • 13 posts
  • Version:GM8

Posted 21 July 2010 - 11:22 AM

Sorry for the bump, but could the downloadlink of this dll get updated? It's broken and I'd like to use it. The newer version two posts above seems a little too complicated, the features described of this thing seem exactly fine though.
  • 0

#50 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 21 July 2010 - 06:34 PM

Revel's new DLL replaces this, so no. Learn how to use the new one.
  • -1