MediaToEXE - PackMaker V1.2b

Started by Big C., August 14, 2006, 09:59:01 AM

Previous topic - Next topic

Big C.

PlayBasic MediaToEXE_PackMaker Demo (C) 2006 Big C.
---------------------------------------------------

This is a Beta-Version (demo) of a PB-Tool to protect
your hard Image and Sound/Music work.


History:

V1.2 beta
- added Music File support with extension "it"
- updated Filelist creation (PackMaker only)
- make a backup file from the Source Exe (PackMaker only)

V1.1 beta
- added support for PackMaker to make standalone Pak-File
 (For easier use with the DLL in your Project this Program provide you a extra FileList)
- added support for PackViewer to read standalone Pak-File
- added a DLL-File for use in your own Projects

V1.0 beta
- public preview/demo



############ NOTICE - Absolutely paying attention please! ##################

- To test this tool it's recommended to make a copy from your Project!

- No liability for damages or destruction at your source code is taken over!

- The use, also a test, happens onto your own responsibility!

- This tool will NOT modify your sourcecode!

############################################################################



How to use PackMaker/PackViewer:

1. guarantees, that all GFX/SFX-Files/Folder with all needed Media Files for your Project
  will be in the Project Folder. You Can't make a choice of the Media Files which you want
  to pack! So, if you doesn't clean up your GFX/SFX-Files/Folders PackMaker will pack all
  supported Files!
2. If you want then make a compilied Version of your ready project
3. put the MediaToEXE_PackMacker into the root of your Project Folder
4. Run the PackMaker
6. Take a Choice with F1 if you want to make a standalone Pak-File or not
7. Type in the Filename of your EXE-/Pak-File without Extension and push Enter-Key
  The PackMaker can make a standalone search for all supported Mediafiles!
8. After the pack process you will have a EXE or standalone Pak-File
  with all supported Mediafiles within. For easier use with the DLL in your Project a Filelist
  will be created in the root too!


After that you can use MediaToEXE_PAckViewer V1.0 beta (demo) to proof your
packed EXE. This tool will extract automatically the packed Media Files, load them
all and you can browse with the little Viewer through all supported files. But
there is one limitation: Music files can only be played one time...


How to use MediaToEXE-Unpacker.dll

It will be expected that the DLL is in the same folder as your packed EXE or standalone Pak-File!

Result$ = CallDll$(DLLNumber,"ExtractPackedFile","<SourcePackedFile>", "<TempFolderToExtract>", <PackCountNumber>)

Parameters:

<SourcePackedFile>    = The Name of your packed EXE or standalone Pak-File
<TempFolderToExtract> = A Foldername for extraction. If Name is "" then all files will extract in the root.
                                  If Name is "Std" all files will extract in default Folder "Media". Or you choose your own
                                  folder if you want
<PackCountNumber>     = The Number of File which you want to extract (See created Filelist!)

Returns:

Result$ = Holds the filename of the extracted file to use for loading or deleting after loading
             If an error occurs then the variable Result$ can have 3 values in String format
            -1 = The SourcePackFile (EXE or standalone) doesn't exist or doesn't access
            -2 = The Pack-Signature is wrong or doesn't exist
            -3 = The PackCountNumber is out of range

See example code...

Download V1.2b

Please take the time to leave feedback

thx Big C.



Related Articles:

     * PlayBASIC V1.64O Includes Media Binding (loading media from memory)

     * PlayPackager (WIP THREAD)



Ian Price

It appears to work well :D

Is it possible yet to use the .PAK files with the .EXE?

Have you solved the problem with the music playback yet?

Excellent work Big C. Keep it up :)
I came. I saw. I played some Nintendo.

Big C.

Hi Ian,

thx for your feedback...  :)

QuoteIs it possible yet to use the .PAK files with the .EXE?
With the added DLL you can use standalone pak-files to extract, load and delete (from within the EXE) your media-files from your ready to publish game exe (see added example)... or use the DLL for extraction directly from the ready to publish exe. But if you want to use the DLL from the exe you must have a filelist to get the count numbers which will assign to your medias. So I would make a Test EXE and pack all my needed medias for the game to the Test EXE to get the needed filelist with the assignment. After this I would changing my sourcecode... (two things you have pay attention: 1. check if the DLL is correct loaded 2. remember that this tool do not support subfolders)

QuoteHave you solved the problem with the music playback yet?
until now still not  :( But I think its a limitation of PB because in the help of PlayMusic you will find this fact: Unlike Sounds, PlayMusic spools the music source off the disc while playing.

(P.S.: rename the DLL to the name of your project i.e. RR.DLL or RockRush.DLL  ;)

Ian Price

I'm not sure if I'll be able to use it as it is, as I use a function to load my images (anim images), rather than the usual LoadImage command. I'll have to do some testing...
I came. I saw. I played some Nintendo.

Big C.

Hi Ian,

to make it easier for you, I have modified your Combo-Entry JetPak... (remember: Music Files will play once under Options) :)

but pay attention: With this modification you will get compiler errors after starting game (causes by the command GetSpriteLocalInt). I don't know why... Do you?

Ohh, you must use the updated package V1.2b because I found a music file with extension "it" (what format is this?) in your project...

Big C.

Ian Price

#5
I know exactly what the problem is there - I created JetPak before Kevin introduced the sprite "insurance" code (PB 1.08 IIRC) that prevented sprites that didn't exist from being accessed (which my code did - causing the error). I've long-since modified my sprite routines, which no longer try to access non-existant sprites. I now use the latest PB to code, so it shouldn't be a problem.

TBH that problem is one of the reasons I never completed my started update of JetPak - it would have meant altering all of the sprite routines. Not a difficult task, but a lengthy, boring one.

The .IT music file is a .MOD file, the same as .S3M or .XM etc. IIRC it does get loaded into memory, much like a .WAV file, so it can be re-played time and again, unlike .MP3.

Sounds like you're cooking with gas Big C. :D

[EDIT] Just had a look through your update of my JetPak PB code - making the change to adopt your system shouldn't cause  any real problems at all. The pros definitely outweigh the cons. Well done :)
I came. I saw. I played some Nintendo.

eatfishy

I was thinking of going back to Dark Basic Pro because Playbasic lacks the media protection. But now...this really convince me to stick with Playbasic. Thanks Big C.

Adaz

Hi,

I know this is a beta, but could be already usable if there was a password protection in it.
Everyone can extract the media files from my packed exe if he has the unpacker.
Are you planning to integrate it Big C?

thanks

Ádáz

Hungary

Ian Price

How many people will actually want to extract the media and know where to look for the extractor? Even with protection, if someone wants to copy media, they'll find a way.

Where is Big C anyway? - haven't seen much of him lately. :(
I came. I saw. I played some Nintendo.

Adaz

Quote from: Ian Price on October 14, 2006, 08:09:39 AM
How many people will actually want to extract the media and know where to look for the extractor?
When I will publish my game, I will advertise PB with it. So if somebody knows that this was written in PB, and wants to steal the graphics or music, he will easily find this forum and Big C's unpacker :-)
Quote
Even with protection, if someone wants to copy media, they'll find a way.
Not certainly if it's protected with a strong password which contains only non-readable characters so it cannot be seen in the compiled binary file if you search it with PgDn, PgDn, PgDn, PgDn :))

Ádáz

Hungary

Ian Price

I am a retrogamer and I rip graphics and other media from games with protection - if someone really wants it, they'll get it no matter what. For the majority though, it won't be a problem.
I came. I saw. I played some Nintendo.

Adaz

I'm waiting for the new version, that's a pretty cool project!
Big C? When? :)

Ádáz

Hungary

Ian Price

Where is Big C? He hasn't been around for a while? :(
I came. I saw. I played some Nintendo.

Adaz

I hope he's not catched by the facehugger:)

Ádáz

Hungary