Request a password program in C

I am reading a program that asks for a password written by C. But there is one line that I do not understand:

if(!OK){
 printf("\nWrong password!"); getch();
 f = MK_FP(0xFFFF,0x0000); f(); // this line I don't know
}

and f is the function pointer void far (*f)(void). who can explain thanks

+4
source share
1 answer

These lines were used to reboot the PC from the BIOS (MS-DOS).

MK_FP(0xFFFF,0x0000);

build a far pointer (32 bits at a time) and return it as a pointer to a function. Then it fis executed at this address, rebooting the PC.

Today it will not work on modern OS.

This program uses it.

+8
source

Source: https://habr.com/ru/post/1618377/


All Articles