1 Star 0 Fork 1

西边/proj3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
a2.asm 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
西边 提交于 2021-10-17 11:14 . commit
global _main
section .data
LC0:
db "a.dll",0
LC1:
db "LoadLibrary Error[%d]",0ah,0
LC2:
db "SetGlobalHook",0
LC3:
db "GetProcAddress Error[%d]",0ah,0
LC4:
db "SetGlobalHook OK.",0ah,0
LC5:
db "SetGlobalHook ERROR.",0ah,0
LC6:
db "UnsetGlobalHook",0
LC7:
db "UnsetGlobalHook OK.",0ah,0
LC8:
db "check stack fail!",0ah,0
extern _LoadLibraryA,_GetLastError,_printf,_GetProcAddress@8,\
_printf,_exit
section .text
_main:
push ebp
mov ebp,esp
sub esp,0x1000
mov dword [ebp-4], 0 ; hDll
mov dword [ebp-8], 0 ; SetGlobalHook
mov dword [ebp-12], 0 ; UnsetGlobalHook
mov dword [ebp-16], 0 ; bRet
mov esi,esp
push LC0
call _LoadLibraryA
cmp esi,esp
call _cs
mov [ebp-4], eax ; hDll
cmp dword [ebp-4], 0 ; hDll
jne .Lmain_400
call _GetLastError
mov esi,esp
push eax
push LC1
mov eax,0
call _printf
add esp,8
cmp esi,esp
call _cs
jmp .Lmain_20
.Lmain_400:
mov esi,esp
push LC2
mov eax,[ebp-4] ; hDll
push eax
call _GetProcAddress@8
cmp esi,esp
call _cs
mov [ebp-8], eax ; SetGlobalHook
cmp dword [ebp-8], 0 ;SetGlobalHook
jne .Lmain_390
call _GetLastError
mov esi,esp
push eax
push LC3
mov eax,0
call _printf
add esp,8
cmp esi,esp
call _cs
jmp .Lmain_20
.Lmain_390:
mov eax,[ebp-8] ; _SetGlobalHook
call eax
mov [ebp-16], eax ; bRet
mov eax,[ebp-16] ; bRet
test eax,eax
je .Lmain_380
mov esi,esp
push LC4
mov eax,0
call _printf
add esp,4
cmp esi,esp
call _cs
jmp .Lmain_370
.Lmain_380:
mov esi,esp
push LC5
call _printf
add esp,4
cmp esi,esp
call _cs
.Lmain_370:
mov esi,esp
push LC6
mov eax,[ebp-4] ; hDll
push eax
call _GetProcAddress@8
cmp esi,esp
call _cs
mov [ebp-12],eax ; UnsetGlobalHook
cmp dword [ebp-12], 0 ; UnsetGlobalHook
jne .Lmain_360
call _GetLastError
mov esi,esp
push eax
push LC3
mov eax,0
call _printf
add esp,8
cmp esi,esp
call _cs
jmp .Lmain_20
.Lmain_360:
mov eax,[ebp-12] ; _UnsetGlobalHook
call eax
mov esi,esp
push LC7
mov eax,0
call _printf
add esp,4
cmp esi,esp
call _cs
.Lmain_20:
mov eax,0
leave
ret
_cs:
je .Lcs_0
push LC8
mov eax,0
call _printf
push 0
call _exit
.Lcs_0:
ret
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huanghao0000/proj3.git
git@gitee.com:huanghao0000/proj3.git
huanghao0000
proj3
proj3
master

搜索帮助