Skip to main content

decompile

Function decompile 

Source
pub fn decompile(fafb_bytes: &[u8]) -> FafbResult<DecompiledFafb>
Expand description

Decompile .fafb binary bytes into a structured representation.

Parses header, section table, and string table.

ยงExample

use faf_rust_sdk::binary::compile::{compile, decompile, CompileOptions};

let yaml = "faf_version: 2.5.0\nproject:\n  name: test\n";
let opts = CompileOptions { use_timestamp: false };
let fafb_bytes = compile(yaml, &opts).unwrap();

let result = decompile(&fafb_bytes).unwrap();
assert_eq!(result.header.version_major, 1);

let project = result.get_section_string_by_name("project").unwrap();
assert!(project.contains("test"));