Function at 0x10031370
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
mov eax, dword [0x1004e370]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 0x18]
lea ebx, [ebp - 0x14c]
push edi
mov edi, dword [ebp + 0xc]
mov eax, ebx
push 0x80
push 0
push eax
mov dword [ebp - 0x15c], 0x80
mov dword [ebp - 0x158], ebx
call sub.ntdll.dll_memset
add esp, 0xc
test edi, edi
je 0x100313c4
lea eax, [edi + 0x220]
mov dword [ebp - 0x158], eax
mov eax, dword [ebp + 0x1c]
sub eax, 1
je 0x1003143a
sub eax, 1
jne 0x100314a3
mov dword [ebp - 0x154], 0x10
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x150], eax
xorps xmm0, xmm0
mov eax, 2
movups xmmword [ebp - 0x5c], xmm0
mov word [ebp - 0x5c], ax
test esi, esi
je 0x10031428
push 0x10
lea eax, [ebp - 0x5c]
push eax
push esi
push 0
call fcn.1001ce10
add esp, 0x10
cmp eax, 0xfffffffe
jne 0x10031423
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10039446
mov esp, ebp
pop ebp
ret
cmp eax, 0xffffffff
je 0x100314a3
push dword [ebp + 0x14]
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x5a], ax
jmp 0x1003150d
lea eax, [ebp - 0xcc]
push 0x6c
mov dword [ebp - 0x150], eax
lea eax, [ebp - 0xca]
push 0
push eax
call sub.ntdll.dll_memset
add esp, 0xc
mov eax, 1
mov word [ebp - 0xcc], ax
test esi, esi
je 0x100314a3
mov ecx, esi
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10031470
sub ecx, edx
cmp ecx, 0x6c
jb 0x100314b7
push esi
push str.__s__too_long_for_UNIX_domain_socket
push str.lws_socket_bind
push 1
push edi
push 0x1001bbf0
push edi
call fcn.1001c4d0
add esp, 4
push eax
call fcn.1001dc10
add esp, 0x1c
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10039446
mov esp, ebp
pop ebp
ret
mov ecx, esi
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100314c0
sub ecx, edx
lea edx, [ebp - 0xca]
sub edx, esi
lea eax, [ecx + 2]
mov ecx, esi
mov dword [ebp - 0x154], eax
nop dword [eax]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x100314e0
cmp byte [ebp - 0xca], 0x40
jne 0x100314fe
mov byte [ebp - 0xca], al
jmp 0x1003150d
lea eax, [ebp - 0xca]
push eax
call sub.msvcrt.dll__unlink
add esp, 4
mov ebx, dword [ebp + 0x10]
cmp ebx, 0xffffffff
jne 0x10031528
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10039446
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x154]
push dword [ebp - 0x150]
push ebx
call dword [sym.imp.WS2_32.dll_bind]
mov dword [ebp - 0x150], eax
test eax, eax
jns 0x100315ea
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp dword [ebp + 0x1c], 1
jne 0x10031596
push eax
push dword [ebp - 0x150]
push esi
push ebx
push str.ERROR_on_binding_fd__d_to___s____d__d_
push str.lws_socket_bind
push 1
push edi
push 0x1001bbf0
push edi
call fcn.1001c4d0
add esp, 4
push eax
call fcn.1001dc10
add esp, 0x28
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10039446
mov esp, ebp
pop ebp
ret
mov esi, eax
push esi
push dword [ebp - 0x150]
push dword [ebp + 0x14]
push ebx
push str.ERROR_on_binding_fd__d_to_port__d___d__d_
push str.lws_socket_bind
push 1
push edi
push 0x1001bbf0
push edi
call fcn.1001c4d0
add esp, 4
push eax
call fcn.1001dc10
add esp, 0x28
xor eax, eax
cmp esi, 0x2740
setne al
pop edi
pop esi
pop ebx
lea eax, [eax*2 - 3]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10039446
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x158]
lea eax, [ebp - 0x15c]
push eax
push esi
push ebx
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, 0xffffffff
je 0x10031616
mov eax, dword [esi]
shr eax, 0x10
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
mov dword [ebp + 0x14], eax
push 0x48
lea eax, [ebp - 0x4c]
push eax
push esi
call fcn.100312e0
mov ecx, dword [ebp - 4]
add esp, 0xc
mov eax, dword [ebp + 0x14]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.10039446
mov esp, ebp
pop ebp
ret