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