Restart a computer using function pointers in C

后端 未结 3 939
一整个雨季
一整个雨季 2021-01-28 00:37

I was learning about function pointers in C when I came across a program that restarts the computer upon execution.

void (*f) (void);
f=(void (*)(void) MK_FP(0xF         


        
3条回答
  •  自闭症患者
    2021-01-28 00:45

    The code is attempting to jump to the address where x86 CPUs start executing at power-on, aka the "Power On Reset Vector" (source).

提交回复
热议问题