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

Unkown FPropertyType: TextProperty #1

Open
JasonGilley opened this issue Feb 19, 2022 · 4 comments
Open

Unkown FPropertyType: TextProperty #1

JasonGilley opened this issue Feb 19, 2022 · 4 comments

Comments

@JasonGilley
Copy link

Just got your project and ran it with this file:

SaveGame1.zip

I don't know enough about the structure, or have documentation to debug it easily. Can you shed some light? Thanks.

@SparkyTD
Copy link
Owner

Your save file is 19 megabytes, and it's full of data structures that seem to be non-standard. Most saves that I've tested this on are less than 100 KB in size.

I'll look into it, but I can't promise anything. This would be the ultimate stress-test for this project.

May I ask what game it's from?

@JasonGilley
Copy link
Author

JasonGilley commented Feb 20, 2022 via email

@SparkyTD
Copy link
Owner

I've tried other projects that are supposed to parse UE4 saves, but as far as I can tell, mine is the most complete. As the readme states, it can fully parse, edit and save GVAS files from 5 different games, without any problems. (more specifically, it can read the file, parse it, write it back to the disk, and the hash of this new file will match the original if no edits were made).

I'll definitely try to make your files work when I have time. In the meantime, if you would like to try it yourself, use this project as a base, PRs are welcome. The way it works is pretty simple: For each UE4 data type there is a corresponding class in the FProperties folder (e.g. TextProperty -> FTextProperty.cs). When the parser is reading a data field, it tries to locate the class with the matching name. So if you want to implement a new data type, you just have to create a new class for it in the FProperties folder, everything else is handled automatically. Most of the reading/parsing logic is in the FProperty class.

So far I've found two issues with your save file:

  • The TextProperty type does not exist. Strangely, none of the games I've tried this with use this data type. This seems like more than just a string, and I don't yet fully understand the data format. I've implemented a very basic parser for it just to get rid of the exception, and I'll push the commit in a minute, but there are data fields in it that I don't understand. UE4 source code wasn't helpful either.
  • There is a StackOverflowException in the main property reader method due to an infinite recursion, after it tries to read a StructProeprty. I don't know why this happens, it probably fails to detect the end of a complex struct object, and it keeps reading it recursively. Kind of hard to debug, because I don't know the overall structure of your save file.

Here's a rough overview of what a single property looks like, in case you want to help:

  • Property Name (FString, e.g. "GameVersion")
  • Property Type (FString, e.g. "StrProperty")
  • Field Length (uint64, the length of the data)
  • Has GUID? (uint8/bool, some data types might store a GUID before the data, but only if this bool is true)
  • GUID (16 bytes, optional, only present if previous byte is 1)
  • Data (this depends on the data type. In case of the GameVersion, it's an FString with the value "1.0.0.0")

There are of course more complex types like Arrays, Maps and Structs that can have multiple fields.

Note, that the UE source code is insanely complex, trying to reverse-engineer the file itself is much easier than trying to understand the code in my opinion. If you still want to try using the UE4 code, than you'll want to look at the FArchive class, as it represents the data section of a save file. You can create an FArchive object, add data fields to it, write it to a file or the console in hex, and analyze the data.

@funjoker
Copy link

funjoker commented Mar 6, 2022

image

Longvinter Placeable.sav
Also unparseable atm.

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

No branches or pull requests

3 participants