Search Posts

Amazing recording feature by specific which code-block you want to record

In the original GKD design, it works with bochs instrumentation. Being helped ( by the author of bochs (Mr Stanislav Shwartsman ) emulator, now we can use the prefetch instruction to specific which code-block you want to record, it becomes even more useful now.

__asm__ __volatile__("PREFETCHT0 0x12345678");
char *buffer = (char *) malloc(fileSize);
fread(buffer, 1, fileSize, file);
printf("username :");
char username[101];
__asm__ __volatile__("PREFETCHT0 0x87654321");

Every code surrounded by PREFETCHT0 and PREFETCHT1 instruction, GKD will record jumping instruction (jmp/call/iret). In my kernel, if it crash in the gets() function, i just do:

__asm__ __volatile__("PREFETCHT0 0x12345678");
__asm__ __volatile__("PREFETCHT0 0x87654321");

Then GKD will give you this


Leave a Reply

Your email address will not be published. Required fields are marked *