Skip to content

Handle relative and case insensitive file paths - #191

Merged
K0lb3 merged 5 commits into
K0lb3:masterfrom
sparr:relative_caseinsensitive_paths
Sep 30, 2023
Merged

Handle relative and case insensitive file paths#191
K0lb3 merged 5 commits into
K0lb3:masterfrom
sparr:relative_caseinsensitive_paths

Conversation

@sparr

@sparr sparr commented Jul 4, 2023

Copy link
Copy Markdown
Contributor

This PR resolves a few problems I had exporting assets from the game Autonauts.

  1. One assets file contains a reference to another with a relative path, which UnityPy was trying to load from the script's CWD instead of the original asset file path.
  2. That reference doesn't match the case of the actual directory or file name.
  3. There is another reference to library/unity default assets which, in addition to being relative and case insensitive, also doesn't exist because Library/ is apparently a magic path in Unity. Rather than calling that out explicitly here, I've opted to just silently ignore nonexistent paths/files.

I wasn't able to test on Windows, which might have a problem with the case insensitive search.

PS: I also spotted a bug in save() but can't test the fix I included here. Let me know if that's a problem and I can remove it.

@sparr

sparr commented Jul 17, 2023

Copy link
Copy Markdown
Contributor Author

Lots of unrelated pip install errors in the test failures. Unclear if that's all of them.

@K0lb3
K0lb3 merged commit 289ec62 into K0lb3:master Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants