Created
January 13, 2026 16:06
-
-
Save Yappaholic/3bfbb755a1f2ce6bbd9ef8de16645862 to your computer and use it in GitHub Desktop.
Read kernel version from binary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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