seems like finished preprocess_calltrick todo check it
This commit is contained in:
18
kpack_c.c
18
kpack_c.c
@@ -43,7 +43,6 @@ unsigned pack_lzma(unsigned char *infile, unsigned char *outfile, unsigned insiz
|
||||
|
||||
unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned char ct1[256], unsigned *ctn, unsigned char *cti)
|
||||
{
|
||||
// TODO: check
|
||||
unsigned char *buf = malloc(2*insize);
|
||||
if (buf == NULL) {
|
||||
goto pack_calltrick_fail;
|
||||
@@ -78,7 +77,7 @@ unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned c
|
||||
buf_ptr += 8;
|
||||
}
|
||||
|
||||
} while(count > 0); //
|
||||
} while(count > 0);
|
||||
|
||||
unsigned idx = 0;
|
||||
while (idx < 256 && ct1[idx] != 0) {
|
||||
@@ -89,23 +88,18 @@ unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned c
|
||||
}
|
||||
*cti = ~(unsigned char)256;
|
||||
|
||||
if (buf_ptr == buf) {
|
||||
free(buf);
|
||||
return 0;
|
||||
} else {
|
||||
unsigned tmp;
|
||||
while (buf_ptr != buf) {
|
||||
buf_ptr -= 8;
|
||||
unsigned tmp;
|
||||
memcpy(&tmp, *buf_ptr, 4);
|
||||
memcpy(tmp - 4, cti, 1);
|
||||
// TDOO here jmp @b
|
||||
}
|
||||
|
||||
// TODO !
|
||||
free(buf);
|
||||
return tmp;
|
||||
|
||||
pack_calltrick_fail:
|
||||
*ctn = 0;
|
||||
// ebx = 0; // TODO what
|
||||
return 0; // 0?
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user