bl4 0.7.5

Borderlands 4 save editor library - encryption, decryption, and parsing
docs.rs failed to build bl4-0.7.5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: bl4-0.5.20

bl4

Borderlands 4 save editor library - encryption, decryption, and parsing.

This library provides functionality to:

  • Decrypt and encrypt Borderlands 4 .sav files
  • Parse decrypted YAML save data
  • Decode item serials (weapons, equipment, etc.)
  • Modify save data (level, currency, inventory, etc.)

Example

use std::fs;

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let encrypted = fs::read("1.sav")?;
let steam_id = "76561197960521364";

// Decrypt and parse save file
let yaml_data = bl4::decrypt_sav(&encrypted, steam_id)?;
let mut save = bl4::SaveFile::from_yaml(&yaml_data)?;

// Query and modify save data
println!("Character: {:?}", save.get_character_name());
println!("Cash: {:?}", save.get_cash());

save.set_cash(999999)?;
save.set_character_name("NewName")?;

// Re-encrypt and save
let modified_yaml = save.to_yaml()?;
let encrypted = bl4::encrypt_sav(&modified_yaml, steam_id)?;
fs::write("1.sav", encrypted)?;
# Ok(())
# }