【问题标题】:how to write assembly command in olydbg which load "user32.dll"?如何在加载“user32.dll”的 olydbg 中编写汇编命令?
【发布时间】:2012-01-09 01:39:22
【问题描述】:

我正在使用 olydbg 1.10,我想加载“user32.dll”动态库。

当我编写命令 push "user32.dll" 时它不起作用。

在调用 kernel32.LoadLibraryA 之前,我必须将它推入堆栈 但是命令

push 'user32.dll'
call kernel32.LoadLibraryA

这是我要插入到 olyDbg 中的代码:

push ebp ; 
mov ebp,esp
sub esp,4; 
push dword user32dll
call _LoadLibraryA@4

为什么这不起作用,我想不通。

【问题讨论】:

    标签: windows assembly 32-bit


    【解决方案1】:

    据我了解,您需要在内存中留出一个空间来存储字符串“user32.dll”,以及指向该字符串的堆栈指针。

    【讨论】:

    • 您应该找到任何未使用的内存区域,将字符串“user32.dll”存储在那里(不要忘记终止NULL),然后将此字符串的地址用于push dword
    【解决方案2】:

    在 NASM 中,您可以执行以下操作:

    global  _main
    extern  LoadLibraryA
    
    section .text
      _main:
        push user32dll      ; push argument to `LoadLibrary` (name of dll) onto stack
        call LoadLibraryA   ; call LoadLibary, on success handle will be stored in eax
        add     esp, 4      ; fix the stack
        ret                 ; return
    user32dll:
    db      'user32', 0     ; null terminated name of dll to be loaded by LoadLibary
                            ; notice that you don't need to add the extension (.dll)
    

    【讨论】:

      【解决方案3】:

      您只需将 user32.dll 字符串写入某个位置,然后推送 addresoflocation 并调用 loadlibrary。 请注意,在 user32.dll 之后应该有 0x00,因此它的 NULL 终止并且不会与任何东西混淆:)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-07-16
        • 2020-10-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多