Miscellaneous Forums > Scripting and Reverse Engineering

Help me. How the heck do i make individual files load ?

(1/4) > >>

DLPB_:
Aali and 7h can load individual files from your hd outside of the archives. At the moment my mod manager is sleek and simple but it really could benefit from this feature. Without hooks I've managed to load the archives from new locations but i do not understand in any way shape or form how id make ff7 locate say aaaa.hrc on my hd instead of out of char.lgp. in fact im not even sure if ff7 loads all the files contained within to memory. It seems to? Are 3rd party dll hooks the only way of doing this or can i rewriteva ff7 function or two. I'd prefer the latter since 7h is chocabloc with 3rd party dlls.

My own dll can intercept functions if need be - but at the moment, all I've managed to do is locate and change path at the memory location the actual archives are loaded.  The functions related to that are a complete mystery to me.

nfitc1:
Ugh. I've been wondering this exact thing for a long time. Aali's driver intercepts the archive loading routines and replaces game files with whatever it finds in specified directories. At least that's the way I remember it working. It's probably something more complex than that. I don't even know if the entire lgp archive structure is known. I've looked at it several times over the years and I still can't make heads-or-tails out of how it knows which file to pull.

DLPB_:
The source for 7H is online and you can see from that that it'#s doing some sort of lgp lzs decoding too.  But i don't know C.  And to be frank, I fucking hate C.  I hate it with a passion.  Coming from Delphi to that makes me want to weep for the world.

JWP knows his stuff when it comes to this kind of thing.  Would love to see how it's done.

I can load different archives from anywhere I like by pushing a new path into a loading function.  From there I assume that the files are read to memory.  It's all easy with source, of course... but with asm it's beyond me.  And I think 7H and aali are diverting calls at the api level - not just rewriting functions.

DLPB_:

--- Code: ---FF7's "is_lib.cpp"
If you carefully read the previous posts, you may have notice some function calls commented with is_lib:; these functions belong to the is_lib module which performs the read operations on .lgp files (i.e archives).

The access to an archive is basically done with the next calls:
C_00675511; "opens" the archive file, and associate it with and Id (must be below 0x12); subsequent calls will use this Id only.
C_006759D2; allows to get the starting offset of an item (identified by name) in an opened archive (identified by its Id); since the caller uses this offset only as a parameter to subsequent calls, it maybe easier to consider this function as an "opener" and the offset as a "handle".
C_006762EA; returns the size of an entry (identified by its "handle") inside an opened archive.
C_0067633E; loads an entry into a buffer provided by the caller.
C_00675F1D; "closes" an archive
C_00676064; cleans the module, i.e closes all opened archives
--- End code ---


The function I am changing pushes to is at 00675511.  Aali is hooking at 006759D2 to load individual files and handle it all.

DLPB_:
 WM module for example pushes files at 75938C. 

Might be that the files need to be loaded into memory and pointers adjusted.

Navigation

[0] Message Index

[#] Next page

Go to full version