[sldev] Fun with 010 Editor + some random tought about texture cache
Laurent Laborde
kerdezixe at gmail.com
Sat Jun 7 10:45:52 PDT 2008
I'm playing with 010 Editor, which is a powerfull Hex editor. (but not
free, not opensource, and 100% Windows).
i use it as a toy, but can be used to read/edit/write/parse/whatever
(it have a script engine) binary file, disk, and process heap.
(kinda the ultimate hacker's tool, but it's not my purpose here).
I'll use it to make some... statitics about the cache.
And maybe create an "offline cache cleaning tool".
(MANY people clean their cache at startup, maybe they won't do that
anymore if they have some kind of "Cache Defragmenter Super+ Gold
Edition Bundle pack")
Anyway... it's for my own pleasure to do some geeky stuff.
Here is the template file :
Nothing less, nothing more, it display all the texture.entries data,
uncluding a shiny reformating to display the texture UUID :
//--------------------------------------
//--- 010 Editor v3.0 Binary Template
//
// File: ReadTextureEntries.bt
// Author: kerunix Flan
// Revision: r1
// Purpose: Playing with texture.entries SL Texture Cache
//--------------------------------------
typedef ubyte LLUUID[16];
typedef struct
{
float mVersion; // Version of ... something ?
uint32 mEntries; // Number of entries.
} EntriesHeader <read=ReadEntriesHeader>;
typedef struct
{
LLUUID mID; // 128 bits
int32 mSize; // total size of image if known (NOT size cached), or -1
if unknown
time_t mTime; // seconds since 1/1/1970
} EntriesBody <read=ReadEntriesBody>;
string ReadEntriesBody( EntriesBody &body)
{
string s;
SPrintf(s,"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",body.mID[0],body.mID[1],body.mID[2],body.mID[3],body.mID[4],body.mID[5],body.mID[6],body.mID[7],body.mID[8],body.mID[9],body.mID[10],body.mID[11],body.mID[12],body.mID[13],body.mID[14],body.mID[15]);
return s;
}
string ReadEntriesHeader (EntriesHeader &head)
{
string s;
SPrintf(s,"Version = %f, Entries = %u", head.mVersion, head.mEntries);
return s;
}
EntriesHeader header;
EntriesBody body[header.mEntries];
//------------------------
Note : It doesn't help at all to "steal" cached texture and i'll never
release that kind of tool.
Note2 : what's the purpose of separating headers from bodies ?
Secure-obscurity ?
Note3 : what is the mVersion ? Version of the file structure ?
Note4 : BareRose HQ is a wonderfull place to stresstest the texture cache.
Bigger-note :
What about storing cache *per sim* ? Most peoples always go in the
same dozen of sim 99% of time and a lot of texture are unique to the
sim.
When you enter in a sim, just load the *entire* cache related to this
sim and discard later the unused texture.
Could it save time ? (pre-decoding ?)
That's all... have fun :)
--
F4FQM
Kerunix Flan
Laurent Laborde
More information about the SLDev
mailing list