nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.05k stars 135 forks source link

Crash while dumping MB files to txt from level0 #257

Closed enarkay closed 7 months ago

enarkay commented 1 year ago

While trying to dump all MB files of level0 in txt format, UABEA spit out an error message and crashed.

Steps to the encountering of the problem was: 1) open level0 with UABEA 2) filter assets to MonoBehaviour only 3) select all files 4) export dump in txt format 5) crash

Game : Fears to Fathom - Norwood Hitchhike (it's Episode 2 of the series) Game Unity version : 2020.3.20 UABEA version : nightly build as of today

Crash log is in the attachment. uabeacrash.log

nesrak1 commented 1 year ago

I've added a null check for dumps now. The MonoBehaviour code isn't perfect (especially around layers of generics) and is still being worked on. For now, this should skip any of the assets that were failing.

enarkay commented 1 year ago

@nesrak1 That's good enough for me for the moment! I will at least be able to batch export rest of the files, and just pick out the ones that failed to deserialize and see what I can do about them with some other methods if I need them :) Thank you for such a quick fix/update!

enarkay commented 1 year ago

@nesrak1 Oh actually, I just have one more question. So what would be the most convenient way to batch import edited dump files? For example, will the UABEA just ignore dump files that failed to deserialize? Or would I need to pick out and 'deselect' those failed files one by one when batch importing? Or perhaps a commandline usage?

nesrak1 commented 1 year ago

Oh that's a good point. I should probably make it not write anything for now? In the meantime, you could probably get away with sorting files by size in explorer and deleting all of the tiny files that have the error message in them. When you go to reimport, any file not found should be skipped.

enarkay commented 1 year ago

@nesrak1 Oh okay so if I understood things correctly, even if I were to select ALL MonoBehaviour files in UABEA and ran batchimport, it would just skip over assets that do not have a matching dump file? If this is the case, then it's completely fine as it is for me :) This way, I can both check which files UABEA failed to dump, and I can do something like you said (sorting by size) or use a search program like 'Everything' to search for files that include "Asset failed to deserialize." and manually delete them.

As long as UABEA will work as I understood it to as stated above (skip batchimport for assets that do not have a matching dump file), then everything is absolutely fine with me 👍

nesrak1 commented 7 months ago

If you're still using this, I suggest trying the nightly UABEA. It should have fixed a few MonoBehaviour problems.

enarkay commented 7 months ago

If you're still using this, I suggest trying the nightly UABEA. It should have fixed a few MonoBehaviour problems.

@nesrak1 Hey, thank you very much for the news about the update! I've already finished localizing the game I mentioned above, so after seeing your news I tried UABEA with a new game but failed.

Game : The Classrooms (https://store.steampowered.com/app/2099110/The_Classrooms/) Unity version : 2022.1.12f1 Build : il2cpp

The dumped MB files read asset failed to deserialize. However, by disabling cp2ll from UABEA, and putting in a Managed folder manually created from il2cpp dumper solves the problem and MB files are properly dumped.

So maybe there's a problem with cp2ll or it's outdated?

nesrak1 commented 7 months ago

The Cpp2IL version being used is a bit outdated and since the updated version isn't on nuget, I have to use an older version. I'm thinking of pushing my own AssetsTools Cpp2IL package so I can have a more up to date one in the future. Good to hear that it dumped well with il2cppdumper though.

nesrak1 commented 7 months ago

I'll open a new issue for cpp2il later and close this one.