mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-23 22:04:33 +02:00
exeflat: document UPX 3.96 exact DOS/SYS limit but use a lower number
This commit is contained in:
parent
f23f035554
commit
77d3c7e1d7
@ -220,10 +220,17 @@ static int exeflat(const char *srcfile, const char *dstfile,
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The biggest .sys file that UPX accepts seems to be 65419 bytes long */
|
/* The biggest .sys file that UPX accepts seems to be 65419 bytes long.
|
||||||
|
Actually, UPX 3.96 appears to accept DOS/SYS files up to 65426 bytes.
|
||||||
|
To avoid problems we use a slightly lower limit. */
|
||||||
if (UPX) {
|
if (UPX) {
|
||||||
if (stubdevsize && stubexesize)
|
if (stubdevsize && stubexesize)
|
||||||
compress_sys_file = (size - (0x20 - 0x10)) < 65420;
|
compress_sys_file = (size - stubdevsize) <= /* 65426 */ 65400;
|
||||||
|
/* would need to subtract 0x10 for the device header here
|
||||||
|
but then add in the same, because we skip 0x10 bytes
|
||||||
|
of the source file but fill the same length with the
|
||||||
|
doctored device header. so (size - stubdevsize) gives
|
||||||
|
the exact result that we want to compare against. */
|
||||||
else if (stubexesize)
|
else if (stubexesize)
|
||||||
compress_sys_file = 0;
|
compress_sys_file = 0;
|
||||||
else if (stubdevsize)
|
else if (stubdevsize)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user