Function at 0x65a87bb7
Capabilities:
Delete file
Generate random numbers via winapi
Get local ipv4 addresses
Get socket information
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xac
mov ebx, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
cmp word [ebx], 1
jne 0x65a87e95
lea eax, [ebp - 0x5c]
mov dword [esp + 0x10], 0xf0000040
mov dword [ebp - 0x84], 0x10
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
sub esp, 0x14
test eax, eax
jne 0x65a87c1c
mov dword [esp], 0x13
jmp 0x65a87ce1
lea eax, [ebp - 0x6c]
mov dword [esp + 4], 0x10
xor edi, edi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x5c]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
sub esp, 0xc
test eax, eax
jne 0x65a87c4f
mov dword [esp], 0x13
or edi, 0xffffffff
call sym._gpg_err_set_errno
mov eax, dword [ebp - 0x5c]
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push ecx
push ecx
test edi, edi
jne 0x65a87ce6
mov dword [ebp - 0x7c], 2
mov dword [esp], 0x7f000001
call dword [sym.imp.WS2_32.dll_htonl]
push edx
mov dword [ebp - 0x78], eax
lea eax, [ebx + 8]
mov dword [ebp - 0x90], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40000000
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x8c], eax
sub esp, 0x1c
inc eax
jne 0x65a87cee
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
jne 0x65a87ce6
mov dword [esp], 0x64
call sym._gpg_err_set_errno
or ebx, 0xffffffff
jmp 0x65a87ec8
mov eax, dword [ebp - 0x84]
lea edi, [ebp - 0x7c]
mov dword [esp], esi
mov dword [esp + 4], edi
mov dword [esp + 8], eax
call dword [sym.imp.WS2_32.dll_bind]
sub esp, 0xc
mov ebx, eax
test eax, eax
jne 0x65a87d31
lea eax, [ebp - 0x84]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov dword [esp], esi
call dword [sym.imp.WS2_32.dll_getsockname]
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x65a87d61
call dword [sym.imp.msvcrt.dll__errno]
mov esi, dword [eax]
mov eax, dword [ebp - 0x8c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x90]
push ecx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push edi
mov dword [esp], esi
jmp 0x65a87ec3
mov eax, esi
call dbg.is_cygwin_fd
test eax, eax
movzx eax, word [ebp - 0x7a]
je 0x65a87ddd
mov edx, dword [ebp - 0x64]
mov ecx, dword [ebp - 0x60]
mov dword [esp], eax
mov edi, dword [ebp - 0x68]
mov esi, dword [ebp - 0x6c]
mov dword [ebp - 0x94], edx
mov dword [ebp - 0x98], ecx
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, dword [ebp - 0x98]
push edx
mov edx, dword [ebp - 0x94]
movzx eax, ax
mov dword [esp + 0x14], edi
lea edi, [ebp - 0x5c]
mov dword [esp + 0x1c], ecx
mov dword [esp], edi
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.__socket___d_s__08x__08x__08x__08x
mov dword [esp + 4], 0x42
call dbg.snprintf
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, ecx
not eax
jmp 0x65a87e27
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_ntohs]
push esi
movzx eax, ax
lea esi, [ebp - 0x5c]
mov edi, esi
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x65a8d5e9
mov dword [esp + 4], 0x32
call dbg.snprintf
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, ecx
mov ecx, 4
not eax
lea edi, [esi + eax - 1]
lea esi, [ebp - 0x6c]
add eax, 0xf
rep movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x84], eax
lea eax, [ebp - 0x80]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x84]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x5c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x8c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x8c]
sub esp, 0x14
test eax, eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp], edx
jne 0x65a87e90
call eax
mov eax, dword [ebp - 0x90]
push edx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push ecx
mov dword [esp], 5
jmp 0x65a87ce1
call eax
push eax
jmp 0x65a87ec8
mov eax, dword [ebp + 0x14]
mov dword [esp + 4], ebx
mov dword [esp], esi
mov dword [esp + 8], eax
call dword [sym.imp.WS2_32.dll_bind]
sub esp, 0xc
mov ebx, eax
test eax, eax
jns 0x65a87ec8
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp], eax
call dbg._assuan_sock_wsa2errno
mov dword [esp], eax
call sym._gpg_err_set_errno
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret