Skip to content

Instantly share code, notes, and snippets.

@Yappaholic
Created January 13, 2026 16:06
Show Gist options
  • Select an option

  • Save Yappaholic/3bfbb755a1f2ce6bbd9ef8de16645862 to your computer and use it in GitHub Desktop.

Select an option

Save Yappaholic/3bfbb755a1f2ce6bbd9ef8de16645862 to your computer and use it in GitHub Desktop.
Read kernel version from binary
use std::fs;
pub fn main() {
let kernel = fs::read("kernel_path").unwrap();
let version_offset = 0x00004500;
let kernel_version_string: String = kernel[version_offset..version_offset + 100]
.iter()
.map(|e| e.to_owned() as char)
.collect();
println!("Kernel version string: {kernel_version_string}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment