Skip to content

1.9.21 breaks loading files with stripped Unity version #158

Closed

Description

@erikchan002

Code

import UnityPy
UnityPy.config.FALLBACK_UNITY_VERSION = "2020.3.32f1" 
env = UnityPy.load("res001_no001.zip")

Error

Error loading, reverting to EndianBinaryReader:
 'NoneType' object has no attribute 'groups'

Bug
This is a regression caused by #157 and does not happen with UnityPy 1.9.20

version = tuple(map(int, reVersion.match(self.version_engine).groups()))

To Reproduce

  • a copy of the file that causes the problem
  • following data:
    • Python version 3.10.8
    • UnityPy version 1.9.21

Activity

  1. added a commit that references this issue on Nov 25, 2022
    635528a
  2. added a commit that references this issue on Nov 25, 2022
  3. K0lb3 commented on Nov 25, 2022

    @K0lb3
    Owner

    Thanks for reporting the issue.

    The encryption handling for the CN version added version handling to the BundleFile,
    which conflicted with the missing version at that point.
    So, the handling for this case simply had to be ported from the SerializedFile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions