应用程序的内存布局 [英] Memory Layout of application

查看:175
本文介绍了应用程序的内存布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下问题是我的一个头。假设我有两个平台
具有相同的硬件,相同的操作系统和相同的编译器。如果我准确地编译
相同的应用程序,我可以确保两个机器上的内存布局将完全相同?换句话说,两个应用程序都具有相同的虚拟地址空间或
,很有可能不是这种情况。

The following question is a head-scratcher for me. Assuming that I have two platforms with an identical hardware, the same OS and the same compiler on it. If I compile exactly the same application, can I be sure that the memory layout on both machines will exactly be the same? In other words, both applications have exaclty the same virtual address space or is there a high chance that this is not the case.

感谢您的想法这个!

推荐答案

你不能指望它。作为安全功能,一些操作系统(包括Windows)在一定程度上随机化内存布局。

You can't count on it. As a security feature, some OS's (including Windows) randomize memory layout to some extent.

(这里有一个支持链接: http://blogs.msdn.com/ b / winsdk / archive / 2009/11/30 / how-to-disable-address-space-layout-randomization-aslr.aspx

(Here's a supporting link: http://blogs.msdn.com/b/winsdk/archive/2009/11/30/how-to-disable-address-space-layout-randomization-aslr.aspx)

这篇关于应用程序的内存布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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