Created
May 30, 2014 19:55
-
-
Save Dr-Emann/d0bf94c46bbb708b995c to your computer and use it in GitHub Desktop.
This file contains 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
#include <stdio.h> | |
int main() { | |
FILE *fp; | |
int i; | |
fp = fopen("\\\\.\\PhysicalDrive0", "r"); | |
for(i = 0; i < 10; i++) { | |
printf("%x", (int)fgetc(fp)); | |
} | |
return 0; | |
} |
This file contains 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::io::File; | |
fn main() { | |
let mut r = File::open(&Path::new("\\\\.\\PhysicalDrive0"); | |
// r is now Ok(File{...}) | |
let b = r.read_u8(); | |
println!("{}", b); | |
// Prints Err(unknown error (OS Error 87 (FormatMessageW() returned error 15100))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment