diff --git a/kpack_c.c b/kpack_c.c index e0a296f..2d7f2d8 100644 --- a/kpack_c.c +++ b/kpack_c.c @@ -60,7 +60,7 @@ unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned c do { //printf("infile_ptr = %p, count = %u\n", infile_ptr, count); unsigned al = *(infile_ptr++); - al -= 0x0E8; + al -= 0x0E8; // relative call opcode if (al > 1) { continue; } @@ -82,8 +82,7 @@ unsigned preprocess_calltrick(unsigned char *infile, unsigned insize, unsigned c memcpy(buf_ptr, &infile_ptr, sizeof(buf_ptr)); buf_ptr += sizeof(buf_ptr); } - - } while(count > 0); + } while(--count > 0); unsigned idx = 0; while (idx < 256 && ct1[idx] != 0) {