r-ex / LegionPlus

Asset Extraction tool for Apex Legends and Titanfall 2
GNU General Public License v3.0
235 stars 34 forks source link

Add extraction of compressed wrap files #127

Closed EladNLG closed 1 year ago

EladNLG commented 1 year ago

it works, but it feels wrong(?)

am i supposed to delete the buffers after im done with them? doing so causes a crash, but if i don't it doesn't seem to cause a memory leak by looking at the debug menu?

CPP is weird.

biast12 commented 1 year ago

this pr works for me, tho idk if it's on purpose but there's still some old VPK files that's not in the wrapped format, they may just have been fully removed, but i do think it's worth a look in case it may not be

image

EladNLG commented 1 year ago

I don't think localization has been removed as a feature... I think we need to take a better look, maybe they've been moved to another file type (Datatable/RSON/something new?)

Found these files, check localization_\<language>.rpak, common_early.rpak and ui.rpak.

These wrapped files are EVERYWHERE, man.

biast12 commented 1 year ago

the thing is i looped through all the files with batch, so i haven't t missed any files, weird that it didn't export them then

biast12 commented 1 year ago

just checked with the GUI, and the folders aren't on there either, i tried to search for the audio folder while loading all the .rpaks above and it's not there

EladNLG commented 1 year ago

just checked with the GUI, and the folders aren't on there either, i tried to search for the audio folder while loading all the .rpaks above and it's not there

looks like the MNBK file is in /audio/ship/ now? dont know if it was always there...

biast12 commented 1 year ago

yeah the audio has always been there, but i'm talking about the audio script file, same with the other scripts shown above, like entity_category.rson and entitlements.rson

mrsteyk commented 1 year ago

am i supposed to delete the buffers after im done with them? doing so causes a crash, but if i don't it doesn't seem to cause a memory leak by looking at the debug menu?

Yes you are supposed to. Debug builds do a break because you are deleting the same memory twice (that is compressedBuffer). Original delete[] happens here: https://github.com/r-ex/LegionPlus/blame/72bc27ff415c1c7d0884f112e5ae4b8707a70ad2/Legion/src/rtech.cpp#L2729 Blame @IcePixelx You just need to free the decompressedBuffer.

EladNLG commented 1 year ago

Gotcha, thanks.

EladNLG commented 1 year ago

Slight issue: there are still NUL characters (and sometimes some extra newlines) at the end of files for some reason

snake-biscuits commented 1 year ago

Slight issue: there are still NUL characters (and sometimes some extra newlines) at the end of files for some reason

Could be something about how .client wraps files .bsp_lump.client should all be Header.dcmpSize bytes long, according to the .bsp

I did notice that the way scripts are redacted has changed: