refactor one if logic and fix two warning
This commit is contained in:
12
kpack_c.c
12
kpack_c.c
@@ -59,13 +59,13 @@ unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned c
|
||||
unsigned char *buf_ptr = buf;
|
||||
do {
|
||||
//printf("infile_ptr = %p, count = %u\n", infile_ptr, count);
|
||||
unsigned al = *(infile_ptr++);
|
||||
al -= 0x0E8;
|
||||
if (al > 1) { // if != E8 and != E9
|
||||
continue;
|
||||
}
|
||||
unsigned opcode = *(infile_ptr++);
|
||||
// E8 dword: call rel32
|
||||
// E9 dword: jmp rel32
|
||||
if (opcode > 0xE9)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (count < 5) {
|
||||
break;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned c
|
||||
memcpy(tmp - 4, cti, 1);
|
||||
}
|
||||
free(buf);
|
||||
return (unsigned)tmp;
|
||||
return 1;//(unsigned)tmp;
|
||||
|
||||
pack_calltrick_fail:
|
||||
*ctn = 0;
|
||||
|
@@ -99,7 +99,7 @@ static void LZInWindow_Init(void)
|
||||
ReadBlock();
|
||||
}
|
||||
#else
|
||||
#define LZInWindow_Create(a,b,c,d) /* nothing */
|
||||
#define LZInWindow_Create(a,b,c,d) do {(void)(a); (void)(b); (void)(c); (void)(d);} while(0); /* nothing */
|
||||
#define LZInWindow_Init() _buffer--, _pos++, _streamPos++
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user