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

Disassembly:
sub esp, 0x11c
mov eax, dword [esp + 0x120]
push ebx
push ebp
push esi
mov ebp, dword [eax]
xor esi, esi
push edi
mov edx, dword [ebp + 0x17c]
mov ecx, dword [ebp + 0x184]
mov bx, word [ebp + 0x180]
cmp edx, esi
mov dword [esp + 0x18], ecx
je 0x4748f6
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0xff
jae 0x4748f6
mov al, byte [0x4bd5a4]
mov ecx, 0x3f
mov byte [esp + 0x2c], al
xor eax, eax
lea edi, [esp + 0x2d]
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [esp + 0x14], esi
stosb byte es:[edi], al
call dword [sym.imp.WSOCK32.dll_inet_addr]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4747d1
mov edx, dword [ebp + 0x17c]
lea ecx, [esp + 0x2c]
push pe_nt_image_headers32
push ecx
push edx
call fcn.0045daf0
add esp, 0xc
test eax, eax
je 0x4747d1
mov edi, dword [esp + 0x130]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x30]
push 0
push ecx
push edi
call fcn.0045dd80
add esp, 0x10
cmp eax, 1
jne 0x4747c3
lea edx, [esp + 0x10]
push edx
push edi
call fcn.00467340
add esp, 8
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4747d8
push eax
jmp 0x474864
mov edi, dword [esp + 0x130]
mov ecx, dword [ebp + 0x17c]
lea eax, [esp + 0x10]
push eax
push 0
push ecx
push edi
call fcn.0045dd80
add esp, 0x10
cmp eax, 1
jne 0x474802
lea edx, [esp + 0x10]
push edx
push edi
call fcn.00467340
add esp, 8
mov edx, dword [esp + 0x10]
test edx, edx
je 0x47486d
cmp esi, 0xffffffff
jne 0x474836
mov eax, dword [edx]
lea ecx, [esp + 0x2c]
push pe_nt_image_headers32
push ecx
mov eax, dword [eax + 0x18]
xor ecx, ecx
mov cx, word [eax]
lea edx, [eax + 4]
push edx
push ecx
call fcn.00467140
mov edx, dword [esp + 0x20]
add esp, 0x10
jmp 0x474863
mov edi, dword [ebp + 0x17c]
or ecx, 0xffffffff
xor eax, eax
lea esi, [esp + 0x2c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x14], esi
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x14]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push edx
push ebp
call fcn.0045dff0
add esp, 8
mov al, byte [esp + 0x2c]
test al, al
jne 0x47489a
mov ecx, dword [ebp + 0x17c]
push ecx
push str.Couldnt_bind_to__s
push ebp
call fcn.0045b7b0
add esp, 0xc
mov eax, 0x2d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
lea edx, [esp + 0x2c]
push edx
push str.Bind_local_address_to__s_n
push ebp
call fcn.0045b740
add esp, 0xc
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
jne 0x4748e0
lea ecx, [esp + 0x2c]
push ecx
push str.couldnt_find_my_own_IP_address___s_
push ebp
call fcn.0045b7b0
add esp, 0xc
mov eax, 0x2d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov eax, dword [esp + 0x10]
test eax, eax
je 0x474a17
mov eax, dword [eax]
mov esi, dword [eax + 0x18]
mov edi, dword [eax + 0x10]
jmp 0x474925
cmp bx, si
je 0x4749e1
xor edx, edx
mov edi, 0x10
mov dword [esp + 0x1c], edx
mov word [esp + 0x1c], 2
mov dword [esp + 0x20], edx
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], edx
lea esi, [esp + 0x1c]
mov dword [esp + 0x28], edx
cmp word [esi], 2
jne 0x474936
push ebx
call dword [sym.imp.WSOCK32.dll_htons]
mov word [esi + 2], ax
mov eax, dword [esp + 0x134]
push edi
push esi
push eax
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jge 0x474975
mov eax, dword [esp + 0x18]
dec eax
test eax, eax
mov dword [esp + 0x18], eax
jle 0x4749ee
mov ecx, ebx
and ecx, 0xffff
push ecx
push str.Bind_to_local_port__d_failed__trying_next_n
push ebp
call fcn.0045b740
add esp, 0xc
inc ebx
jmp 0x474925
mov ecx, dword [esp + 0x134]
lea edx, [esp + 0x14]
lea eax, [esp + 0x2c]
push edx
push eax
push ecx
mov dword [esp + 0x20], 0x80
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jge 0x4749b7
push str.getsockname___failed
push ebp
call fcn.0045b7b0
add esp, 8
mov eax, 0x2d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
cmp word [esp + 0x2c], 2
jne 0x4749cc
mov edx, dword [esp + 0x2e]
push edx
call dword [sym.imp.WSOCK32.dll_ntohs]
mov ebx, eax
and ebx, 0xffff
push ebx
push str.Local_port:__d_n
push ebp
call fcn.0045b740
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x11c
ret
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov dword [ebp + 0x8458], eax
push eax
mov eax, dword [esp + 0x134]
push eax
call fcn.00466420
push eax
push str.bind_failure:__s
push ebp
call fcn.0045b7b0
add esp, 0x14
pop edi
pop esi
pop ebp
mov eax, 0x2d
pop ebx
add esp, 0x11c
ret