Function at 0x46bd80
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 0x46bf76
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0xff
jae 0x46bf76
mov al, byte [0x4af4d4]
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 0x46be51
mov edx, dword [ebp + 0x17c]
lea ecx, [esp + 0x2c]
push 0x100
push ecx
push edx
call fcn.00455140
add esp, 0xc
test eax, eax
je 0x46be51
mov edi, dword [esp + 0x130]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x30]
push 0
push ecx
push edi
call fcn.004553d0
add esp, 0x10
cmp eax, 1
jne 0x46be43
lea edx, [esp + 0x10]
push edx
push edi
call fcn.0045e980
add esp, 8
mov eax, dword [esp + 0x10]
test eax, eax
je 0x46be58
push eax
jmp 0x46bee4
mov edi, dword [esp + 0x130]
mov ecx, dword [ebp + 0x17c]
lea eax, [esp + 0x10]
push eax
push 0
push ecx
push edi
call fcn.004553d0
add esp, 0x10
cmp eax, 1
jne 0x46be82
lea edx, [esp + 0x10]
push edx
push edi
call fcn.0045e980
add esp, 8
mov edx, dword [esp + 0x10]
test edx, edx
je 0x46beed
cmp esi, 0xffffffff
jne 0x46beb6
mov eax, dword [edx]
lea ecx, [esp + 0x2c]
push 0x100
push ecx
mov eax, dword [eax + 0x18]
xor ecx, ecx
mov cx, word [eax]
lea edx, [eax + 4]
push edx
push ecx
call fcn.0045e780
mov edx, dword [esp + 0x20]
add esp, 0x10
jmp 0x46bee3
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.00455640
add esp, 8
mov al, byte [esp + 0x2c]
test al, al
jne 0x46bf1a
mov ecx, dword [ebp + 0x17c]
push ecx
push str.Couldnt_bind_to__s
push ebp
call fcn.00452e00
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.00452d90
add esp, 0xc
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.WSOCK32.dll_inet_addr]
cmp eax, 0xffffffff
jne 0x46bf60
lea ecx, [esp + 0x2c]
push ecx
push str.couldnt_find_my_own_IP_address___s_
push ebp
call fcn.00452e00
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 0x46c097
mov eax, dword [eax]
mov esi, dword [eax + 0x18]
mov edi, dword [eax + 0x10]
jmp 0x46bfa5
cmp bx, si
je 0x46c061
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 0x46bfb6
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 0x46bff5
mov eax, dword [esp + 0x18]
dec eax
test eax, eax
mov dword [esp + 0x18], eax
jle 0x46c06e
mov ecx, ebx
and ecx, 0xffff
push ecx
push str.Bind_to_local_port__d_failed__trying_next_n
push ebp
call fcn.00452d90
add esp, 0xc
inc ebx
jmp 0x46bfa5
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 0x46c037
push str.getsockname___failed
push ebp
call fcn.00452e00
add esp, 8
mov eax, 0x2d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
cmp word [esp + 0x2c], 2
jne 0x46c04c
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.00452d90
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.0045da60
push eax
push str.bind_failure:__s
push ebp
call fcn.00452e00
add esp, 0x14
pop edi
pop esi
pop ebp
mov eax, 0x2d
pop ebx
add esp, 0x11c
ret