|
static void patch_jump(char *code_to_patch,char *target)
{
int distance;
distance = (int)target - ((int)code_to_patch +5) ;
*code_to_patch++= 0xe9; /* jump */
*code_to_patch++ = ((char *)&distance)[0];
*code_to_patch++ = ((char *)&distance)[1];
*code_to_patch++ = ((char *)&distance)[2];
*code_to_patch = ((char *)&distance)[3];
}
这段程序的结果是什么啊?看不明白:( |
|