EXE头部
关于EXE头部大小,有些资料描述说EXE头部大小为最前面的28个字节,也有些资料描述说EXE头部大小为最前面固定的64个字节。
MS-DOS 2.0 Compatible EXE Header
unused
OEM Identifier
OEM Information
Offset to PE Header
关于第1种说法,说的只是MS-DOS 2.0 Compatible EXE Header,这28个字节。而第2种说法,除了包含MS-DOS 2.0 Compatible EXE Header,还包括:
unused
OEM Identifier
OEM Information
Offset to PE Header
总共64个字节。
但不管是哪种说法,EXE头部大小可通过头部的章节数(paragraph,偏移08-09,Number of paragraphs in the header)* 16获得。每个章节(paragraph)为16字节。
EXE头部之后就是重定位表(Relocation Table)
重定位表(Relocation Table)是可选的,可能没有。
再之后就是Stub Program
4D 5A 30 00 02 00 01 00 20 00 00 00 FF FF 00 00
00 00 00 00 00 00 02 00 1E 00 00 00 01 00 01 00
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48 45 4C 4C 4F 2C 20 54 48 49 53 20 49 53 20 4D
41 53 4D 21 0D 0A 24 00 00 00 00 00 00 00 00 00
B8 00 00 8E D8 BA 00 00 B4 09 CD 21 B4 4C CD 21
EXE头部
0-63:前面64个字节表示EXE头部
4D 5A 30 00 02 00 01 00 20 00 00 00 FF FF 00 00
00 00 00 00 00 00 02 00 1E 00 00 00 01 00 01 00
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0-1:4D 5A
表示魔数(magic):MZ
MZ表示Mark Zbikowski(马克·兹比科夫斯基)的首字母缩写,他为DOS创建了第一个链接器。
2-3:30 00
文件最后页的字节数,这里是0x30(48)
4-5: 02 00
文件页数,这里是0x02(2),表示2个
6-7:01 00
重定位元素个数,表示有1个重定位元素
8-9:20 00
以段落为单位的头部大小。这里是0x20(32),表示32个
10-11:00 00
所需的最小附加段。表示最小附加段大小为0
12-13:FF FF
所需的最大附加段。表示最大附加段大小为65535
14-15:00 00
初始的堆栈段(SS)相对偏移量值
16-17:00 00
初始的堆栈指针(SP)值。
18-19:00 00
校验和
20-21:00 00
初始的指令指针(IP)值。程序加载后ip寄存器指向的代码段的偏移量
22-23:02 00
初始的代码段(CS)相对偏移量值
24-25:1E 00
重定位表在文件中的偏移地址
26-27:00 00
覆盖号
28-35:01 00 01 00 02 00 00 00
保留字(一般都是为确保对齐而预留)
36-37:00 00
OEM 标识符
38-39:00 00
OEM 信息
40-59:00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
保留字(一般都是为确保对齐而预留)
60-63:00 00 00 00
PE头部在文件中的偏移地址。这里是00 00 00 00表示没有PE头部
PE头部标识(也称为PE signature或魔数):50 45 00 00 ,其中前两个字节50 45表示PE,后面两个字节00 00
MS-DOS Stub
64-:MS-DOS存根(DOS实模式存根程序)
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48 45 4C 4C 4F 2C 20 54 48 49 53 20 49 53 20 4D
41 53 4D 21 0D 0A 24 00 00 00 00 00 00 00 00 00
B8 00 00 8E D8 BA 00 00 B4 09 CD 21 B4 4C CD 21
相关推荐
这篇文章主要讲述了如何将一个基于Eclipse的GUI项目打包成可执行的EXE文件,其中涉及到了两个关键工具:fat_jar插件和exe4j。下面是对这两个工具及其使用方法的详细说明。 首先,fat_jar插件是Eclipse中的一个便捷...
本篇文章将详细介绍如何使用exe4j来完成这一过程,以及包含第三方库的打包步骤。 【描述】:在Java项目开发完成后,通常需要将其打包成易于分发和运行的格式。exe4j提供了一个简洁的界面和灵活的配置选项,使得这个...
本篇将详细探讨如何利用Windows自带的Ftp.exe程序,在特定条件下实现payload的远程执行,以及这种技术可能带来的安全风险。 #### Ftp.exe简介及其应用场景 Ftp.exe是Windows操作系统自带的一个实用程序,用于通过...
"Windows系统CPU内存网络性能统计第二篇 CPU CPU整体使用率"这个主题主要聚焦于CPU性能的分析,尤其是整体使用率。下面将详细讨论相关知识点。 1. **CPU使用率**:CPU使用率是指CPU在给定时间内的繁忙程度,通常以...
本篇文章将详细介绍如何利用Qt的API来实现隐藏UI启动第三方的可执行文件(exe)。 首先,让我们理解Qt中的几个关键概念: 1. **QProcess**:这是Qt提供的一个类,用于与外部进程进行通信,包括启动、控制和监控进程...
Arduino一试就上手(第2版).pdf Arduino与树莓派哪个是更适合 - 推酷.pdf Arduino从基础到实践.pdf ARDUINO开发实战指南 AVR篇.pdf Arduino开源设计_吴义满.pdf ARDUINo玩转电子制作.pdf Arduino电子设计实战指南....
#### 二、使用Visual Cafe创建EXE文件 ##### 2.1 工具介绍 Visual Cafe是一款集成开发环境(IDE),支持多种编程语言,包括Java。它提供了一个功能强大的本地编译器,能够将Java程序转换为Windows平台上的EXE文件。 ...
第二步:将 Jar 文件转换为 Exe 文件 打开 Exe4j 软件,选择“JAR in EXE”选项,然后选择要转换的 Jar 文件。填写项目名称和输出目录,选择图标文件(ico 文件),然后单击“下一步”。 第三步:配置 Exe 文件的...
Python的exe打包通常依赖于第三方工具,其中最常用的是`py2exe`和`cx_Freeze`。这两个工具都可以将Python源代码、依赖库以及Tkinter界面转换为Windows平台上的可执行文件。 1. **py2exe**:py2exe是一个Python模块...
在本篇文章中,我们将详细介绍如何将GUI图形用户界面转换为可执行文件exe,特别适用于初学者快速上手。这种方法不仅简单易学,而且能够有效地帮助开发者将自己开发的GUI应用程序部署到非MATLAB环境中运行。接下来,...
本篇将详细讲解如何在WPF应用中自定义exe进程嵌入控件,并提供相关的技术细节和步骤。 首先,我们需要了解WPF的基本概念。WPF是.NET Framework的一部分,用于构建富客户端应用程序。它提供了丰富的UI设计工具,如...
本篇将详细介绍关于“Windows登录界面”及其相关知识点,旨在帮助你理解和定制你的电脑登录体验。 1. **登录界面的基本功能**: - 用户身份验证:登录界面要求用户提供用户名和密码,以验证用户的身份。这是确保...
本篇文章将指导读者如何将 Web 应用程序打包成 EXE 文件,以便客户可以轻松地安装和使用。下面是详细的步骤和知识点: 一、需求和目标 * 客户需要将 Web 应用程序打包成 EXE 文件,以便快速安装和使用。 * 我们的 ...
这篇教程将详细介绍如何使用 Java 将程序转化为 EXE 格式。 首先,理解为什么需要将 Java 程序转换为 EXE。Java 程序通常以 JAR 文件的形式存在,需要 Java 运行时环境(JRE)才能运行。而 EXE 文件是 Windows 平台...
《操作系统原理DOS篇(第二版)》深入探讨了DOS的工作原理和相关技术,对于理解早期计算机操作系统的运作机制具有重要意义。 在DOS系统中,用户通过命令行界面输入指令来执行任务,如文件管理、程序运行等。DOS的...
- 第二条命令 `assoc .exe=exefile` 用于将 .exe 扩展名重新关联到 exefile 类型,这有助于修复可能存在的文件类型关联问题。 3. **验证修复结果**: - 重启计算机后尝试再次打开之前无法启动的 .exe 文件。 - ...
本篇文章将详细介绍这款工具的功能、使用方法以及可能涉及到的风险,帮助你更好地理解和操作。 HTC一键解锁工具,正如其名,是一款专为HTC设备设计的软件,旨在简化手机的解锁Bootloader(引导加载器)过程。...
这篇博文“Install4j制作exe”可能是关于如何使用Install4j工具来将Java项目转化为Windows系统下的可执行文件.exe的详细教程。尽管描述中没有提供具体细节,但可以推断作者可能分享了从设置项目、配置安装脚本到生成...
本篇文章将深入探讨如何在C# WPF(Windows Presentation Foundation)应用程序中使用应用程序域来加载外部的exe文件到当前窗口。 首先,理解WPF的基本概念至关重要。WPF是微软推出的UI框架,用于构建桌面应用程序,...