AlbatrosDocsCoder
AlbatrosDocsCoder

Reputation: 149

How to read exe file in binary code - C++

How can I make program in C++ that will read .exe or another file in binary code?

Upvotes: 2

Views: 8728

Answers (1)

Armen Tsirunyan
Armen Tsirunyan

Reputation: 132974

#include <fstream>

int main()
{
    std::ifstream in("yourfile.exe", std::ios::in | std::ios::binary);
    ///
    in.read (buffer, buffer_size);
}

For a detailed example on how to read binary files in C++, see this link or do your own googling.

Upvotes: 6

Related Questions