⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rdhdr.cpp

📁 Jazmyn is a 32-bit, protected mode, multitasking OS which runs on i386 & above CPU`s. Its complete
💻 CPP
字号:
#include<stdio.h>
#include<fstream>

#define uint unsigned int

typedef struct
{
        uint	magic;
        uint	hdr_len;
        uint	entry_point;
        uint	cs;
        uint	ds;
        uint	bss;
}exe;

int main()
{
	exe exehdr;
	std::ifstream i;
	i.open("init.com",std::ios::binary);
        if(!i)
        {
               printf("open failed\n");
               exit(0);
        }
        i.read((char*)&exehdr,sizeof(exe));
        if(!i.gcount())
        {
               printf("read failed\n");
               exit(0);
        }
        printf("magic :%x\n",exehdr.magic);
        printf("hdrsz :%u\n",exehdr.hdr_len);
        printf("entry :%u\n",exehdr.entry_point); 
        printf("cs sz :%u\n",exehdr.cs);
        printf("ds sz :%u\n",exehdr.ds);
        printf("bss sz:%u\n",exehdr.bss);
        i.close();
        return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -