Imagine that following byte array contains all bytes of a executable file (.exe) (that on pratice this not is possible set inside source code because there are much bytes in this file type (.exe) and Visual Studio will crashe)
char buffer[] = { 0x60, 0x33, 0xC0, 0x33, 0xDB, 0xEB, 0x00, 0x03, 0xC3 };
Then i think that better way to achieve this is generate all bytes ( PS: like XTEA Runtime Crypter, but without variable declaration ) from .exe file and insert in a .bin file to set on char buffer[]
later, something like this:
vector<char> buffer;
ifstream infile;
infile.open("bytes.bin", ios::binary);
infile.seekg(0, ios::end);
size_t file_size_in_byte = infile.tellg();
buffer.resize(file_size_in_byte);
infile.seekg(0, ios::beg);
infile.read(&buffer[0], file_size_in_byte);
infile.close();
Then i ask:
What's correct format of bytes to generate .bin file?
0x60, 0x33, 0xC0, 0x33, 0xDB, 0xEB, 0x00, 0x03, 0xC3
- preceded by 0x and separated by comma and space (like the linked C++ code already makes)?0x600x330xC00x330xDB0xEB0x000x030xC3
- whitout any space/separation?60, 33, C0, 33, DB, EB, 00, 03, C3
- separated by comma and space, but not preceded by 0x?- Like showed in a Hex editor (not preceded by 0x and not separated by comma)?