- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在阅读这本书 Hacking: The Art of Exploitation, 2nd Edition
并在简单的 C 程序中
#include <stdio.h>
int main()
{
int i;
for (i = 0; i < 10; i++)
{
puts("Hello, world!\n");
}
return 0;
}
书中列出gdb调试会先修改ebp寄存器:
(gdb) x/i $eip 0x8048384 <main+16>: mov DWORD PTR [ebp-4],0x0
正如它所解释的那样
(gdb) x/i $eip => 0x4011b6 <main+29>: mov DWORD PTR [ebp-0xc],0x0
所以在我的笔记本电脑上,它显示 [ebp-0xc],而不是 [ebp-4]。
Dump of assembler code for function main:
0x00401199 <+0>: lea ecx,[esp+0x4]
0x0040119d <+4>: and esp,0xfffffff0
0x004011a0 <+7>: push DWORD PTR [ecx-0x4]
0x004011a3 <+10>: push ebp
0x004011a4 <+11>: mov ebp,esp
0x004011a6 <+13>: push ebx
0x004011a7 <+14>: push ecx
0x004011a8 <+15>: sub esp,0x10
0x004011ab <+18>: call 0x4010a0 <__x86.get_pc_thunk.bx>
0x004011b0 <+23>: add ebx,0x2e50
=> 0x004011b6 <+29>: mov DWORD PTR [ebp-0xc],0x0
0x004011bd <+36>: jmp 0x4011d5 <main+60>
0x004011bf <+38>: sub esp,0xc
0x004011c2 <+41>: lea eax,[ebx-0x1ff8]
0x004011c8 <+47>: push eax
0x004011c9 <+48>: call 0x401030 <puts@plt>
0x004011ce <+53>: add esp,0x10
0x004011d1 <+56>: add DWORD PTR [ebp-0xc],0x1
0x004011d5 <+60>: cmp DWORD PTR [ebp-0xc],0x9
0x004011d9 <+64>: jle 0x4011bf <main+38>
0x004011db <+66>: mov eax,0x0
0x004011e0 <+71>: lea esp,[ebp-0x8]
0x004011e3 <+74>: pop ecx
0x004011e4 <+75>: pop ebx
0x004011e5 <+76>: pop ebp
0x004011e6 <+77>: lea esp,[ecx-0x4]
0x004011e9 <+80>: ret
End of assembler dump.
最佳答案
sub esp,0x10
在堆栈上为变量和其他东西分配了 16 个字节(相当于四个寄存器)的空间。mov DWORD PTR [ebp-0xc],0x0
似乎是第一个引用插槽 ebp-0xc
,并且它被初始化为零。看了之后cmp DWORD PTR [ebp-0xc],0x9
在 main+60
我确定这是 i = 0
来自 for
的初始化部分环形。
编译器可以将变量放在它想要的地方,虽然确定性,它会随着编译器的补丁版本而改变。
关于assembly - 在 Art of Exploitation 示例中被 [ebp-0xc] 而不是 [ebp-4] 混淆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66090921/
我是 React-native 的新手。 我遇到了这个错误:UnableToResolveError:无法从 Libraries/ART/ReactNativeART.js 解析模块 merge 我使
自 Android Lollipop 以来,Google 已将 DVM 替换为 ART,因为 ART 比 DVM 更快。还有其他原因吗? 最佳答案 ART 带来了一些主要的性能改进,这是 Dalvik
在具有目标 SDK 29 的 Android 应用程序上从 5.11.0 更新到 Facebook Audience 6.2.0 后,我在一小部分 Android 11 设备上看到了大量的崩溃报告。根
我正在尝试将 Android Lollipop 移植到 arndale 板上,但我面临以下有关 ART 崩溃 (AndroidRunTime) 的问题。 > I/art ( 2264): Reloca
我正在使用 newLisp 试用 Artful Mysql 模块,使用示例的“冒烟”测试未连接到 MySQL。 假设: 我是一名新手 Lisp 程序员。 平台是 MacOS X 10.9 新语言 10
Android 5.0+ 中 ART 运行时的一个被吹捧的功能是堆压缩,以减少堆 fragment 。 fragment 堆可以更容易地获得 OutOfMemoryErrors,因为可能没有一个连续的
我正在研究 ARKit(iPhone 框架),ARKit 项目免费提供的文件夹之一是标题为:art.scnassets 的文件夹。 .这些代表什么:art. ? .scn ? .dea ? tex ?
我目前正在使用 React Native ART 模块,除 Text 组件外一切正常,但该错误仅发生在 iOS 和 android 中 一切似乎都按预期工作。 当我尝试在 iOS 中使用 Text 组
对于那些熟悉“Prolog 的艺术”的人,您会建议使用哪些软件工具(例如 IDE、编辑器、编译器等)来学习这本书? 最佳答案 SWI-Prolog是一个免费的 Prolog 实现,带有一个集成编辑器(
我要为 Android 开发我的第一个应用程序(不用担心这只是一个学校项目,不会成为市场上另一个无用的应用程序:>)。 因此,在开始这项任务之前,我做了一些教程,其中之一(我认为它非常有用,因为有 s
我正在尝试从使用 JavaScript 的网站检索 html。我的方法如下: 创建一个 headless WebView(没有在 XML 中定义任何 View )并启用 JS。 创建一个 JavaSc
我希望 Android 运行时 (ART) 写入文件。因此,我将以下代码添加到 WORKING_DIRECTORY/art/runtime/runtime.cc。 std::string pid_
不知ART是不是虚拟机。 dex2oat 将 dalvik 字节代码编译成 native (特定于平台)代码,即 elf 文件。所以正如 android 开发者文章中提到的,它仍然有垃圾收集器。我不明
对于一些使用 ART 的用户,我在使用 Aviary SDK 时遇到了一个奇怪的错误。我很困惑为什么会发生这种情况(显然仅在 4.4.x 上),因为在 Dalvik 上调用此 SDK 时该应用程序可以
我已阅读互联网上有关适用于 Android 操作系统的新 ART 运行时的文章。许多文章称 ART 为新的虚拟机,我认为这是错误的,因为应用程序在安装后完全编译为 native 机器代码。如果 ART
我想知道并在谷歌上搜索答案,但没有找到。那么,更新的 ART 沙盒应用程序是否像 Dalvik VM?更准确地说,这个链接的图片也可以申请ART吗? http://davidchang168.blog
我想使用程序或图形库将图像转换为 ASCII 艺术,但我想指定要使用的调色板(符号)。所以基本上我想要一个图像,它从某个字母 A 呈现为文本,它是完整 ASCII 表的子集,例如 A := {a,b,
我正在阅读这本书 Art of Exploitation,这是一本好书,我从exploit_notesearch.c 文件中看到了那个例子。 简要作者尝试从notesearch.c溢出程序 int m
我有 3 个表 actor 、 movie 、 casting 。我必须找到与 Actor “ART Garfunkel”合作过的人。 我有解决方案,但我无法理解以下查询的工作原理。 **movie*
我的 android 应用程序中有一个 SQLite 数据库,但不幸的是,使用新的虚拟机 ART 它停止工作。 我在 DbHelper 类中遇到错误,特别是当我打开数据库以写入/读取它时。 我需要帮助
我是一名优秀的程序员,十分优秀!