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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x4f7f44]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [eax]
push esi
mov dword [ebp - 0x21c], eax
xor eax, eax
mov dword [ebp - 0x210], eax
mov esi, dword [ebx + 0x95c]
mov ecx, dword [ebx + 0x5f4]
push edi
movzx edi, word [ebx + 0x5f0]
mov dword [ebp - 0x208], eax
mov dword [ebp - 0x214], edi
mov dword [ebp - 0x218], ecx
cmp esi, eax
jne 0x4761cb
cmp di, ax
je 0x476644
push 0x80
push eax
lea edx, [ebp - 0x184]
push edx
call fcn.004a8b80
add esp, 0xc
test esi, esi
je 0x4765c7
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4761f0
sub eax, edx
cmp eax, 0xff
jae 0x4765c7
push 0xff
lea eax, [ebp - 0x103]
push 0
push eax
mov byte [ebp - 0x104], cl
call fcn.004a8b80
mov edx, dword [0x4f7d44]
mov eax, edx
add esp, 0xc
mov dword [ebp - 0x20c], 0
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x476235
sub eax, edi
push eax
push esi
push edx
call fcn.004ad83d
add esp, 0xc
test eax, eax
jne 0x4762c6
mov eax, dword [0x4f7d44]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x476255
sub eax, edx
add esi, eax
mov dword [ebp - 0x20c], 1
mov edi, dword [ebp - 0x21c]
mov edx, dword [edi + 0x8c]
mov eax, dword [ebp + 0x14]
push 0x100
lea ecx, [ebp - 0x104]
push ecx
mov ecx, dword [ebp + 0x10]
push esi
push edx
push eax
push ecx
call fcn.0047bd40
add esp, 0x18
sub eax, 0
je 0x47631a
dec eax
je 0x476304
dec eax
jne 0x476337
mov edi, dword [ebp + 0x10]
push edi
lea edx, [ebp - 0x104]
push edx
push esi
push str.Local_Interface__s_is_ip__s_using_address_family__i_n
push ebx
call fcn.0046f260
add esp, 0x14
jmp 0x476401
mov edx, dword [str.host_]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4762d1
sub eax, edi
push eax
push esi
push edx
call fcn.004ad83d
add esp, 0xc
test eax, eax
jne 0x47626a
mov eax, dword [str.host_]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4762f1
mov edi, dword [ebp - 0x21c]
sub eax, edx
add esi, eax
jmp 0x476344
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a79cb
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x20c], 0
je 0x476344
push esi
push str.Couldnt_bind_to_interface__s
push ebx
call fcn.0046f330
add esp, 0xc
jmp 0x476687
cmp dword [ebp - 0x20c], 0
jne 0x4765ac
mov eax, dword [edi + 0x2d0]
mov dword [ebp - 0x20c], eax
mov eax, dword [ebp + 0x10]
cmp eax, 2
jne 0x476364
mov dword [edi + 0x2d0], 1
jmp 0x476373
cmp eax, 0x17
jne 0x476373
mov dword [edi + 0x2d0], 2
lea ecx, [ebp - 0x210]
push ecx
push 0
push 0
push esi
push edi
call fcn.00491ce0
add esp, 0x14
cmp eax, 1
jne 0x47639d
lea edx, [ebp - 0x210]
push edx
push edi
call fcn.00471e40
add esp, 8
mov eax, dword [ebp - 0x20c]
mov dword [edi + 0x2d0], eax
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x4765ac
mov edx, dword [eax]
push 0x100
lea ecx, [ebp - 0x104]
push ecx
push edx
call fcn.00491170
mov eax, dword [ebp - 0x210]
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
mov ecx, dword [ebp + 0x10]
push edx
lea eax, [ebp - 0x104]
push eax
push ecx
push esi
push str.Name__s_family__i_resolved_to__s_family__i_n
push ebx
call fcn.0046f260
mov edx, dword [ebp - 0x210]
push edx
push ebx
call fcn.00491f00
mov edi, dword [ebp + 0x10]
add esp, 0x2c
cmp edi, 0x17
jne 0x476558
lea eax, [ebp - 0x104]
push 0x25
push eax
call fcn.004ac2e0
mov esi, eax
add esp, 8
test esi, esi
je 0x476425
mov byte [esi], 0
inc esi
lea ecx, [ebp - 0x17c]
push ecx
lea edx, [ebp - 0x104]
push edx
push 0x17
call fcn.00499620
add esp, 0xc
test eax, eax
jle 0x476474
mov ecx, dword [ebp - 0x214]
mov eax, 0x17
push ecx
mov word [ebp - 0x184], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
test esi, esi
je 0x476474
push esi
call fcn.004ae19b
add esp, 4
mov dword [ebp - 0x16c], eax
mov dword [ebp - 0x208], 0x1c
mov edi, dword [ebp - 0x214]
mov edx, dword [ebp - 0x208]
mov esi, dword [ebp + 0xc]
push edx
lea eax, [ebp - 0x184]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x4764ef
mov eax, dword [ebp - 0x218]
dec eax
mov dword [ebp - 0x218], eax
test eax, eax
jle 0x476657
movzx ecx, di
push ecx
push str.Bind_to_local_port__hu_failed__trying_next_n
push ebx
call fcn.0046f260
add esp, 0xc
inc edi
push edi
call dword [sym.imp.WS2_32.dll_ntohs]
mov edx, dword [ebp - 0x208]
mov word [ebp - 0x182], ax
push edx
lea eax, [ebp - 0x184]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x4764a0
push 0x80
lea ecx, [ebp - 0x204]
push 0
push ecx
mov dword [ebp - 0x218], 0x80
call fcn.004a8b80
add esp, 0xc
lea edx, [ebp - 0x218]
push edx
lea eax, [ebp - 0x204]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x476622
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push 0x80
lea ecx, [ebp - 0x84]
mov esi, eax
push ecx
push esi
mov dword [ebx + 0xcbc], esi
call fcn.0049b060
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x47667e
cmp edi, 2
jne 0x47647e
lea edx, [ebp - 0x180]
push edx
lea eax, [ebp - 0x104]
push eax
push edi
call fcn.00499620
add esp, 0xc
test eax, eax
jle 0x47647e
mov edx, dword [ebp - 0x214]
mov ecx, edi
push edx
mov word [ebp - 0x184], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x208], 0x10
jmp 0x47647e
and dword [ebx + 0xf84], 0xfffffff7
push esi
push str.Couldnt_bind_to__s
push ebx
call fcn.0046f330
add esp, 0xc
jmp 0x476687
mov eax, dword [ebp + 0x10]
cmp eax, 0x17
jne 0x4765f3
push edi
mov word [ebp - 0x184], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x208], 0x1c
jmp 0x476484
cmp eax, 2
jne 0x476484
mov ecx, eax
push edi
mov word [ebp - 0x184], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x182], ax
mov dword [ebp - 0x208], 0x10
jmp 0x476484
movzx edx, di
push edx
push str.Local_port:__hu_n
push ebx
call fcn.0046f260
mov eax, dword [ebp - 0x21c]
add esp, 0xc
or dword [eax + 0x2a4], 0x1000000
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a79cb
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push 0x80
lea eax, [ebp - 0x84]
push eax
push esi
mov dword [ebx + 0xcbc], esi
call fcn.0049b060
push eax
push esi
push str.bind_failed_with_errno__d:__s
push ebx
call fcn.0046f330
add esp, 0x1c
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 0x2d
pop ebx
call fcn.004a79cb
mov esp, ebp
pop ebp
ret