b_method 5th argument to f_decompress
l_lx_exec.c l_lx_pti.c l_lx_sep.c l_lx_sh.c committer: jreiser <jreiser> 1131565060 +0000
This commit is contained in:
@@ -127,12 +127,12 @@ static uint32_t ascii5(char *p, uint32_t v, unsigned n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static unsigned char *
|
||||||
__attribute_cdecl
|
__attribute_cdecl
|
||||||
do_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
do_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
||||||
{
|
{
|
||||||
(void)len; (void)prot; (void)flags; (void)fd; (void)offset;
|
(void)len; (void)prot; (void)flags; (void)fd; (void)offset;
|
||||||
return (char *) mmap((void *)&addr);
|
return (unsigned char *) mmap((void *)&addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ typedef void f_unfilter(
|
|||||||
);
|
);
|
||||||
typedef int f_expand(
|
typedef int f_expand(
|
||||||
const nrv_byte *src, nrv_uint src_len,
|
const nrv_byte *src, nrv_uint src_len,
|
||||||
nrv_byte *dst, nrv_uint *dst_len );
|
nrv_byte *dst, nrv_uint *dst_len, int method );
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -418,7 +418,7 @@ void upx_main(
|
|||||||
|
|
||||||
if (h.sz_cpr < h.sz_unc) { // Decompress block.
|
if (h.sz_cpr < h.sz_unc) { // Decompress block.
|
||||||
nrv_uint out_len;
|
nrv_uint out_len;
|
||||||
i = (*f_decompress)(xi.buf, h.sz_cpr, buf, &out_len);
|
i = (*f_decompress)((unsigned char *)xi.buf, h.sz_cpr, buf, &out_len, h.b_method);
|
||||||
if (i != 0 || out_len != (nrv_uint)h.sz_unc)
|
if (i != 0 || out_len != (nrv_uint)h.sz_unc)
|
||||||
goto error;
|
goto error;
|
||||||
// Right now, unfilter is combined with decompression.
|
// Right now, unfilter is combined with decompression.
|
||||||
|
|||||||
+4
-3
@@ -116,7 +116,7 @@ typedef void f_unfilter(
|
|||||||
);
|
);
|
||||||
typedef int f_expand(
|
typedef int f_expand(
|
||||||
const nrv_byte *, nrv_uint,
|
const nrv_byte *, nrv_uint,
|
||||||
nrv_byte *, nrv_uint *
|
nrv_byte *, nrv_uint *, int method
|
||||||
);
|
);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -156,11 +156,12 @@ ERR_LAB
|
|||||||
|
|
||||||
if (h.sz_cpr < h.sz_unc) { // Decompress block
|
if (h.sz_cpr < h.sz_unc) { // Decompress block
|
||||||
nrv_uint out_len;
|
nrv_uint out_len;
|
||||||
int const j = (*get_fexp(h.b_method))(xi->buf, h.sz_cpr, xo->buf, &out_len);
|
int const j = (*get_fexp(h.b_method))((unsigned char *)xi->buf, h.sz_cpr,
|
||||||
|
(unsigned char *)xo->buf, &out_len, h.b_method);
|
||||||
if (j != 0 || out_len != (nrv_uint)h.sz_unc)
|
if (j != 0 || out_len != (nrv_uint)h.sz_unc)
|
||||||
err_exit(7);
|
err_exit(7);
|
||||||
if (h.b_ftid!=0) {
|
if (h.b_ftid!=0) {
|
||||||
(*get_funf(h.b_ftid))(xo->buf, out_len, h.b_cto8);
|
(*get_funf(h.b_ftid))((unsigned char *)xo->buf, out_len, h.b_cto8);
|
||||||
}
|
}
|
||||||
xi->buf += h.sz_cpr;
|
xi->buf += h.sz_cpr;
|
||||||
xi->size -= h.sz_cpr;
|
xi->size -= h.sz_cpr;
|
||||||
|
|||||||
+1
-1
@@ -184,7 +184,7 @@ ERR_LAB
|
|||||||
if (h.sz_cpr < h.sz_unc) {
|
if (h.sz_cpr < h.sz_unc) {
|
||||||
// in-place decompression
|
// in-place decompression
|
||||||
nrv_uint out_len;
|
nrv_uint out_len;
|
||||||
j = (*f_decompress)(xo->buf+j, h.sz_cpr, xo->buf, &out_len);
|
j = (*f_decompress)(xo->buf+j, h.sz_cpr, xo->buf, &out_len, h.b_method);
|
||||||
if (j != 0 || out_len != (nrv_uint)h.sz_unc)
|
if (j != 0 || out_len != (nrv_uint)h.sz_unc)
|
||||||
err_exit(7);
|
err_exit(7);
|
||||||
// j == 0 now
|
// j == 0 now
|
||||||
|
|||||||
+3
-2
@@ -108,7 +108,7 @@ do_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
|||||||
|
|
||||||
typedef int f_expand(
|
typedef int f_expand(
|
||||||
const nrv_byte *, nrv_uint,
|
const nrv_byte *, nrv_uint,
|
||||||
nrv_byte *, nrv_uint * );
|
nrv_byte *, nrv_uint *, int method );
|
||||||
|
|
||||||
static void
|
static void
|
||||||
unpackExtent(
|
unpackExtent(
|
||||||
@@ -146,7 +146,8 @@ ERR_LAB
|
|||||||
|
|
||||||
if (h.sz_cpr < h.sz_unc) { // Decompress block
|
if (h.sz_cpr < h.sz_unc) { // Decompress block
|
||||||
nrv_uint out_len;
|
nrv_uint out_len;
|
||||||
int const j = (*f_decompress)(xi->buf, h.sz_cpr, xo->buf, &out_len);
|
int const j = (*f_decompress)((unsigned char *)xi->buf, h.sz_cpr,
|
||||||
|
(unsigned char *)xo->buf, &out_len, h.b_method );
|
||||||
if (j != 0 || out_len != (nrv_uint)h.sz_unc)
|
if (j != 0 || out_len != (nrv_uint)h.sz_unc)
|
||||||
err_exit(7);
|
err_exit(7);
|
||||||
xi->buf += h.sz_cpr;
|
xi->buf += h.sz_cpr;
|
||||||
|
|||||||
Reference in New Issue
Block a user