39 FILE* fpOut = fopen(fileOut,
"wb");
40 FILE* fpOutCD = fopen(fileOutTmp,
"wb");
41 if (fpZip !=
NULL && fpOut !=
NULL) {
49 while ( fread(
header, 1, 30, fpZip) == 30 ) {
50 int currentOffset =
offset;
67 if (fwrite(
header, 1, 30, fpOut) == 30) {
77 if (fread(
filename, 1, fnsize, fpZip) == fnsize) {
78 if (fwrite(
filename, 1, fnsize, fpOut) == fnsize) {
99 if (extsize <
sizeof(extra)) {
100 if (fread(extra, 1, extsize, fpZip) == extsize) {
101 if (fwrite(extra, 1, extsize, fpOut) == extsize) {
119 int dataSize = cpsize;
124 char* data =
malloc(dataSize);
126 if ((
int)fread(data, 1, dataSize, fpZip) == dataSize) {
127 if ((
int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
129 totalBytes += dataSize;
151 int comsize = (
int) strlen(comment);
170 if (fwrite(
header, 1, 46, fpOutCD) == 46) {
175 if (fwrite(
filename, 1, fnsize, fpOutCD) == fnsize) {
188 if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
198 if ((
int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
226 int comsize = (
int) strlen(comment);
227 if (entriesZip > 0xffff) {
240 if (fwrite(
header, 1, 22, fpOutCD) == 22) {
244 if ((
int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
257 fpOutCD = fopen(fileOutTmp,
"rb");
258 if (fpOutCD !=
NULL) {
261 while ( (nRead = (
int)fread(
buffer, 1,
sizeof(
buffer), fpOutCD)) > 0) {
262 if ((
int)fwrite(
buffer, 1, nRead, fpOut) != nRead) {
276 (void)remove(fileOutTmp);
280 if (nRecovered !=
NULL) {
283 if (bytesRecovered !=
NULL) {
284 *bytesRecovered = totalBytes;
RzList * entries(RzBinFile *bf)
RZ_API void Ht_() free(HtName_(Ht) *ht)
void * malloc(size_t size)
#define header(is_bt, len_min, ret_op)
uLong filetime(char *f, tm_zip *tmzip, uLong *dt) const