EliotVU / Unreal-Library

UnrealScript decompiler library for Unreal package files (.upk, .u, .uasset; etc), with support for Unreal Engine 1, 2, and 3
MIT License
367 stars 86 forks source link

Basic Gigantic Support #79

Closed HyenaCoding closed 5 months ago

HyenaCoding commented 6 months ago

Adds rudimentary support for Gigantic / Rampage Edition. Gigantic files at least load now but IDK if they're loading well at all. I think the package header deserialization is correct, I spent a while reading into header structure and this is what seems to match the best.

I don't think objects deserialize properly, and JsonRefProperty likely needs more to make work properly, but I'm not entirely sure what needs doing.

EliotVU commented 6 months ago

Thanks! I will push some improvements to the UJsonRefProperty soon.

HyenaCoding commented 6 months ago

I grabbed some of the UPKs that seem more important, if that's of any help.

Core and Engine are obviously the most important, and RxGame is the "main game" which contains pretty much all the classes that get inherited from. There's a few that looked interesting though that may be meaningful, such as GameFramework and Persistent Cooker Data. There's also JsonCache and GuidCache which may have significance with how much the game uses JSON objects.

I also added a couple files for "hero" characters as something I noticed is that they seem to contain template objects for stuff like thier stats e.g PawnStatsManager, PawnStealthManager, etc.

These don't seem to deserialize properly, and throw OutOfRange exceptions, though in one case I saw an example decompile and it seems like they're all designed to just move JSON data into or out of an object, it also seems that it just isn't reading them correctly as template classes.

Format just seems to be 0x0000 (Indicates it's a component?) Name Index if it's part of a default pawn's class, if it's stat modification due to a hero's upgrade then it's absent Net Index A series of properties [Name Index] [Property Type Name] [Size] [Count] Value Name index which corresponds to "none"

https://drive.google.com/file/d/1FqU9WliZZcr5JGao8dF7N4fEK-5ZjAqe/view?usp=sharing

EliotVU commented 6 months ago

The object PawnStealthManager is apparently a UComponent template, these types are usually undetectable without a complete picture of the hierarchy :/

Not much data in there btw: image

EliotVU commented 6 months ago

Alright, IsTemplate() appears to be reliable for such objects!

EliotVU commented 5 months ago

I'll merge this now, I think the support is reasonable enough for now, further improvements are always welcome anytime!

Current issues:

  1. Unknown syntax or meaning behind 3 (or more) new primitive cast byte-codes.
  2. Some functions throw errors (rare)
  3. Missing support for JsonCache etc.