Pandora [solved] Sensible way of getting the pxml + icon from a pnd


thatgui

Advanced Member
Joined
Apr 2, 2009
Messages
3,048
I trying to extract the pxml file and the icon from a pnd.


Currently im opening the pnd as a stream, and reading it backwards from the end in blocks, till i find the first four characters of the pxml in it. But this is very slow, and there is a chance (depending on the block size) that i hit the middle of my comparison string, so the start of the pxml is "overlooked".


So whats the clever way to do it ? And is the "spacing" between pxml and the icon always one byte ?


PS.: extracting pxml and icon via mounting the pnd is no option -> takes too much time
 
Last edited by a moderator:
thats exactly how the repo does it, reads the binary backwards 1000 bytes at a time but only moving the seek point back by 500 bytes at a time so it has a change to read an overlapped area incase I only find part of the start or end of the PXML.


this happens quickly though, I dont know why its slow for yourself.


you could just use a tool like 7z to extract the PXML and icon from inside assuming they are up to date, also foxblocks PNDtools for windows works great too.

or what ED said :p
 
Stupid me again, it didn't really took long in my case, i just didn't move back any futher in the file, just one step. But milksahes tip on reducing the chance to miss the start by overlapping the seek and the search area is a nice one.


will have a look at the libpnd source too


Thanks guys
 
Back
Top