1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
int main()
{
BYTE cur_char;
ofstream out("test.vhd",ios::out | ios::binary);
if (!out.is_open())
return false;
for (int n=0; n<3072; n++) {
cur_char = 0; { out << cur_char; }
}
out.seekp(0,ofstream::beg);
BYTE holdarray[] = {99,111,110,101,99,116,105,120,0,0,0,2,0,1,0,0,0,0,0,0,0,0,2,0,23,69,64,121,118,112,99,32,0,5,0,3,87,105,50,107,0,0,0,0,12,128,0,0,0,0,0,0,12,128,0,0,3,57,16,31,0,0,0,3,255,255,238,229,44,180,124,213,158,221,17,225,130,42,201,29,129,166,153,95};
//write to outfile
out.write((char *) &holdarray,sizeof holdarray);
out.seekp (512);
BYTE holdarray2[] = {99,120,115,112,97,114,115,101,255,255,255,255,255,255,255,255,0,0,0,0,0,0,6,0,0,1,0,0,0,0,0,100,0,32,0,0,255,255,244,19};
out.write ((char*)&holdarray2, sizeof holdarray2);
out.seekp (1536);
for (int n=1536; n<1936; n++) {
cur_char = 255; { out << cur_char; }
}
out.seekp (2560);
out.write ((char*)&holdarray, sizeof holdarray);
out.close();
return 0;
}
|