1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <fstream>
#include <iomanip>
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char **argv[])
{
//binary data goes here
unsigned char image[] = {0x4d, 0x5a, 0x90, 0x0, 0x3, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0xff, 0xff,};
std::fstream myFile;
myFile.open ("hey.exe", std::ios::out | std::ios::binary);
if(myFile.is_open())
myFile.write((char*)image, sizeof(image));
return 0;
}
|