TA的每日心情  | 奋斗 2024-5-22 16:18 | 
|---|
 
  签到天数: 1129 天 [LV.10]以坛为家III  
 | 
 
format PE GUI 4.0 DLL 
entry DllMain 
 
include 'win32a.inc' 
 
section '.text' code readable executable 
 
; DllMain函数,DLL入口点 
proc DllMain, hInstance, reason, reserved 
 
    ; 导出函数:SearchSignature 
; 参数: 
;   startAddr: 搜索并搜索的起始地址 
;   endAddr: 搜索感搜索的结束地址 
;   signature: 特征码模式字符串,用'?'表示通配符 
; 返回值: 
;   成功时返回找到的地址,失败时返回NULL 
proc SearchSignature, startAddr, endAddr, signature 
    pushad 
    ; 获取搜索的内存起始和结束地址 
    mov eax, [startAddr] 
    test eax, eax 
    jz .error 
    mov [search_start], eax 
 
    mov eax, [endAddr] 
    test eax, eax 
    jz .error 
    mov [search_end], eax 
 
    ; 在内存中搜索特征码 
    mov edi, [search_start] 
    mov ecx, [endAddr] 
    sub ecx, [startAddr] 
    test ecx, ecx 
    jz .error 
 
    .loop: 
    push ecx 
    mov ebx, edi 
    mov esi, [signature] 
    mov edx, edi 
 
    .compare: 
    mov cl, [esi] 
    test cl, cl 
    jz .found 
    cmp cl, '?' 
    je .wildcard 
    cmp byte [ebx], cl 
    je .wildcard 
    jmp .not_found 
 
    .wildcard: 
    inc esi 
    inc ebx 
    jmp .compare 
 
    .found: 
    mov eax, edi 
    popad 
    ret 
 
    .not_found: 
    pop ecx 
    inc edi 
    loop .loop 
 
    .error: 
    popad 
    xor eax, eax 
    ret 
endp 
 
 
    mov eax, 1 
    ret 
 
 
 
 
endp 
 
 
 
 
 
section '.idata' import data readable 
library kernel32, 'KERNEL32.DLL' 
 
include 'api\kernel32.inc' 
 
section '.data' data readable writeable 
hDll dd 0 
hProcess dd 0 
search_start dd 0 
search_end dd 0 
module_info dd ? |   
- 
 
 
- 
特征码.zip
 
877 Bytes, 下载次数: 31, 下载积分: 飘云币 -2 枚 
 
 
 
 
 
评分
- 
查看全部评分
 
 
 
 
 
 |