I've run into an issue with a BND archive from a PSP game... It contains a number of uncompressed GMO's, some JSON's and maybe some other things...
It seems as though Noesis knows the format, but it fails to read and crashes.
I can't make heads or tails of the archive... I just don't see any offset lists or anything that links the filename list at the top, to the files later on in the archive...
All I'm interested in at the moment is the GMO's but there may be more important data in some of the archives I haven't looked at yet...
What I'm trying to do currently is write a ripper for the GMO's using the OMG.00.1PSP tag (the start of GMO data) and the GMO file length listed at 0x14...
However, while I know Noesis has some sort of process for unpacking things, I was wondering how I'm supposed to actually grab the data from the archive, and then output it.
I could just dump the raw data with bs.writeBytes(data[start:end])... but that seems like a poor execution.
I've read in the documentation there is a fmtExtractArc function, and I have read the specs on it... however, I am uncertain as to what exactly they mean.
I can't seem to find any python plugins that use the function.
I don't really know how to progress. What are some suggestions?
At this point my only thoughts are brute force loops that appends all ".gmo" strings into a list until reaching a "OMG." string, and then using a bs.writeBytes function to write to the nameList[ i] as the output filename... This however, will execute every time the file is even attempted to be loaded, and will not preserve any sort of directory structure...
... and I'm not entirely certain I know how to correctly determine the start and end of the filenames in the BND archive's list... (they're not 4 byte aligned nor consistent in length).
Failing any sort of export ability for the archives I'll have to manually copy the GMO's by hand via hex editor.
I need help and I'm not even certain what kind.
Here is part of one of the files I'm working with. (an image of the header, that's not breach of TOS right?)
http://i86.photobucket.com/albums/k99/eremes/data.png
The highlighted string is the beginning of the first file, and before it are the names of all the included files. These are small archives.
EDIT:
Ahem... Now how did I miss that... I found the absolute offsets to the files... now all I have to do is output the files and attach the proper directory structure... still, I could use some help understanding how the fmtExtractArc function works.
I looked at the Duke3D grpExtractArc function... but I couldn't really tell what it was doing or for that matter how or why.
What is 'justChecking' and how is it set?
EDIT2:
Ok, I've written all the code I'd need to parse the files normally, but I can't seem to get them to actually... output... I really need some help with this fmtExtractArc defining.
EDIT3:
After much much toil... I think I figured out what vital thing I was missing.
I'd been assuming that since no reference to {data} was passed to ExtractArc, there was no way for me to use noeBitStream functions on it... it took me forever to figure out I could create a new data reference using f.read(fileLen) and then parse it as I would in any other function... once that clicked, (and after the discovery of extractArchiveFile(sO)) I
think I hacked together a working BND exporter.
Now to add some Prints so I know it's actually doing stuff.... and... whew...
Man, noesis never seems to cease kicking my ass, but it sure is useful.