I am reading a program that requests a password written by C. But there is one line I do not understand is :
if(!OK){
printf("\nWrong password!"); getch();
f = MK_FP(0xFFFF,0x0000); f(); // this line I don't know
}
while f is pointer of function void far (*f)(void)
. is anyone can explain thank you
This lines were used to reboot a PC from the BIOS (MS-DOS).
MK_FP(0xFFFF,0x0000);
construct a far pointer (32 bits at the time) and returns it as a pointer to function. Then f
is executed at that address, rebooting the PC.
It wouldn't work today on modern OSes.
This program uses it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With