Windows上PE文件(exe)的最小文件大小是多少?和最小的内存分配? [英] What is the minimum file size of a PE file (exe) on Windows? And the minimal memory allocation?

查看:149
本文介绍了Windows上PE文件(exe)的最小文件大小是多少?和最小的内存分配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上,PE文件(exe)的最小文件大小是多少? 还有最小的内存分配?

What is the minimum file size of a PE file (exe) on Windows? And the minimum memory allocation?

我组装了以下代码(使用VS 10附带的MASM(ml.exe)和link.exe): 我不能遗漏kernel32.lib和ExitProcess,如果我这样做,程序将崩溃.

I assembled (using MASM (ml.exe) and link.exe that come with VS 10) the following code: I can not leave out kernel32.lib and ExitProcess, if I do, the program crashes.

; Assmebly options
.386
.MODEL FLAT, STDCALL
option casemap:none

; Include Libs
includelib kernel32.lib

; Imported symbols
ExitProcess PROTO :Dword
Sleep PROTO :Dword

; Code
.CODE

start:
    invoke Sleep, 10000
    invoke ExitProcess, 0
END start

仅包含Sleep命令是为了能够在程序结束之前读取内存使用情况.

The Sleep command is included only to be able to read the memory usage before the program ends.

现在,我测量以下内容:.exe文件的大小正好为2.5 KB(如果我包含user32.lib和MessageBoxA,它的大小将变成3 KB->块?),并且应用程序使用136 KB RAM运行(Vista 32位).

Now I measure the following: The .exe file is exactly 2.5 KB in size (if I include user32.lib and MessageBoxA, it becomes 3 KB in size --> blocks?) and the application uses 136 KB RAM when it's run (Vista 32bit).

这么简单的程序难道没有多少内存吗?为什么exe文件这么大,而RAM要求却比exe文件大?

Isn't that somewhat much memory for such a simple program? Why is the exe file so large, and the RAM requirement much larger than the exe file?

有一些最小的内存大小吗?那文件呢?看起来它是以0.5 KB的块为单位组织的,但是对于这个最短的程序,它不是0.5 KB吗?

Are there some minimal memory sizes? What about the file? It looks like it's organized in blocks of 0.5 KB in size, but isn't it 0.5 KB then for this shortest possible program?

我在哪里可以读到( http://msdn.microsoft. com/en-us/magazine/cc301805.aspx (我将检出)?

Where can I read about this (except http://msdn.microsoft.com/en-us/magazine/cc301805.aspx which I will check out)?

谢谢(我的第一个问题在这里)

Thanks (my first question here)

推荐答案

如果您还没有阅读过这方面的内容,这是一个非常好的页面:

This is a very good page on exactly this subject, if you haven't read it already:

http://www.phreedom.org/research/tinype/

这篇关于Windows上PE文件(exe)的最小文件大小是多少?和最小的内存分配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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