villermen / runescape-cache-tools

A .NET library and command-line interface to interact with RuneScape's cache.
MIT License
78 stars 17 forks source link

Structure of Index 19 #77

Closed zwrtron closed 3 years ago

zwrtron commented 3 years ago

I've tried to extract index 19 (item definitions). The export produced a lot of (201) ".entries" files. I could notice item names in HxD, but I would like to read them into memory of my program for further processing as the structure of the item does not seem to be aligned due strings. What is the structure of the .entries file / how to read it?

I have a knowledge that the structure of the index is something like array of [OpCode][Value].

Thanks in advance.

villermen commented 3 years ago

Those entry file usually contain around 255 files each. Extracting them into individual files is what the tool used to do, but it got really heavy on the storage (even on SSDs).

I added a TODO to reenable this behavior: https://github.com/villermen/runescape-cache-tools/blob/87c247e6545f96b4239b9f7616729c12876788c8/RuneScapeCacheTools/Cache/FlatFileCache.cs#L115

For now the only way to do this is by using the library instead of the CLI. Something like:

var cache = new DownloaderCache();
var file = cache.GetFile(CacheIndex.Entries, 17);

foreach (var entry in file.Entries) {
    // entry.Key = entry ID (integer)
    // entry.Value = entry data (byte[])
}