Jump to content

FileArchiver


Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

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.

 

 

  • Metin2 Dev 55
  • Dislove 3
  • Think 1
  • Confused 1
  • Scream 4
  • Good 35
  • Love 7
  • Love 67
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Bot

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 :)

english_banner.gif

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

  • Premium

 

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

Link to comment
Share on other sites

  • 3 weeks later...
  • Premium

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

..,-

Link to comment
Share on other sites

Announcements



×
×
  • 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.