Function at 0x5a638710
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x5a63e034]
mov ecx, dword [ebp + 0x1c]
push ebx
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
or dword [eax], 0xffffffff
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x34], ecx
xor edx, edx
xor ecx, ecx
mov dword [ebp - 0x3c], eax
mov eax, dword [esi + 0x38]
inc ecx
cmp eax, 6
push edi
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x2c], edx
jne 0x5a638768
mov ecx, dword [ebp + 0x10]
dec ecx
neg ecx
sbb ecx, ecx
and ecx, 0xfffffeff
add ecx, 0x4e9
mov dword [ebp - 0x30], ecx
push dword [ebp - 0x30]
push dword [ebp + 0x10]
push eax
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [ebp - 0x1c], ebx
je 0x5a638a1c
jmp 0x5a638787
mov ebx, dword [ebp - 0x1c]
xor eax, eax
lea edi, [ebp - 0x14]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, dword [esi + 0x38]
dec eax
dec eax
je 0x5a6387bd
sub eax, 4
jne 0x5a638930
mov ax, word [esi + 0x38]
mov word [ebp - 0x14], ax
mov ax, word [ebp + 0x14]
mov word [ebp - 8], ax
xor eax, eax
lea edi, [ebp - 0xe]
stosd dword es:[edi], eax
stosw word es:[edi], ax
jmp 0x5a638930
cmp dword [ebp + 0x10], 1
jne 0x5a63881b
push 4
lea eax, [ebp - 0x38]
push eax
push 8
push pe_overlay
push ebx
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x5a6387e0
call sub.WSOCK32.dll_WSAGetLastError
test byte [esi + 0xed], 0x80
je 0x5a638803
push 4
lea eax, [ebp - 0x38]
push eax
push 1
push 6
push ebx
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x5a638803
call sub.WSOCK32.dll_WSAGetLastError
cmp word [ebp - 0x18], 0
jne 0x5a638815
push dword [ebp - 0x20]
push ebx
call fcn.5a635330
jmp 0x5a63881b
push ebx
call fcn.5a63539d
mov eax, dword [ebp + 0x18]
xor edi, edi
cmp word [ebp - 0x18], di
mov word [ebp - 0x14], 2
mov dword [ebp - 0x10], eax
jne 0x5a638834
push dword [ebp + 0x14]
jmp 0x5a638837
push dword [ebp - 0x18]
call sub.WSOCK32.dll_htons
cmp dword [ebp + 0x20], edi
mov word [ebp - 0x12], ax
je 0x5a638930
cmp word [ebp + 0x14], di
jne 0x5a638930
cmp word [ebp - 0x18], di
jne 0x5a638930
cmp dword [ebp + 0x10], 1
mov dword [ebp - 0x24], 0x8fc
je 0x5a638871
mov dword [ebp - 0x24], 0x92e
push esi
call fcn.5a6340da
test eax, eax
je 0x5a63887f
add dword [ebp - 0x24], 0x19
mov ebx, dword [ebp - 0x24]
xor edi, edi
cmp dword [esi + 0x168], edi
je 0x5a6388cd
xor eax, eax
inc eax
cmp dword [ebp + 0x10], eax
jne 0x5a6388a1
cmp dword [esi + 0x184], edi
jne 0x5a6388cd
mov dword [ebp - 0x28], eax
jmp 0x5a6388ac
cmp dword [esi + 0x180], edi
jne 0x5a6388cd
mov dword [ebp - 0x28], edi
push ebx
push dword [ebp - 0x28]
push esi
call fcn.5a633f73
cmp eax, 0x8015f090
jne 0x5a6388c2
or edi, 0xffffffff
jmp 0x5a6388f5
cmp eax, edi
jne 0x5a6388cd
mov dword [ebp - 0x2c], 1
push ebx
call sub.WSOCK32.dll_htons
mov word [ebp - 0x12], ax
push 0x10
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x1c]
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x5a6389b8
call sub.WSOCK32.dll_WSAGetLastError
mov edi, eax
cmp dword [ebp - 0x2c], 0
je 0x5a638908
push dword [ebp - 0x28]
push esi
call fcn.5a634070
and dword [ebp - 0x2c], 0
inc ebx
cmp bx, 0x960
jbe 0x5a638915
mov ebx, 0x8fc
cmp bx, word [ebp - 0x24]
jne 0x5a638882
cmp edi, 0x271d
jne 0x5a63892d
cmp dword [ebp - 0x20], 0
jne 0x5a638959
mov ebx, dword [ebp - 0x1c]
push 0x10
lea eax, [ebp - 0x14]
push eax
push ebx
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x5a63899b
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x271d
jne 0x5a638962
cmp dword [ebp - 0x20], 0
je 0x5a638962
push ebx
call sub.WSOCK32.dll_closesocket
and dword [ebp - 0x20], 0
jmp 0x5a638a02
cmp word [ebp - 0x18], 0
je 0x5a638a28
push 0x32
pop edi
add edi, edi
cmp edi, 0x3e8
jae 0x5a638a28
call sub.WSOCK32.dll_WSAGetLastError
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x10
lea eax, [ebp - 0x14]
push eax
push ebx
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
je 0x5a638970
cmp word [ebp - 0x18], 0
je 0x5a6389bb
mov eax, dword [ebp - 0x3c]
mov dword [eax], ebx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.5a639a99
leave
ret 0x1c
mov ebx, dword [ebp - 0x1c]
cmp dword [esi + 0x38], 2
jne 0x5a6389a2
cmp dword [ebp + 0x10], 1
jne 0x5a6389a2
push dword [ebp - 0x12]
call sub.WSOCK32.dll_ntohs
test ax, ax
mov dword [ebp - 0x18], eax
jne 0x5a6389fc
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x14]
push eax
push ebx
mov dword [ebp - 0x1c], 0x10
call sub.WSOCK32.dll_getsockname
cmp eax, 0xffffffff
je 0x5a638a28
push dword [ebp - 0x12]
call sub.WSOCK32.dll_ntohs
mov dword [ebp - 0x18], eax
push ebx
call sub.WSOCK32.dll_closesocket
push dword [ebp - 0x30]
push dword [ebp + 0x10]
push dword [esi + 0x38]
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [ebp - 0x1c], eax
jne 0x5a638784
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [ebp - 0x34]
mov dword [ecx], eax
jmp 0x5a638a47
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [ebp - 0x34]
push ebx
mov dword [ecx], eax
call sub.WSOCK32.dll_closesocket
cmp dword [ebp - 0x2c], 0
je 0x5a638a47
push dword [ebp - 0x28]
push esi
call fcn.5a634070
mov eax, 0x80004005
jmp 0x5a6389a9