Small updates.
committer: mfx <mfx> 1031793636 +0000
This commit is contained in:
+1
-1
@@ -958,7 +958,7 @@ void Packer::initLoader(const void *pdata, int plen, int pinfo)
|
|||||||
pinfo = (pinfo + 3) &~ 3;
|
pinfo = (pinfo + 3) &~ 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete linker;
|
delete linker; linker = NULL;
|
||||||
if (getFormat() < 128)
|
if (getFormat() < 128)
|
||||||
linker = new Linker(pdata, plen, pinfo); // little endian
|
linker = new Linker(pdata, plen, pinfo); // little endian
|
||||||
else
|
else
|
||||||
|
|||||||
+12
-2
@@ -143,12 +143,22 @@ static const char *mkline(unsigned long fu_len, unsigned long fc_len,
|
|||||||
bool decompress=false)
|
bool decompress=false)
|
||||||
{
|
{
|
||||||
static char buf[2000];
|
static char buf[2000];
|
||||||
char r[7+1];
|
char r[7+1] = "";
|
||||||
char fn[13+1];
|
char fn[13+1];
|
||||||
const char *f;
|
const char *f;
|
||||||
|
|
||||||
|
// Large ratios can happen because of overlays that are
|
||||||
|
// appended after a program is packed.
|
||||||
unsigned ratio = get_ratio(fu_len, fc_len);
|
unsigned ratio = get_ratio(fu_len, fc_len);
|
||||||
upx_snprintf(r, sizeof(r), "%3d.%02d%%", ratio / 10000, (ratio % 10000) / 100);
|
#if 1
|
||||||
|
if (ratio >= 1000*1000)
|
||||||
|
strcpy(r, "overlay");
|
||||||
|
#else
|
||||||
|
if (ratio >= 10*1000*1000) // >= "1000%"
|
||||||
|
strcpy(r, "999.99%");
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
upx_snprintf(r, sizeof(r), "%3d.%02d%%", ratio / 10000, (ratio % 10000) / 100);
|
||||||
if (decompress)
|
if (decompress)
|
||||||
f = "%10ld <-%10ld %7s %13s %s";
|
f = "%10ld <-%10ld %7s %13s %s";
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user