HOI4 Save
HOI4 Save is a library to ergonomically work with Hearts of Iron IV saves (plaintext + binary).
use ;
let data = read?;
let file = from_slice?;
let parsed_file = file.parse?;
let save: Hoi4Save = parsed_file.deserializer.build?;
assert_eq!;
assert_eq!;
The HOI4 binary format can be converted to plaintext
use ;
let data = read?;
let file = from_slice?;
let parsed_file = file.parse?;
let binary = parsed_file.as_binary.unwrap;
let out = binary
.melter
.on_failed_resolve
.melt?;
Binary Saves
By default, binary saves will not be decoded properly.
To enable support, one must supply an environment variable
(HOI4_IRONMAN_TOKENS
) that points to a newline delimited
text file of token descriptions. For instance:
0xffff my_test_token
0xeeee my_test_token2
In order to comply with legal restrictions, I cannot share the list of tokens. I am also restricted from divulging how the list of tokens can be derived.