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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x19c
mov eax, dword [0x51d56c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [eax]
mov dword [ebp - 0x188], eax
xor eax, eax
mov dword [ebp - 0x194], eax
movzx ebx, word [edi + 0x180]
mov esi, dword [edi + 0x3b4]
mov ecx, dword [edi + 0x184]
mov dword [ebp - 0x18c], edi
mov dword [ebp - 0x190], eax
mov dword [ebp - 0x19c], ebx
mov dword [ebp - 0x198], ecx
cmp esi, eax
jne 0x40dcf1
cmp bx, ax
je 0x40e055
push 0x80
push eax
lea edx, [ebp - 0x184]
push edx
call fcn.004abb90
add esp, 0xc
test esi, esi
je 0x40e012
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40dd13
sub eax, edx
cmp eax, 0xff
jae 0x40e012
push 0xff
lea eax, [ebp - 0x103]
push 0
push eax
mov byte [ebp - 0x104], cl
call fcn.004abb90
mov edx, dword [0x51504c]
mov eax, edx
add esp, 0xc
xor ebx, ebx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40dd50
sub eax, edi
push eax
push esi
push edx
call fcn.004ac7b0
add esp, 0xc
test eax, eax
jne 0x40df7d
mov eax, dword [0x51504c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40dd74
sub eax, edx
add esi, eax
mov ebx, 1
mov edx, dword [ebp - 0x188]
mov eax, dword [edx + 0x88]
mov edx, dword [ebp + 0x10]
push 0x100
lea ecx, [ebp - 0x104]
push ecx
mov ecx, dword [ebp + 0x14]
push esi
push eax
push ecx
push edx
call fcn.00404780
add esp, 0x18
sub eax, 0
je 0x40dfd6
dec eax
je 0x40dfc0
dec eax
je 0x40de51
test ebx, ebx
jne 0x40dff8
cmp dword [ebp + 0x10], 2
mov ecx, dword [ebp - 0x188]
mov edi, dword [ecx + 0x2c0]
mov ebx, ecx
jne 0x40ddeb
mov dword [ebx + 0x2c0], 1
lea edx, [ebp - 0x194]
push edx
push 0
push esi
push ebx
call fcn.00404b90
add esp, 0x10
cmp eax, 1
jne 0x40de13
lea eax, [ebp - 0x194]
push eax
push ebx
call fcn.00403700
add esp, 8
mov eax, dword [ebp - 0x194]
mov dword [ebx + 0x2c0], edi
test eax, eax
je 0x40dff8
mov edx, dword [eax]
push 0x100
lea ecx, [ebp - 0x104]
push ecx
push edx
call fcn.00404840
mov eax, dword [ebp - 0x194]
mov ecx, dword [ebp - 0x18c]
push eax
push ecx
call fcn.00405060
add esp, 0x14
cmp dword [ebp + 0x10], 2
jne 0x40de9d
lea edx, [ebp - 0x180]
push edx
lea eax, [ebp - 0x104]
push eax
push 2
call fcn.00410800
add esp, 0xc
test eax, eax
jle 0x40de9d
mov edx, dword [ebp - 0x19c]
mov ecx, 2
push edx
mov word [ebp - 0x184], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x190], 0x10
mov ebx, dword [ebp - 0x19c]
mov edi, dword [ebp - 0x18c]
mov edx, dword [ebp - 0x190]
mov ecx, dword [ebp + 0xc]
mov esi, dword [sym.imp.WS2_32.dll_bind]
push edx
lea eax, [ebp - 0x184]
push eax
push ecx
call esi
test eax, eax
jns 0x40df16
jmp 0x40ded0
mov eax, dword [ebp - 0x198]
dec eax
mov dword [ebp - 0x198], eax
test eax, eax
jle 0x40e068
inc ebx
cmp word [ebp - 0x184], 2
jne 0x40defe
push ebx
call dword [sym.imp.WS2_32.dll_ntohs]
mov word [ebp - 0x182], ax
mov edx, dword [ebp - 0x190]
mov ecx, dword [ebp + 0xc]
push edx
lea eax, [ebp - 0x184]
push eax
push ecx
call esi
test eax, eax
js 0x40ded0
push 0x80
lea edx, [ebp - 0x84]
push 0
push edx
mov dword [ebp - 0x198], 0x80
call fcn.004abb90
mov edx, dword [ebp + 0xc]
add esp, 0xc
lea eax, [ebp - 0x198]
push eax
lea ecx, [ebp - 0x84]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x40e045
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
mov eax, dword [ebp - 0x188]
push esi
push eax
mov dword [edi + 0x8650], esi
call fcn.0041b610
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x40e08a
mov edx, dword [str.host_]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40df88
sub eax, edi
push eax
push esi
push edx
call fcn.004ac7b0
add esp, 0xc
test eax, eax
jne 0x40dd84
mov eax, dword [str.host_]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40dfb0
sub eax, edx
add esi, eax
jmp 0x40ddcd
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ab15e
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x40ddcd
mov eax, dword [ebp - 0x18c]
push esi
push str.Couldnt_bind_to_interface__s
push eax
call fcn.0040d530
add esp, 0xc
jmp 0x40e093
mov eax, dword [ebp - 0x18c]
push esi
push str.Couldnt_bind_to__s
push eax
call fcn.0040d530
add esp, 0xc
jmp 0x40e093
cmp dword [ebp + 0x10], 2
jne 0x40dea9
mov ecx, 2
push ebx
mov word [ebp - 0x184], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x190], 0x10
jmp 0x40dea9
mov ecx, dword [ebp - 0x188]
mov dword [ecx + 0x290], 1
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ab15e
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [ebp - 0x188]
mov esi, eax
push esi
push edx
mov dword [edi + 0x8650], esi
call fcn.0041b610
push eax
push esi
push str.bind_failed_with_errno__d:__s
push edi
call fcn.0040d530
add esp, 0x18
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 0x2d
pop ebx
call fcn.004ab15e
mov esp, ebp
pop ebp
ret