【问题标题】:ASM: LoadLibrary & GetProcAddressASM:LoadLibrary 和 GetProcAddress
【发布时间】:2011-07-06 22:45:58
【问题描述】:

我第一次使用 ASM,在我继续之前,我需要知道我在写这篇文章时是否理解了所有内容。当前代码如下所示:

push 0xDEADBEEF      ; address of library name
mov eax, 0xDEADBEEF  ; address of LoadLibraryA

call eax        ; call LoadLibraryA

mov esi, eax    ; store returned address

push 0xDEADBEEF      ; address of function name
push esi        
mov eax, 0xDEADBEEF   ; address of GetProcAddress

call eax             ; call GetProcAddress
mov esi, eax         ; store returned address

push 0
push 0
push 0
call esi  ; call the function returned by GetProcAddress

0xDEADBEEF 只是我稍后会修补的虚拟地址。有什么问题吗? =)

【问题讨论】:

  • 您有什么特别的问题吗?
  • @Michael 我只需要知道我编写的代码是否可以正常工作(在我实际编译它并修补虚拟地址之前)
  • @thatoneguy 有用吗?顺便说一句,您如何获得 LoadLibrary 函数的地址

标签: assembly loadlibrary getprocaddress


【解决方案1】:

您通常不会直接致电GetProcAddress。这是因为它是从 DLL 导出的。在这种情况下,链接器将合成一个GetProcAddress 函数,该函数对__imp__GetProcAddress 符号进行间接远调用。见http://blogs.msdn.com/b/oldnewthing/archive/2006/07/24/676669.aspxhttp://blogs.msdn.com/b/oldnewthing/archive/2010/03/18/9980802.aspx

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多