assembly - 在寄存器之外传递参数
问题描述
我正在尝试将第二个参数传递给我的 ls 命令ls -a -l
,但不使用寄存器。
这里,-a 参数的地址在 esi。我想将 -l 放在内存中的某个位置,而不是寄存器。我已经尝试过使用堆栈,但lea esp, [esp-18]
没有将地址放在堆栈上。相反,它放置值(0x00006c2d,对于 -l)。
push 0x0000612d ; -a
mov esi, esp
mov dword [esp-30], 0x00006c2d ; -l
push eax
push edi ; 0000
;sub esp,4
;lea esp, [esp-18] ; the value is loaded instead of the address
push eax
push esi ; location to -a (2nd arg of argv)
push ebx ; location of /bin/ls (1st arg of argv)
mov ecx, esp
我想知道当我没有寄存器时如何添加参数。
解决方案
推荐阅读
- javascript - 谷歌地图多个标记映射到一个没有坐标的区域
- django - 数据库重命名后django迁移不起作用
- html - 如何不只旋转图像周围的边框?
- python - 按列类型就地填充空值:TypeError:(“'NoneType'对象不可调用”,'发生在索引处
- r - 如何在 ShinyDashboard 中指定 menuItem?
- java - 支持 JavaFX + Spring Boot + Hibernate 应用程序中的多种环境
- python - 如何使用 asfreq("D") SUN-THU WEEK 为时间序列 DataFrame 添加频率?
- php - 解密加密的 PDF 以加载到 FPDI
- azure - Microsoft 文本分析 API (v2.1) 示例代码不起作用
- javascript - 如何在 Fullcalendar 的 resourceTimeGridDay 中的 eventReceive 上获取资源 id