48 std::cout <<
"Usage: " << g_progname <<
" exe-file zipfile" << std::endl;
49 std::cout <<
"This tool appends a zipfile at the end of any other file (most often a .exe under MS-Windows)." << std::endl;
50 std::cout <<
"The openEmbeddedZipFile() function can then be used to read the file." << std::endl;
57 int main(
int argc,
char *argv[])
76 std::ofstream exef(argv[1], std::ios::app | std::ios::binary);
79 std::cerr <<
g_progname <<
":error: Unable to open " << argv[1] <<
" for writing" << std::endl;
83 std::ifstream zipf(argv[2], std::ios::in | std::ios::binary);
86 std::cerr <<
g_progname <<
":error: Unable to open " << argv[2] <<
" for reading." << std::endl;
91 uint32_t
const zip_start = exef.tellp();
92 std::cout <<
"zip start will be at " << zip_start << std::endl;
98 exef << static_cast<unsigned char>(zip_start);
99 exef << static_cast<unsigned char>(zip_start >> 8);
100 exef << static_cast<unsigned char>(zip_start >> 16);
101 exef << static_cast<unsigned char>(zip_start >> 24);
int main(int argc, char *argv[])