mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
PackMach* checkAlreadyPacked()
This commit is contained in:
parent
575b43b0d4
commit
5562b21a20
|
@ -629,6 +629,13 @@ bool PackMachBase<T>::canPack()
|
||||||
sz_segment = msegcmd[j].filesize + msegcmd[j].fileoff - msegcmd[0].fileoff;
|
sz_segment = msegcmd[j].filesize + msegcmd[j].fileoff - msegcmd[0].fileoff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// info: currently the header is 36 (32+4) bytes before EOF
|
||||||
|
unsigned char buf[256];
|
||||||
|
fi->seek(-(off_t)sizeof(buf), SEEK_END);
|
||||||
|
fi->readx(buf, sizeof(buf));
|
||||||
|
checkAlreadyPacked(buf, sizeof(buf));
|
||||||
|
|
||||||
// set options
|
// set options
|
||||||
opt->o_unix.blocksize = file_size;
|
opt->o_unix.blocksize = file_size;
|
||||||
return 0 < n_segment;
|
return 0 < n_segment;
|
||||||
|
@ -765,6 +772,13 @@ bool PackMachFat::canPack()
|
||||||
} break;
|
} break;
|
||||||
} // switch cputype
|
} // switch cputype
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// info: currently the header is 36 (32+4) bytes before EOF
|
||||||
|
unsigned char buf[256];
|
||||||
|
fi->seek(-(off_t)sizeof(buf), SEEK_END);
|
||||||
|
fi->readx(buf, sizeof(buf));
|
||||||
|
checkAlreadyPacked(buf, sizeof(buf));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user