Author Topic: Danmakufu .dat File Packer/Unpacker [v2.0]  (Read 28060 times)

Areylie

  • Cirno's Sister
    • Lymia's Website
Danmakufu .dat File Packer/Unpacker [v2.0]
« on: January 23, 2010, 03:49:36 AM »
===th_dnh_archiver v2.0===

Execute <dnharc> or <dnharc.bat> for the command line interface.
Execute <th_dnh_archiver> or <th_dnh_archiver.bat> for the graphical interface.

[attach=1]
[attach=2]
Source code can be found in <src.zip>. Licenced under the GNU General Public Licence v3 or later

Changelog v0.5.0:
  * First release.
Changelog v0.5.1:
  * Fixed typo.
Changelog v0.5.2:
  * Changed code to allow non-continuous file data. (e.g. file data being stored as [file 1][file 3][file 2] instead of [file 1][file 2][file 3])
  * Made the code much more efficent.
  * Implemented the -o flag.
Changelog v1.0:
  * Implemented compression.
  * Fixed fatal bug causing the corruption of almost all extracted files introduced in v0.5.2.
Changelog v1.0.1:
  * Fixed a bug where you couldn't compress directories with subdirectories in them.
Changelog v2.0:
  * Rewritten.
  * Added graphical user interface.

Known Issues:
  * Version v2.0 is currently slower than v1.0.1
  * Due to a hack in place to deal with unacceptably slow compression speeds, you cannot compress files larger than 2GB.



==Danmakufu .dat archive format==

[magic number, 5041434B5F46494C4500]
[4 bytes, little endian, number of files]
[12 bytes*number of files+total length of names (with null terminator), file definitions]
[can be any size, file data]

The format for file definitions is the following:
[4 bytes, little endian, length of name][name, null terminated]
[4 bytes, little endian, offset]
[4 bytes, little endian, file length]

Also, files that begin with [434F4D50524553535F5A495000] are compressed. The format for compressed files follows:
[magic number, 434F4D50524553535F5A495000]
[4 bytes, little endian, uncompressed size of data]
[can be any size, compressed data, compressed using the deflate algorithm]
« Last Edit: March 25, 2011, 08:14:14 AM by Lymia »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Drake

  • *
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #1 on: January 23, 2010, 03:50:56 AM »
Oho, so you cracked it, or does it just randomly compile? Can you play full scripts with just the archive?

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #2 on: January 23, 2010, 03:56:55 AM »
Full scripts do run with just the .dat file as far as I can tell.
Also, http://www.geocities.co.jp/SiliconValley-Oakland/9951/products/th_dnh_archiver.zip
There's a offical packer, though I don't think there's any unpackers yet, other than the almost-done one I have. (Unless it's hidden in a corner of the Japanese wiki)
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #3 on: January 23, 2010, 04:37:44 AM »
v0.5 released.
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #4 on: January 23, 2010, 04:42:27 AM »
v0.5.1 released.

Changelog v0.5.1:
  * Fixed typo.

... ::)
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #5 on: January 23, 2010, 05:16:13 AM »


hurrrrr
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #6 on: January 23, 2010, 05:17:35 AM »
A possible solution to the issue is to install Java.
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #7 on: January 23, 2010, 05:20:22 AM »
It would be, if it weren't already installed.
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
« Last Edit: January 23, 2010, 05:25:24 AM by Legend_Bird »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #9 on: January 23, 2010, 05:26:28 AM »
Just reinstalled to be sure, and it still doesn't work.

I wouldn't know about class paths, I just had it installed initially so I could run web games and such, like everyone else. You'd figure that the installer would have taken care of that, and this is the first time a program that uses Java has messed up on me like this.  :V

Just going to throw this out there, but I'm running Windows XP 64-bit edition. That's thrown a wrench in a few other programs before, maybe it's relevant, I dunno.
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #10 on: January 23, 2010, 05:27:23 AM »
Yeah, the Java installer dosn't set up paths. Might add instructions to the next version's readme. :/

Is the error the same? XP handles drag and drop wierd. If so, try copying th_dnh_archiver.jar to "C:/Documents and Settings/*Your username here*"

P.S. "classpath?" I mean "path." Classpath is a java term.  =P
« Last Edit: January 23, 2010, 05:30:39 AM by Legend_Bird »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #11 on: January 23, 2010, 05:29:23 AM »
Yeah, I would have put in another image if the error had changed. Taking a look at that path stuff now...

Quote
To make a permanent change to the CLASSPATH variable, use the System icon in the Control Panel. The precise procedure varies depending on the version of Windows.

The PATH can be a series of directories separated by semicolons (;). Microsoft Windows looks for programs in the PATH directories in order, from left to right. You should have only one bin directory for the JDK in the path at a time (those following the first are ignored), so if one is already present, you can update that particular entry.

Step 1: Open system.
Step 2: ???
Step 3: Profit!



wonderful

...which file am I supposed to point the thing to, anyways? Those instructions mention a "javac MyClass.java", in Java\jdk1.6.0\bin\, but I haven't found that file in any of the folders most resembling the example(jre6\bin\, jre1.6.0_03\bin\, jre1.6.0_05\bin\, jre1.6.0_07\bin\). Bleh.
« Last Edit: January 23, 2010, 05:39:24 AM by Prime 2.0 »
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #12 on: January 23, 2010, 05:30:57 AM »
You can also modify the .bat files to use the full path to java.exe, instead of just "java"

Wait, do you even know where Java is installed to? `-`
« Last Edit: January 23, 2010, 05:37:19 AM by Legend_Bird »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #13 on: January 23, 2010, 05:38:06 AM »
Yeah, I would have put in another image if the error had changed. Taking a look at that path stuff now...

Step 1: Open system.
Step 2: ???
Step 3: Profit!



wonderful
http://www.computerhope.com/issues/ch000549.htm
wonderful
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #14 on: January 23, 2010, 05:42:58 AM »
Wait, do you even know where Java is installed to? `-`

More like I have a Java folder with 4 directories, all with their own bin subdirectories and Java executables. I'm going to try the one in jre1.6.0_07.

EDIT: well, I added it as both a system and a user variable. Same error.
« Last Edit: January 23, 2010, 05:45:41 AM by Prime 2.0 »
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #15 on: January 23, 2010, 05:46:29 AM »
Replace "java" in the bat file with the full path to java.exe
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #16 on: January 23, 2010, 05:53:31 AM »
Unable to find th_dnh_archiver.jar. I even copied it to my documents folder like you said, no dice.

EDIT: and on a wild hunch, I copied it over into the directory where the Java executable was. Naturally, it didn't work.  :V
« Last Edit: January 23, 2010, 05:56:11 AM by Prime 2.0 »
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #17 on: January 23, 2010, 05:56:57 AM »
Unable to find th_dnh_archiver.jar. I even copied it to my documents folder like you said, no dice.
Not the Documents folder. Your user directory. Press "Go Up One Directory", or whatever is equivalent.
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #18 on: January 23, 2010, 06:01:26 AM »
Okay, Decompression complete.

So where did the decompressed files get put? :E
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #19 on: January 23, 2010, 06:02:35 AM »
All over your home directo- jk, The directory "output" in the same directory that th_dnh_archiver.jar is in.
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #20 on: January 23, 2010, 06:04:43 AM »
Ah, I see...It worked on th_dnh.dat.


...now if only it worked on the Cconcealed the Conclusion dat files, then I'd really be in business.
The SoEW patch has had its second release, come and get it!

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #21 on: January 23, 2010, 06:06:52 AM »
Those are common data files. Not .dat archives.
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #22 on: January 23, 2010, 06:09:43 AM »
Ah. They use the same extension, so I thought that those might have been more or less the same thing...


However, if you were to make something to let me properly view and alter said common data files, that would be really awesome(not that what you've done already isn't pretty sweet).
The SoEW patch has had its second release, come and get it!

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu .dat File Packer/Unpacker [v0.5]
« Reply #23 on: January 23, 2010, 08:31:33 AM »
Merged the file format specifics thread to save a bit of space, since there's not much discussion to be had on that subject alone.

Also, this topic is now in the Tutorial Index misc. information section.
« Last Edit: January 23, 2010, 08:36:28 AM by stuff mania »

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5.2]
« Reply #24 on: January 24, 2010, 09:57:48 PM »
v0.5.2 released.

Changelog v0.5.2:
  * Changed code to allow non-continuous file data. (e.g. file data being stored as [file 1][file 3][file 2] instead of [file 1][file 2][file 3])
  * Made the code MUCH more efficent.
  * Implmented -o flag.
« Last Edit: January 24, 2010, 10:02:37 PM by Nanoha Takamachi »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu .dat File Packer/Unpacker [v0.5.2]
« Reply #25 on: January 25, 2010, 07:13:08 PM »
i wonder what the use of this is, if you can actually unpack everything.
the original archiver existed so people wouldn't steal the scripts you made

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu .dat File Packer/Unpacker [v0.5.2]
« Reply #26 on: January 26, 2010, 12:33:46 AM »
Yeah, this seems like it exists solely to steal other peoples' work. If they wanted you to access the files, they would have released it as a folder instead of an archive... I'm all for everything being open-source too, but I still think the author's preference should come first.

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5.2]
« Reply #27 on: January 26, 2010, 03:12:32 AM »
If anyone else objects, I could take it down. Anyways, I doubt anyone could really steal other's work with this, one reason being that it's hard as hell to reconstruct the folders after decompression- Danmakufu ignores directories while dealing with .dat packed files.
« Last Edit: January 26, 2010, 03:15:46 AM by Nanoha Takamachi »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5.2]
« Reply #28 on: February 07, 2010, 01:47:56 AM »
The bug has been fixed. I'm going to write code to create archives, and then I'll upload that.
« Last Edit: February 07, 2010, 02:31:20 AM by Nanoha Takamachi »
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]

Areylie

  • Cirno's Sister
    • Lymia's Website
Re: Danmakufu .dat File Packer/Unpacker [v0.5.2]
« Reply #29 on: February 07, 2010, 06:32:13 AM »
v1.0 released.

Changelog v1.0:
  * Implmented compression.
  * Fixed fatel bug causing the corruption of almost all decompressed files. (that was introduced in v0.5.2 - woops)
[Geek code (3.12): GCS/H/M d+(-) s+:->--:- a--->? C+(++++)>$ UL++@ P+(++) L+++ E- W++ N o K? w-@ O- M- V? PS++@ PE>- Y+ PGP++ t- 5? X? R+@ tv- b+(++) DI D-- G? e>+++(++++) h! r++ x-]
[Furry code (1.3): FFm1r A !C D? H+++ M? P++++ R-- T W !Z Sf! RLCT a- cl+~++++>$ d--- e>+++ f? h* i++/+++ j+ p+ sf!]