用汇编指令获取GDT //主程序 outoutpeh.cpp #include <stdio.h> #include <stdlib.h> int main(int argc ,char* argv[]) { unsigned char buf[6] = { 0 }; //获取GDT表 _asm { sgdt buf; } printf("%x,%x", *(unsigned int*)&(buf[2]), *(unsigned short*)&(buf[0]));//unsigned int* 取后四位,unsigned short* 取前两位 是长度 return 1; } 结果