Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //+ DumpBin:
- //+ Binaeres Einlesen eines Files und Ausgabe in ASCII Interpretation
- //+---------------------------------------------------------------------
- #include <iostream>
- #include <fstream>
- #include <Windows.h>
- using namespace std;
- void main() {
- ifstream inp;
- //BootSecFP.img
- inp.open ("BootSecFP.img", ios::binary);
- if (!inp.is_open())
- {
- cerr << "Datei konnte nicht gefunden werden. " << endl
- << GetLastError()
- << endl;
- getchar();
- }
- int length(0);
- // länge des Files herrausfinden
- inp.seekg (0, ios::end);
- length = inp.tellg();
- inp.seekg (0, ios::beg);
- char * woerter="";
- woerter = new char [length];
- for (int i=0;i<length;++i) {
- cout<<"i="<<i<<endl;
- inp.read(woerter,i);
- printf("%02X ",woerter[i] & 0x000000ff);
- }
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement