【问题标题】:What the code does and what input it should receive代码做什么以及它应该接收什么输入
【发布时间】:2014-01-22 12:46:43
【问题描述】:

这是来自装配考试的问题。 问题: 以下代码的输入应该是什么? 下面的代码是做什么的?

我试图用笔和纸来追踪它,但我不知道它做了什么以及它应该接收什么参数。

有什么想法吗?

【问题讨论】:

  • 这取决于 ABI,例如WIN32 和 Linux x86 有不同的调用约定。
  • 好的 - 我现在已经为你修复了标签。

标签: windows winapi assembly x86 intel


【解决方案1】:

该函数实现N路切换,call P指令紧跟函数数组。

...
; Here: EAX = index of function (0..N-1)
call P
dd N ; number of functions in the array
dd Func0_Addr, Func1_Addr, ..., Func(N-1)_Addr  ;  array
; Return address after function terminated
...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-12
    • 1970-01-01
    • 2019-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多