Function at 0x65a87cb3
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 0x65a87f91
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x84], 0x10
mov dword [esp + 0x10], 0xf0000040
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 0x65a87d18
mov dword [esp], 0x13
jmp 0x65a87ddd
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 0x65a87d4b
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]
test edi, edi
push ecx
push ecx
jne 0x65a87de2
mov dword [ebp - 0x7c], 2
mov dword [esp], 0x7f000001
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [ebp - 0x78], eax
push edx
lea eax, [ebx + 8]
mov dword [esp + 0x18], 0
mov dword [ebp - 0x90], eax
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]
sub esp, 0x1c
mov dword [ebp - 0x8c], eax
inc eax
jne 0x65a87dea
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
jne 0x65a87de2
mov dword [esp], 0x64
call sym._gpg_err_set_errno
or ebx, 0xffffffff
jmp 0x65a87fc4
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
test eax, eax
mov ebx, eax
jne 0x65a87e2d
lea eax, [ebp - 0x84]
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [esp + 8], eax
call dword [sym.imp.WS2_32.dll_getsockname]
sub esp, 0xc
test eax, eax
mov ebx, eax
je 0x65a87e5d
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 0x65a87fbf
mov eax, esi
call dbg.is_cygwin_fd
test eax, eax
movzx eax, word [ebp - 0x7a]
je 0x65a87ed9
mov edx, dword [ebp - 0x64]
mov ecx, dword [ebp - 0x60]
mov edi, dword [ebp - 0x68]
mov esi, dword [ebp - 0x6c]
mov dword [esp], eax
mov dword [ebp - 0x94], edx
mov dword [ebp - 0x98], ecx
call dword [sym.imp.WS2_32.dll_ntohs]
push edx
mov ecx, dword [ebp - 0x98]
movzx eax, ax
mov edx, dword [ebp - 0x94]
mov dword [esp + 0x14], edi
lea edi, [ebp - 0x5c]
mov dword [esp + 0x10], esi
mov dword [esp + 0x1c], ecx
mov dword [esp + 0xc], eax
mov dword [esp], edi
mov dword [esp + 0x18], edx
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 0x65a87f23
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_ntohs]
push esi
lea esi, [ebp - 0x5c]
movzx eax, ax
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov edi, esi
mov dword [esp + 8], 0x65a8d5c9
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 + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x84]
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 0x65a87f8c
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 0x65a87ddd
call eax
push eax
jmp 0x65a87fc4
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
test eax, eax
mov ebx, eax
jns 0x65a87fc4
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