i am using olydbg 1.10 and i would like to load the "user32.dll" dynamic library.
when i write the command push "user32.dll" it doesn't work.
i have to push it to the stack before i call kernel32.LoadLibraryA but the command
push 'user32.dll'
call kernel32.LoadLibraryA
this is the code i want to insert in the olyDbg :
push ebp ;
mov ebp,esp
sub esp,4;
push dword user32dll
call _LoadLibraryA@4
doesn't work, why that, i can't figure it out.
You just have to write the user32.dll string to some location and then push addresoflocation and call loadlibrary. Note that after user32.dll there should be 0x00 so its NULL terminated and not messed with anything :)
据我了解,您需要在内存中留出空间来存储字符串“ user32.dll”,并需要推入指向该字符串的堆栈指针。
In NASM you could do something like:
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 ; name of dll to be loaded by LoadLibary
; notice that you don't need to add the extension (.dll)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.