K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets
MIT License
810 stars 123 forks source link

Snowyegret23 fix issue monobehaviour from assembly.py #273

Open snowyegret23 opened 4 days ago

snowyegret23 commented 4 days ago

fix coreclr argument issue:

PS H:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data>  & 'c:\Users\USER\AppData\Local\Programs\Python\Python310\python.exe' 'c:\Users\USER\.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libTraceback (most recent call last):
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 171, in <module>
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 33, in main
    trees = dump_assembly_trees(dll_folder, tree_path)
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 76, in dump_assembly_trees
    pythonnet_init()
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 98, in pythonnet_init
    rt = get_coreclr(
TypeError: get_coreclr() takes 0 positional arguments but 1 was given




update annotation - "Requires .NET 3.1.0"

You must install or update .NET to run this application.

App: c:\Users\USER\AppData\Local\Programs\Python\Python310\python.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '3.1.0' (x64)
.NET location: C:\Program Files\dotnet

The following frameworks were found:
  5.0.17 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  6.0.24 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  8.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=win-x64&os=win10
Traceback (most recent call last):
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 171, in <module>
    main()
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 33, in main
    trees = dump_assembly_trees(dll_folder, tree_path)
  File "h:\SteamLibrary\steamapps\common\King of the Bridge\King of the Bridge_Data\monobehaviour_from_assembly.py", line 76, in dump_assembly_trees
    pythonnet_init()
    rt = get_coreclr( runtime_config=
  File "c:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\clr_loader\__init__.py", line 142, in get_coreclr
  File "c:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\clr_loader\hostfxr.py", line 23, in __init__
    self._handle = _get_handle(self._dll, self._dotnet_root, runtime_config)
  File "c:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\clr_loader\hostfxr.py", line 138, in _get_handle
    check_result(res)
  File "c:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\clr_loader\util\__init__.py", line 42, in check_result
    raise error
clr_loader.util.clr_error.ClrError: 0x80008096: FrameworkMissingFailure