You are on page 1of 4

[b]About:[/b]

This release is a package of updated tools I have been working on regarding PK2
files. At this point, I fully understand the PK2 structures so I can easily read
and write them. However, as with any complex process, it takes a lot of time and
progress to come up with final polished solutions that give people everything they
want. This release is a step in that direction. Included are 5 updated tools:
Builder.exe, Defragmenter.exe, Editor.exe, Extractor.exe, and Lister.exe. Please
refer to the Instructions section for a brief overview and then the Screenshots
section to see more specific information.

The highlights of this new code is as follows:

* Updated PK2 reading code to work one directory at a time. This reduces overall
memory usage and increases processing speed for quick tasks.

* Fully implemented the PK2 structure. All known fields and logic have been worked
out. (* There is one potential thing left for testing, but it's not a huge concern
for now)

* Updated the PK2Extractor to be really simple now. It does include more features
than the older VB6 version though, such as being able to extract folders w/
children, see the file size, support multiple blowfish keys, and would show/extract
all PK2 entries (there are some bugs in the VB6 version in this regards).

* Added a PK2Builder class for building new Pk2s. Through this logic, the
Defragmenter is easily coded as well.

* Updated Defragmenter logic using PK2Builder and PK2Reader. It's a lot simpler now
and easy to follow and use.

* Updated the old PK2Writer code that is dependent on GFXFileManager.dll. While I


am working on code to replace this, it is still the primary means for editing Pk2
files without using a DownloadServer.

* Using updated core code for Blowfish and some other shared files in the Common
folder.

While I have done quite a bit of testing with this code, I [U]always[/U] find
various bugs here and there in all my work, so please make backup copies of all
your stuff before you use anything in case something goes wrong. While I try to
make sure I get serious bugs out of the way, it is possible I might have missed
some, but only extensive use of the tools will show that.

[b]Instructions:[/b]
[quote]
PK2Tools
pushedx

Builder.exe
Builds new PK2s from existing folders.

Usage:
Builder <input folder> <output name> <key index>

"input folder" - The path to the folder to create a PK2 of.


"output name" - The title of the PK2, do not add an extension.
"key index" - 0 for standard PK2 key, 1 for non-standard PK2 key (ZSZC,
SWSRO)
Example:
Builder "C:\MyData" "mydata" 0

Defragmenter.exe
Defragments existing PK2s into optimized versions.

Usage:
Defragmenter <pk2>

"pk2" - The full path to the PK2 file to defragment. The output is
saved
into this directory, so make sure you have Admin access to it.

*** Your PK2s are NOT modified in any way. ***

Example:
Defragmenter "C:\Program Files\Silkroad\media.pk2"

Lister.exe
Generates a log file of all PK2 entries.

Usage:
Lister <pk2>

"pk2" - The full path to the PK2 file to defragment. The output is
saved
into this directory, so make sure you have Admin access to it.

*** Your PK2s are NOT modified in any way. ***

Example:
Lister "C:\Program Files\Silkroad\media.pk2"

Editor.exe
Allows adding new files and folders to a PK2.

*** GFXFileManager.dll must be in the same folder as the PK2 you are editing!

Extractor.exe
Allows extracting files from a PK2.
[/quote]

[b]Screens:[/b]

[b]Builder.exe[/b]
[URL=http://img199.imageshack.us/i/ss1lf.png/]
[IMG]http://img199.imageshack.us/img199/8192/ss1lf.th.png[/IMG][/URL]
[URL=http://img440.imageshack.us/i/ss2o.png/]
[IMG]http://img440.imageshack.us/img440/522/ss2o.th.png[/IMG][/URL]
[URL=http://img340.imageshack.us/i/ss3h.png/]
[IMG]http://img340.imageshack.us/img340/328/ss3h.th.png[/IMG][/URL]
[URL=http://img203.imageshack.us/i/ss4gw.png/]
[IMG]http://img203.imageshack.us/img203/9388/ss4gw.th.png[/IMG][/URL]

[b]Defragmenter.exe[/b]
[URL=http://img16.imageshack.us/i/ss1y.png/]
[IMG]http://img16.imageshack.us/img16/9346/ss1y.th.png[/IMG][/URL]
[URL=http://img24.imageshack.us/i/ss2o.png/]
[IMG]http://img24.imageshack.us/img24/522/ss2o.th.png[/IMG][/URL]
[URL=http://img580.imageshack.us/i/ss3h.png/]
[IMG]http://img580.imageshack.us/img580/328/ss3h.th.png[/IMG][/URL]
[URL=http://img690.imageshack.us/i/ss4o.png/]
[IMG]http://img690.imageshack.us/img690/5346/ss4o.th.png[/IMG][/URL]

[b]Editor.exe[/b]
[URL=http://img716.imageshack.us/i/ss1w.png/]
[IMG]http://img716.imageshack.us/img716/5356/ss1w.th.png[/IMG][/URL]
[URL=http://img825.imageshack.us/i/ss2r.png/]
[IMG]http://img825.imageshack.us/img825/9263/ss2r.th.png[/IMG][/URL]
[URL=http://img205.imageshack.us/i/ss3eg.png/]
[IMG]http://img205.imageshack.us/img205/5963/ss3eg.th.png[/IMG][/URL]

[b]Extractor.exe[/b]
[URL=http://img530.imageshack.us/i/ss1qy.png/]
[IMG]http://img530.imageshack.us/img530/7936/ss1qy.th.png[/IMG][/URL]
[URL=http://img188.imageshack.us/i/ss2xp.png/]
[IMG]http://img188.imageshack.us/img188/8728/ss2xp.th.png[/IMG][/URL]
[URL=http://img97.imageshack.us/i/ss3xp.png/]
[IMG]http://img97.imageshack.us/img97/6480/ss3xp.th.png[/IMG][/URL]
[URL=http://img64.imageshack.us/i/ss4n.png/]
[IMG]http://img64.imageshack.us/img64/4474/ss4n.th.png[/IMG][/URL]
[URL=http://img837.imageshack.us/i/ss5a.png/]
[IMG]http://img837.imageshack.us/img837/8830/ss5a.th.png[/IMG][/URL]
[URL=http://img203.imageshack.us/i/ss6u.png/]
[IMG]http://img203.imageshack.us/img203/1254/ss6u.th.png[/IMG][/URL]

[b]Lister.exe[/b]
[URL=http://img186.imageshack.us/i/ss1l.png/]
[IMG]http://img186.imageshack.us/img186/4730/ss1l.th.png[/IMG][/URL]
[URL=http://img826.imageshack.us/i/ss2z.png/]
[IMG]http://img826.imageshack.us/img826/2588/ss2z.th.png[/IMG][/URL]

[b]Virus Scan:[/b] [URL=""]VirusTotal[/URL]

[b]Download:[/b] Attached (binary + source)

[b]FAQ:[/b]

[I]Q. Can I delete files?[/I]


A. Not yet! You can extract all files in a PK2 first, then run the builder on that
folder after removing the files you no longer wish. That is not optimal for
deleting a file or two, but if you really want the file gone...

[I]Q. Is there a faster way to delete a file?[/I]


A. You can import in a new file with the same name and a 0 length to clear the
content. But that's it. The PK2 structure was not really meant to have files
deleted "easily" due to how the DownloadServer was setup.

[I]Q. Can I use these tools with the older tools?[/I]


A. No. The older tools, most notably the PK2Reader, contain serious bugs that can
cause problems or crashes. Use the new versions and report any bugs that you come
across since they are now the current versions.

[I]Q. What is the Lister for?[/I]


A. Since the PK2Extractor no longer has search capabilities, this tool has been
added so users can at least use a document editor and find files as needed.
[I]Q. Can I use the Builder for non-Silkroad stuff?[/I]
A. Yes! I have included the source code in a PK2 file to show this. However, the
PK2 format is rather a lousy archive format, so it's not really recommended to use
the PK2 format in place of something else outside of Silkroad. You can if you want
though.

[I]Q. After using the Defragmenter, Editor, or Builder, the PK2 files no longer
work with Silkroad?[/I]
A. They should, please report the bug and be as detailed as you can as to what you
were doing, which versions of Silkroad you were using, and any other useful
information that could help me find the error and fix it.

[b]End[/b]

Enjoy! Please report any bugs or leave feedback. Community involvement helps make
for better tools and knowledge for everyone!

You might also like