PE文件中的MZ签名是什么? [英] What is the MZ signature in a PE file for?

查看:175
本文介绍了PE文件中的MZ签名是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个程序,它会解析PE对象的各种信息。

I'm working on a program that will parse a PE object for various pieces of information.

阅读规范虽然,我找不到为什么MZ字节

Reading the specifications though, I cannot find out why the MZ bytes are there, as I cannot find this on the list of machine types that these 2 bytes are supposed to represent.

有人可以澄清吗?

推荐答案

MZ签名是MS-DOS可重定位16位EXE格式使用的签名。

The MZ signature is a signature used by the MS-DOS relocatable 16-bit EXE format.

PE二进制包含MZ头的原因是为了向后兼容。如果可执行文件在基于DOS的系统上运行,它将运行MZ版本(几乎总是只是存根,说你需要在Win32系统上运行程序)。

The reason a PE binary contains an MZ header is for backwards compatibility. If the executable is run on a DOS-based system it will run the MZ version (which is nearly always just stub that says you need to run the program on a Win32 system).

当然,这并不像现在世界从DOS转移到后来的任何时候一样有用。

Of course this is not as useful nowadays as it was back when the world was transitioning from DOS to whatever would come after it.

当时有几个程序实际上将一个DOS版本和Win32版本绑定在一个单一的二进制。

Back then there were a few programs that would actually bind together a DOS version and a Win32 version in a single binary.

和大多数事情处理Windows历史,雷蒙陈有一些有趣的文章此主题:

And as with most things dealing with Windows history, Raymond Chen has some interesting articles about this subject:

  • Why does a corrupted binary sometimes result in "Program too big to fit in memory"?
  • What's the difference between the COM and EXE extensions?

这篇关于PE文件中的MZ签名是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆