How to LittleBigPlanet 2 Decompress/Recompress Files?

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
m3z1r
Posts: 6
Joined: Wed Mar 13, 2019 10:40 pm

How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by m3z1r »

Basically, I'm trying to decompress a model from LBP2, change the .gmat (general material), and recompress it to be able to be loaded back into the game. Below is a sample model (decoration_nightmarebc_iron_grave_spike.mol) which contains the 4 byte GUID 0005F0B6 for decoration_nightmarebc_iron_fence.gmat. What is the fastest way to be able to do this? I want to be able to do this quickly to make different models that use different textures.

http://s000.tinyupload.com/?file_id=245 ... 7776047814



Also, I happen to have the same model with a different gmat (it uses 0002B362 instead) if this helps. Here's that one:

http://s000.tinyupload.com/?file_id=095 ... 1390793443
Last edited by m3z1r on Sun Apr 21, 2019 4:18 am, edited 4 times in total.
GHFear
Posts: 290
Joined: Fri Mar 30, 2018 2:48 am

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by GHFear »

m3z1r wrote:Basically, I'm trying to decompress a model from LBP2, change the .gmat (general material), and recompress it to be able to be loaded back into the game. Below is a sample model (decoration_nightmarebc_iron_grave_spike.mol) which contains the 4 byte GUID 0005F0B6 for decoration_nightmarebc_iron_fence.gmat. What is the fastest way to be able to do this? I want to be able to do this quickly to make different models that use different textures.

http://s000.tinyupload.com/?file_id=245 ... 7776047814



Also, I happen to have the same model with a different gmat (it uses 0002B362 instead) if this helps. Here's that one:

http://s000.tinyupload.com/?file_id=095 ... 1390793443


I made a quick tool that should work for decompressing and rebuilding the files, taking into account new filesize and new compressed size.
Tool is attached.

You may NOT edit the first 26 bytes and the last 13 bytes. Everything else you can play around with.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by aluigi »

@m3z1r
Do you have a bigger sample?
I need a sample containing more than one chunk.
GHFear
Posts: 290
Joined: Fri Mar 30, 2018 2:48 am

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by GHFear »

aluigi wrote:@m3z1r
Do you have a bigger sample?
I need a sample containing more than one chunk.


http://s000.tinyupload.com/?file_id=107 ... 2100864443

m3z1r sent me these, maybe they have more chunks.
m3z1r
Posts: 6
Joined: Wed Mar 13, 2019 10:40 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by m3z1r »

aluigi wrote:@m3z1r
Do you have a bigger sample?
I need a sample containing more than one chunk.

Yes, I believe crown_he.mol in Files.rar has four chunks
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by aluigi »

This format is a total illogical mess :)
m3z1r
Posts: 6
Joined: Wed Mar 13, 2019 10:40 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by m3z1r »

aluigi wrote:This format is a total illogical mess :)

What do you mean? I just need to be able to recompress files without changing their file size
GHFear
Posts: 290
Joined: Fri Mar 30, 2018 2:48 am

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by GHFear »

m3z1r wrote:
aluigi wrote:This format is a total illogical mess :)

What do you mean? I just need to be able to recompress files without changing their file size


I can't find anything pointing to where the compression should start on each chunk and where the actual file starts and all that. I can't really do anything more. Maybe that info is in some other file or something. And that's why it doesn't load when the size changes.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by aluigi »

Exactly, there is no way to know the starting point of the chunks since they seem to have no logic.
m3z1r
Posts: 6
Joined: Wed Mar 13, 2019 10:40 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by m3z1r »

aluigi wrote:Exactly, there is no way to know the starting point of the chunks since they seem to have no logic.

Well I know it's possible, I tried decompressing a file with offzip using -a and -u to recompress in packzip. It isn't the same file size as the original so I tried editing the file size offset at the top to be correct and it doesn't work; theres more data at the top that probably needs to be changed to match the new file, but I don't know what its for. I just need any way to do this.
m3z1r
Posts: 6
Joined: Wed Mar 13, 2019 10:40 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by m3z1r »

aluigi wrote:Exactly, there is no way to know the starting point of the chunks since they seem to have no logic.

Can you delete this thread?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: DELETE PLEASE

Post by aluigi »

@m3z1r
It's not possible to delete topics in which other people already discussed and spent their time.

The forum is for the community, not just for you.
Thanks
m3z1r
Posts: 6
Joined: Wed Mar 13, 2019 10:40 pm

Re: DELETE PLEASE

Post by m3z1r »

aluigi wrote:@m3z1r
It's not possible to delete topics in which other people already discussed and spent their time.

The forum is for the community, not just for you.
Thanks

I just wanted the topic to be deleted because there was no progress made here. I didn't want a useless thread just left here on the site, especially since I don't need help with this anymore.
akintos
Posts: 88
Joined: Tue May 08, 2018 7:48 pm

Re: ...

Post by akintos »

Even if you don't need help anymore, there might be other people who are looking for some information in this thread. That's how a community works.

This thread may look useless but even the information 'this format is logical mess, stay away from it' could be very useful for someone.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to LittleBigPlanet 2 Decompress/Recompress Files?

Post by aluigi »

And then it's not true that there has been no progress.
The main problem is the starting of the chunks and some information like those at the end that don't have a clear meaning:

Code: Select all

# MOL

endian big
getdstring TYPE 4
get DUMMY short
get VER byte
get DUMMY byte
get INFO_OFF long
get CHUNK_SIZE short    # some sort
get CHUNK_SIZE short    # some sort

... ???

get DUMMY byte      # 1
get DUMMY short     # 1
get CHUNKS short

get NAME basename
log NAME 0 0
append
savepos OFFSET
xmath OFFSET "OFFSET + (CHUNKS * (2 + 2))"
for x = 0 < CHUNKS
    get CHUNK_ZSIZE short
    get CHUNK_SIZE short
    clog NAME OFFSET CHUNK_ZSIZE CHUNK_SIZE
    math OFFSET + CHUNK_ZSIZE
next x
append

goto INFO_OFF
get NUM long
for x = 0 < NUM
    get DUMMY byte  # 2
    get DUMMY long  # ???
    get DUMMY long  # 7
next x