Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Rocket League - Error) - exception when trying to load decrypted ProjectX.upk #54

Open
WannabeModder opened this issue Apr 24, 2024 · 9 comments
Labels
bug Something isn't working UELib

Comments

@WannabeModder
Copy link

WannabeModder commented Apr 24, 2024

I saw that this tool somewhat supports Rocket League so I decided to try it. I used your UPK decrypt tool for RL before trying to load into UE Explorer but had no success.

I did some digging and it's generating an exception while trying to deserialize Exports. Here's a screenshot of where the exception is generated:
image

Right after this call after trying to read ClassIndex at _ClassIndex = stream.ReadObjectIndex(); it generates this exception.

Do you have any insights on how to resolve this? I don't have much experience with UPK so I'm kinda lost. I appreciate any help, thank you!

EDIT1: Forgot to attach exception dump
EDIT2: Looks like it happens to any decrypted UPKs.

Thrown by:InitializeFromFile
   at UEExplorer.UI.Tabs.UC_PackageExplorer.InitializeFromFile(String filePath)
   at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.ControlCollection.Add(Control value)
   at UEExplorer.UI.ProgramForm.LoadFromFile(String filePath)UELib.UnrealException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at UELib.UExportTableItem.Deserialize(IUnrealStream stream)
   at UELib.UnrealPackage.Deserialize(UPackageStream stream)
   at UELib.UnrealLoader.LoadPackage(String packagePath, BuildName buildTarget, FileAccess fileAccess)
   at UEExplorer.UI.Tabs.UC_PackageExplorer.LoadPackage()
   --- End of inner exception stack trace ---
   at UEExplorer.UI.Tabs.UC_PackageExplorer.LoadPackage()
   at UEExplorer.UI.Tabs.UC_PackageExplorer.InitializeFromFile(String filePath)
@WannabeModder WannabeModder changed the title (Rocket League) - exception when trying to load decrypted ProjectX.upk (Rocket League - Error) - exception when trying to load decrypted ProjectX.upk Apr 24, 2024
@EliotVU EliotVU added the bug Something isn't working label Apr 24, 2024
@EliotVU
Copy link
Collaborator

EliotVU commented Apr 24, 2024

I have not been keeping up with all the changes RL has gone through, perhaps the latest version simply no longer works? Nonetheless, I think I may have found the culprit, but I'm unable to test this out myself, as I don't have a copy of the latest files.

EliotVU added a commit to EliotVU/Unreal-Library that referenced this issue Apr 24, 2024
@WannabeModder
Copy link
Author

I tried the change and it's a progress! However, functions are failing to decompile. Some examples here:
image

Btw: I can attach the file if you want to. Thanks for your support so far!

@EliotVU
Copy link
Collaborator

EliotVU commented Apr 24, 2024

Nice. And yes, I would appreciate it!

@WannabeModder
Copy link
Author

Here it is:
UPK.zip

I included both the original and decrypted files. These are the ones I've been targeting

@EliotVU
Copy link
Collaborator

EliotVU commented Apr 25, 2024

Thanks. It looks like they shifted ALL the byte codes around, pretty much like AA2 did 🤣

image

I've fixed the deserialization for all classes, except for the shifted byte codes, this is a bit of a tedious process.

EliotVU added a commit to EliotVU/Unreal-Library that referenced this issue Apr 25, 2024
EliotVU added a commit to EliotVU/Unreal-Library that referenced this issue Apr 25, 2024
@EliotVU EliotVU added the UELib label Apr 25, 2024
@WannabeModder
Copy link
Author

Thanks!! Is there any way I can check the bytecodes myself? Or I'll have to reverse the game binary to check them?

@EliotVU
Copy link
Collaborator

EliotVU commented Apr 25, 2024

Yes, I recommend Ghidra to analyze the binary, then search in memory for the unicode string "bad expr", this will lead you to the SerializeExpr function, in this function there is a switch on all byte-codes.

@WannabeModder
Copy link
Author

Does it have support for QwordZero? I tried searching for it in the source of UELib but I couldn't find anything. This is clearly a Qword/PointerZero handler:
image

@EliotVU
Copy link
Collaborator

EliotVU commented Apr 27, 2024

No, I don't think you are looking at the right place.

It should look like this:

GIF 25-04-2024 22-05-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UELib
Projects
None yet
Development

No branches or pull requests

2 participants