retn
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
list_api:
pop esi
mov ecx, esi
add ecx, 8
mov edi,ebp
fun:
call find_api
cmp esi, ecx
lea edi, [ebp+4]
jnz fun
call exec
arpl [ecx+6Ch], sp //pop 参数
arpl [esi], bp //参数
js fast_error_exit //参数 这部分实现有些问题 需要利用OD更该字符串为65 78 65 00
fast_error_exit: //同上
test eax,eax //同上
retn
lodsd
push eax //api_hash com from
push edx //dllbase_address
call check_api
mov [edi], eax
pop edx
pop eax
retn
check_api:
push ecx //
push esi
push ebp
push edi
mov ebp, [esp+14h] //esp dllbase_address
mov eax, [ebp+3Ch] //IMAGE_DOS_HEADER->e_lfanew
mov edx, [ebp+eax+78h] //IMAGE_NT_HEADERS->OptinalHeader.DataDirectory[EAT].VirtualAddress
add edx, ebp
mov ecx, [edx+18h] //funapi_num
mov ebx, [edx+20h] //IMAGE_EXPORT_DESCRIPTOR->AddressOfNames RVA
add ebx, ebp // ebx is EAT's virtual address,we’ll use it later
re_find_api:
jecxz jump_out
dec ecx
mov esi, [ebx+ecx*4]
add esi, ebp
xor edi, edi
xor eax, eax
cld
api_hash:
lodsb
test al, al
jz cmp_hash
ror edi, 0Dh
add edi, eax
jmp api_hash