汇编指令地址

发布于 2024-09-05 18:38:32 字数 61 浏览 2 评论 0原文

为什么每次反汇编同一个 .exe 文件时,相同的指令位于相同的地址?那是什么地址(RAM?HDD?虚拟?)?

Why every time when I disassembly the same .exe file the same instruction is in the same address? And what address is that(RAM? HDD? Virtual?)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请恋爱 2024-09-12 18:38:32

基本思想是,为了允许程序的可移植性并允许不同的程序在同一系统上运行而不发生冲突,您所看到的基本上相当于相对地址,操作系统在程序运行时将其转换为真实地址。

您需要地址的原因是为了引用其他指令(例如跳转)的地址的指令。

The basic idea is that, to allow portability of programs and to allow different programs to run on the same system without clashing, what you are seeing basically amounts to relative addresses which the OS translates to real addresses when the program is run.

The reason you need to have addresses at all is for instructions that reference addresses of other instructions such as jumps.

毁虫ゝ 2024-09-12 18:38:32

没有理由。这就是该操作系统上的可执行文件/链接格式决定如何工作的方式。每种体系结构都是不同的,例如,即使在 x86 和 x64 上,可执行文件也可以加载到随机虚拟地址,或者每次都加载到同一个虚拟地址。反汇编器将给出文件中的偏移量或虚拟地址,该虚拟地址只是运行时确定的基地址+文件偏移量,还可能是节偏移量。这是高度架构依赖的,所以我不能真正给出具体的答案......

There is no reason. It's just how the executable/linking format on that O/S decided to work. Every architecture is different, for instance, even on x86 and x64, executables can be loaded at a randomized virtual address, or at the same one every time. The disassembler will either give the offset in the file, or a virtual address, which is just the base address decided at runtime + the file offset, and possibly a section offset. This is highly architecture dependent, so I can't really give a concrete answer...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文