pub fn get_text_section<'a>(
image: &'a [u8],
section_name: &'static str,
) -> Result<&'a str, UkiError>Expand description
Extracts a text section from a UKI PE file by name and validates it as UTF-8.
This is a convenience wrapper around get_section that additionally validates
the section contents as valid UTF-8 text.
§Arguments
image- The complete UKI image as a byte slicesection_name- Name of the PE section to extract (e.g., “.osrel”, “.cmdline”)
§Returns
Ok(&str)- If the section is found and contains valid UTF-8Err(UkiError)- If the PE is invalid, section is missing or the section contains invalid UTF-8