Jump to content
Shogun

FileArchiver

Recommended Posts

File Name: FileArchiver

File Submitter: Shogun

File Submitted: 03 Feb 2014

File Category: Tools



I am proud to release exclusively for metin2dev -with the blessing from its author Tim Niederhausen- the latest version of the original FileArchiver command line tool, which is now divided into two Windows executables:
FileArchiver_Eterpack (r3869)
This command line tool can pack and unpack EterPack (epk) files. Types 0, 1, 2 and 3 are supported for the packing function. Parameters are configured through xml files:

FileArchiver_Eterpack.exe rootpack.xml


Optionally you can drag and drop the xml file over FileArchiver_Eterpack.exe in Windows Vista and higher.
Unpacking
Example XML: unpack root.epk to the folder root_unpacked. ArchivePath is the path to the packed file (without extension) and OutputPath is the folder where files should be written.

<ScriptFile>
<ExtractEterPack ArchivePath="root" OutputPath="root_unpacked/" CreateXml="No" />
</ScriptFile>


Example XML: unpack a series of epk files, creating a xml file that we can use to pack them back later with FA. CreateXml and XmlPath elements are self explanatory here.

<ScriptFile>
<ExtractEterPack ArchivePath="yt2/pack/uiloading" OutputPath="yt2_unpacked/" CreateXml="Yes" XmlPath="uiloading_pack.xml" />
<ExtractEterPack ArchivePath="yt2/pack/etc" OutputPath="yt2_unpacked/" CreateXml="Yes" XmlPath="etc_pack.xml" />
<ExtractEterPack ArchivePath="yt2/pack/uiscript" OutputPath="yt2_unpacked/" CreateXml="Yes" XmlPath="uiscript_pack.xml" />
</ScriptFile>


Packing

Example XML: Create uiloading.epk with Type 2 (LZO packed and XTEA key); note how ArchivePath is the path to write the packed file, ArchivedPath is the absolute path of each file in the Metin2 virtual filesystem, while CDATA is the actual location of the file in our PC (relative or absolute)

<ScriptFile>
<CreateEterPack ArchivePath="../bin/pack/uiloading">
<File ArchivedPath="d:/ymir work/uiloading/loading0.jpg" Type="2"><![CDATA[uiloading/loading0.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading1.jpg" Type="2"><![CDATA[uiloading/loading1.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading2.jpg" Type="2"><![CDATA[uiloading/loading2.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading3.jpg" Type="2"><![CDATA[uiloading/loading3.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading4.jpg" Type="2"><![CDATA[uiloading/loading4.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading5.jpg" Type="2"><![CDATA[uiloading/loading5.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading6.jpg" Type="2"><![CDATA[uiloading/loading6.jpg]]></File>
<File ArchivedPath="d:/ymir work/uiloading/loading7.jpg" Type="2"><![CDATA[uiloading/loading7.jpg]]></File>
</CreateEterPack>
</ScriptFile>


Example XML: Create a Type 3 (Panama) file. IvPath contains the path to a 32 byte file that will be used as key. Obviously, you should not share this file. This encryption requires a server part which is explained below.

<ScriptFile>
<CreateEterPack ArchivePath="../bin/pack/metin2_mypatch" IvPath="iv/mypatch.iv">
<File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1.gr2]]></File>
<File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1.dds" Type="3"><![CDATA[pc/assassin/assassin_5_1.dds]]></File>
<File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1_lod_01.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1_lod_01.gr2]]></File>
<File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1_lod_02.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1_lod_02.gr2]]></File>
<File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1_lod_03.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1_lod_03.gr2]]></File>
</CreateEterPack>
</ScriptFile>


Panama encryption: serverside setup

Once you have your Panama encrypted packs, you need to upload the keys to auth/panama along with a text file called panama.lst containing a list of files to be decrypted with their respective key file, separated by tabs.

Example panama.lst file:

pack/mypatch     mypatch.iv
pack/terrainmaps terrainmaps.iv
pack/tree        tree.iv


Caveats: you can not encrypt the root with panama. Also, if a pack encrypted with panama contains armors or hairstyles, these may not appear in the character selection screen.

FileArchiver_Proto (r2806)
This tool also takes an xml file as parameter and is intended to read and write clientside item_proto and mob_proto files.
Example XML: Read a clientside, packed item_proto and write it to to a xml file

<ScriptFile>
<ReadItemProto ItemProtoPath="item_proto" OutputPath="item_proto.xml" />
</ScriptFile>


Example XML: Write back, once edited, our XML file as a packed item_proto file.

<ScriptFile>
<WriteItemProto ItemProtoPath="item_proto" InputPath="item_proto.xml" />
</ScriptFile>


Now for the mob_proto (Only use the Proto archiver for this one!!!):
To extract it from the client use this XML

<ScriptFile>
	<mob_proto_extract path="mob_proto" output="mob_proto.xml" />
</ScriptFile>


To pack it back use this one:

<ScriptFile>
        <mob_proto_create path="mob_proto.xml" output="mob_proto_edited" />
</ScriptFile>


For questions and comments, you can post in this same thread.



Click here to download this file

  • Love 18

Share this post


Link to post

Big thanks to Tim Niederhausen from me too.

This is a real nice Archiver. I will make an UI for it today or tomorrow.

 

King regards

Chuck

Share this post


Link to post

Big thanks to Tim Niederhausen from me too.

This is a real nice Archiver. I will make an UI for it today or tomorrow.

 

King regards

Chuck

Please make one like EterNexus :D

Share this post


Link to post

Thanks for share, and another thanks for Tim.

Share this post


Link to post

Some people reported a problem with item/mob proto extraction. After checking with Tim I realized I had forgotten something in my guide.

 

You need to have <ScriptFile> tags in your xml. Guide and sample xmls are corrected now.

Share this post


Link to post

how i create the file .iv ?¿

 

bcs i see the sample.iv stay crypted no?¿

 

and btw when i crypt with iv and i decompress if i dont have the key the files have 0 kb ?¿

Share this post


Link to post

That's right, you need the key to decompress them.

 

To generate an iv file the easiest way is to go here:

 

http://www.random.org/bytes/

 

Enter 32 in the byte field and Download as file, you got an iv file now.

Share this post


Link to post

That's right, you need the key to decompress them.

 

To generate an iv file the easiest way is to go here:

 

http://www.random.org/bytes/

 

Enter 32 in the byte field and Download as file, you got an iv file now.

The archiver can generate an IV file too.

Just point IvPath to a non-existent file and it will be created for you.

 

Kind Regards,

Tim

 

PS: Just setting an IV path does not cause all files to be encrypted. You still need to use type 3 / PANAMA.

  • Love 5

Share this post


Link to post
Guest

The archiver can generate an IV file too.

Just point IvPath to a non-existent file and it will be created for you.

 

Kind Regards,

Tim

 

PS: Just setting an IV path does not cause all files to be encrypted. You still need to use type 3 / PANAMA.

Thanks for pointing that out i updated the thread :)

Share this post


Link to post

Sorry for the question but, what binarys suport Type 3 ?¿, bcs 34669 and 36469 suport only 0, 1 25725 suport 0,1,2 and 28249 i dont know.

 

And how i extract a file crypted with panama?¿

 

Best Regards

 

Deadman

Share this post


Link to post

To extract a Panama encrypted file you need the key.

 

<ScriptFile>
<ExtractEterPack ArchivePath="mypatch" OutputPath="mypatch/" IvPath="mypatch.iv" CreateXml="No" />
</ScriptFile>

Share this post


Link to post

ty shogun for how to extract a panama files.

 

You have any binary with Type 3 for release?¿

 

or how i use panama on 34669, or 36469?¿

 

Best Regards

 

Deadman

Share this post


Link to post

ty shogun for how to extract a panama files.

 

You have any binary with Type 3 for release?¿

 

or how i use panama on 34669, or 36469?¿

 

Best Regards

 

Deadman

 

All the clients / servers from 2010 or newer support it.

Share this post


Link to post

i do the steps of this post and the crypt panama dont works or btw in 34669 dont work (i dont know if the binary is the problem).

 

if anyone have a binary or help for use the panama crypt post here please.

 

Best Regards 

 

Deadman

Share this post


Link to post

hi Tim
I would have the problem that the Gf item_proto.xml is not repack
I did it the way it was written in xml
:

 

 

<ScriptFile>
<WriteItemProto ItemProtoPath="item_proto.xml" OutputPath="item_proto" />
</ScriptFile>
 

This error was

 

You need to specify the output path of your item_proto XML file.

 

 
What do I do now?

Share this post


Link to post

 

hi Tim

I would have the problem that the Gf item_proto.xml is not repack

I did it the way it was written in xml :

 

 

<ScriptFile>
<WriteItemProto ItemProtoPath="item_proto.xml" OutputPath="item_proto" />
</ScriptFile>
 

This error was

 

You need to specify the output path of your item_proto XML file.

 

 
What do I do now?

 

 

Try running it from command line instead of dragging the xml file over FileArchiver_Proto

Share this post


Link to post

It's a great tool
There is a problem after compress item_proto
I cannot use some  items like : "Segensschriftrolle" and other items
any solved ?
and thank's
Shogun
ChuckNorris
Tim
best regards

Share this post


Link to post

There is a problem in compiling files with special characters. Here I leave some pictures

 

59k1EOV.png

 

qEgrmm1.png

 

 

 

I have a question:

 

better compile with type 1 or type 2 for binary 28249?

 

 

 

 

Share this post


Link to post

There is a Problem with the ApplyType0 when its be 8 and the ApplyValue0 is - it creates the number like: 4294967281

 

in my own converter for sql i do this:

                        switch (rApplyValue0) {
                            case "4294967281":
                                rApplyValue0 = "-15";
                                break;
                            case "4294967282":
                                rApplyValue0 = "-14";
                                break;
                            case "4294967283":
                                rApplyValue0 = "-13";
                                break;
                            case "4294967284":
                                rApplyValue0 = "-12";
                                break;
                            case "4294967285":
                                rApplyValue0 = "-11";
                                break;
                            case "4294967286":
                                rApplyValue0 = "-10";
                                break;
                            case "4294967287":
                                rApplyValue0 = "-9";
                                break;
                            case "4294967288":
                                rApplyValue0 = "-8";
                                break;
                            case "4294967289":
                                rApplyValue0 = "-7";
                                break;
                            case "4294967290":
                                rApplyValue0 = "-6";
                                break;
                            case "4294967291":
                                rApplyValue0 = "-5";
                                break;
                            case "4294967292":
                                rApplyValue0 = "-4";
                                break;
                            case "4294967293":
                                rApplyValue0 = "-3";
                                break;
                            case "4294967294":
                                rApplyValue0 = "-2";
                                break;
                            case "4294967295":
                                rApplyValue0 = "-1";
                                break;
                        }

Maybe someone can fix this

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.