Crate gvas

Source
Expand description

Gvas

UE4 Save File parsing library

§Examples

use gvas::{error::Error, GvasFile};
use std::{
    fs::File,
};
use gvas::game_version::GameVersion;

let mut file = File::open("save.sav")?;
let gvas_file = GvasFile::read(&mut file, GameVersion::Default);

println!("{:#?}", gvas_file);

§Hints

If your file fails while parsing with a DeserializeError::MissingHint error you need hints. When a struct is stored inside ArrayProperty/SetProperty/MapProperty in GvasFile it does not contain type annotations. This means that a library parsing the file must know the type beforehand. That’s why you need hints.

The error usually looks like this:

MissingHint(
        "StructProperty" /* property type */,
        "UnLockedMissionParameters.MapProperty.Key.StructProperty" /* property path */,
        120550 /* position */)

To get a hint type you need to look at the position of DeserializeError::MissingHint error. Then you go to that position in the file and try to determine which type the struct has. Afterwards you parse the file like this:

use gvas::{error::Error, GvasFile};
use std::{
    collections::HashMap,
    fs::File,
};
use gvas::game_version::GameVersion;

let mut file = File::open("save.sav")?;

let mut hints = HashMap::new();
hints.insert("UnLockedMissionParameters.MapProperty.Key.StructProperty".to_string(), "Guid".to_string());

let gvas_file = GvasFile::read_with_hints(&mut file, GameVersion::Default, &hints);

println!("{:#?}", gvas_file);

Modules§

cursor_ext
Extensions for Cursor.
custom_version
Custom version information. Custom version information
engine_version
Engine version information. Engine version information
error
Error types.
game_version
Game version enumeration. Game version enumeration
object_version
Object version information.
properties
Property types.
savegame_version
Savegame version information.
types
Various types.

Structs§

GvasFile
Main UE4 save file struct

Enums§

GvasHeader
Stores information about GVAS file, engine version, etc.

Constants§

FILE_TYPE_GVAS
The four bytes ‘GVAS’ appear at the beginning of every GVAS file.