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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x180
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor esi, esi
mov dword [ebp - 4], 0xffffffff
xor edi, edi
sub eax, 1
je 0x4af35c
sub eax, 1
je 0x4af352
push 0x6e7a80
push 0x800007fa
push str.C:_buildworker_steam_rel_client_win32_build_srccommon_net.cpp
call fcn.0053aea0
add esp, 0xc
test al, al
jne 0x4af364
int3
mov esi, 2
lea edi, [esi + 0xf]
jmp 0x4af364
mov esi, 1
lea edi, [esi + 5]
mov ecx, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
mov eax, dword [ecx]
mov dword [ebp - 0x4c], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0x48], eax
mov eax, dword [ecx + 8]
mov dword [ebp - 0x44], eax
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0x40], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0x3c], eax
mov eax, dword [ecx + 0x14]
mov cl, byte [ebp + 0x18]
mov dword [ebp - 0x38], eax
test cl, cl
je 0x4af3ea
test ebx, 0x800
je 0x4af3ea
lea ecx, [ebp - 0x4c]
call fcn.004c2e70
test al, al
jne 0x4af3da
mov eax, 4
mov dword [ebp - 0x3c], 0
mov word [ebp - 0x38], ax
mov eax, dword [0x6f8478]
mov dword [ebp - 0x4c], eax
mov eax, dword [0x6f847c]
mov dword [ebp - 0x48], eax
mov eax, dword [0x6f8480]
mov dword [ebp - 0x44], eax
mov eax, dword [0x6f8484]
mov dword [ebp - 0x40], eax
jmp 0x4af3e7
cmp word [ebp - 0x38], 3
jne 0x4af3e7
and ebx, 0xfffff7ff
mov cl, byte [ebp + 0x18]
mov eax, ebx
mov edx, 2
and eax, 0x800
mov dword [ebp + 0x10], eax
je 0x4af488
mov edx, 0x17
lea eax, [ebp - 4]
push eax
push 1
push edi
push esi
push edx
call fcn.004e1320
mov esi, eax
add esp, 0x14
test esi, esi
je 0x4af4df
push esi
call fcn.004eb820
and dword [ebp - 0x30], 0xff0fffff
push esi
mov byte [ebp - 0x2d], 0
and dword [ebp - 0x30], 0xfff00000
xor ecx, ecx
push eax
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], ecx
push str.CreateBoundSocket:_failed_to_create_socket__error__s___d__n
lea eax, [ebp - 0x34]
mov dword [ebp - 0x18], 3
push eax
push 1
push 2
push 1
push 0xb
push 0
push 0
mov dword [ebp - 0x34], 0
call fcn.00451380
add esp, 0x2c
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test cl, cl
je 0x4af404
mov eax, 4
cmp ax, word [ebp - 0x38]
jne 0x4af404
push 0
push 0x30
lea eax, [ebp - 0x34]
push eax
lea ecx, [ebp - 0x4c]
call fcn.004c3980
lea ecx, [ebp - 0x80]
call fcn.004582e0
lea ecx, [ebp - 0x34]
push ecx
push str.CreateBoundSocket:_asked_to_bind_to_local_v6_address___s___but_k_uNetFlagAllowIPv6_was_not_specified__n
push eax
push 1
push 2
push 1
push 0xb
push 0
push 0
call fcn.00451380
add esp, 0x24
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0x10], 0
mov ecx, dword [sym.imp.WS2_32.dll_setsockopt]
je 0x4af507
push 4
lea eax, [ebp + 0x10]
mov dword [ebp + 0x10], 0
push eax
push 0x1b
push 0x29
push dword [ebp - 4]
call ecx
mov ecx, dword [sym.imp.WS2_32.dll_setsockopt]
cmp byte [ebp + 0x18], 0
je 0x4af763
mov edi, dword [ebp + 0x14]
mov byte [ebp + 0x1b], 0
test edi, edi
je 0x4af53f
mov eax, dword [ebp - 0x4c]
mov dword [edi], eax
mov eax, dword [ebp - 0x48]
mov dword [edi + 4], eax
mov eax, dword [ebp - 0x44]
mov dword [edi + 8], eax
mov eax, dword [ebp - 0x40]
mov dword [edi + 0xc], eax
mov eax, dword [ebp - 0x3c]
mov dword [edi + 0x10], eax
mov eax, dword [ebp - 0x38]
mov dword [edi + 0x14], eax
test ebx, 0x400
je 0x4af560
push 4
lea eax, [ebp + 0x10]
mov dword [ebp + 0x10], 1
push eax
push 4
push 0xffff
push dword [ebp - 4]
call ecx
movzx eax, word [ebp - 0x36]
movzx edx, ax
mov dword [ebp - 0x50], eax
lea eax, [edx + 1]
movzx edi, ax
mov dword [ebp + 0x10], edi
test dx, dx
je 0x4af596
test bl, 2
je 0x4af596
lea eax, [edx + 0x190]
mov esi, 0xffff
cmp eax, esi
movzx ecx, ax
cmova ecx, esi
movzx edi, cx
mov dword [ebp + 0x10], edi
mov eax, edx
mov esi, edx
cmp ax, di
jae 0x4af5e9
nop
push 0x80
lea eax, [ebp - 0x100]
mov word [ebp - 0x36], si
push eax
lea ecx, [ebp - 0x4c]
call fcn.004c36c0
push eax
lea eax, [ebp - 0x100]
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x4af6bc
call sub.WS2_32.dll_WSAGetLastError
mov edi, eax
cmp edi, 0x2740
jne 0x4af649
mov edi, dword [ebp + 0x10]
inc esi
cmp si, di
jb 0x4af5a0
mov al, byte [ebp + 0x1b]
xor ecx, ecx
cmp cx, si
je 0x4af763
test al, al
jne 0x4af763
push dword [ebp - 4]
call fcn.004e1300
and dword [ebp - 0x30], 0xff0fffff
xor eax, eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov byte [ebp - 0x2d], 0
and dword [ebp - 0x30], 0xfff00000
movzx eax, di
dec eax
push eax
mov eax, dword [ebp - 0x50]
movzx eax, ax
push eax
push str.CreateBoundSocket:_::bind_couldnt_find_an_open_port_between__u_and__u_n
jmp 0x4af458
push edi
call fcn.004eb820
and dword [ebp - 0x30], 0xff0fffff
xor ecx, ecx
push edi
push eax
movzx eax, si
push eax
push str.CreateBoundSocket:_::bind_to_port__d_returned_error__s__d__n
lea eax, [ebp - 0x34]
mov byte [ebp - 0x2d], 0
and dword [ebp - 0x30], 0xfff00000
push eax
push 1
push 2
push 1
push 0xb
push ecx
push ecx
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], 3
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], ecx
call fcn.00451380
push dword [ebp - 4]
call fcn.004e1300
add esp, 0x34
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x14]
mov al, 1
mov byte [ebp + 0x1b], al
test edi, edi
je 0x4af75b
xor eax, eax
mov dword [ebp - 8], 3
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp - 0x180]
mov dword [ebp + 0xc], 0x80
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x4af729
lea eax, [ebp - 6]
push eax
push dword [ebp + 0xc]
lea eax, [ebp - 0x180]
push eax
lea ecx, [ebp - 0x1c]
call fcn.004c3190
mov ax, word [ebp - 6]
mov word [edi + 0x16], ax
mov edi, dword [ebp + 0x10]
jmp 0x4af5e9
call sub.WS2_32.dll_WSAGetLastError
push eax
push str.getsockname_failed_in_BGetBoundAddr_with_error:__d
push 0x6b3
push str.C:_buildworker_steam_rel_client_win32_build_srccommon_net.cpp
call fcn.0053aeb0
add esp, 0x10
test al, al
jne 0x4af74b
int3
mov ax, word [ebp - 6]
mov word [edi + 0x16], ax
mov edi, dword [ebp + 0x10]
jmp 0x4af5e9
mov edi, dword [ebp + 0x10]
jmp 0x4af5ec
and ebx, 1
jne 0x4af782
cmp dword [ebp + 8], 2
mov ecx, 0x7e2668
sete al
movzx eax, al
push eax
push 1
push dword [ebp - 4]
call fcn.004e51a0
mov edi, dword [ebp - 4]
lea eax, [ebp + 0x10]
push eax
push 0x8004667e
push edi
mov dword [ebp + 0x10], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x4af7c5
call sub.WS2_32.dll_WSAGetLastError
test eax, eax
je 0x4af7c5
push str.iSetNonBlockResult__0
push 0x8c0
push str.C:_buildworker_steam_rel_client_win32_build_srccommon_net.cpp
call fcn.0053aea0
add esp, 0xc
test al, al
jne 0x4af7c5
int3
mov eax, dword [0x7dfefc]
xor esi, esi
mov dword [ebp + 0x18], 0x40000
sub eax, esi
je 0x4af801
sub eax, 1
je 0x4af7fa
push 0x6e7a80
push 0x8e2
push str.C:_buildworker_steam_rel_client_win32_build_srccommon_net.cpp
call fcn.0053aea0
add esp, 0xc
test al, al
jne 0x4af801
int3
mov dword [ebp + 0x18], 0x100000
test ebx, ebx
jne 0x4af819
call fcn.004e5250
test al, al
je 0x4af814
cmp dword [ebp + 8], 2
je 0x4af819
mov dword [ebp + 0x18], esi
jmp 0x4af81e
cmp dword [ebp + 0x18], esi
jne 0x4af844
mov ebx, dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [ebp + 0x18]
push 4
push eax
push 0x1001
push 0xffff
push edi
call ebx
test eax, eax
je 0x4af84a
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
jmp 0x4af84a
mov ebx, dword [sym.imp.WS2_32.dll_setsockopt]
cmp dword [ebp + 8], 1
jne 0x4af8bf
push 0
push 0
lea eax, [ebp + 8]
mov dword [ebp - 0x10], 1
push eax
push 0
push 0
push 0xc
lea eax, [ebp - 0x10]
mov dword [ebp - 8], 0x3e8
push eax
push 0x98000004
push edi
mov dword [ebp - 0xc], 0xea60
mov dword [ebp + 8], 0
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x4af899
test esi, esi
jne 0x4af899
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
push 4
lea eax, [ebp + 0x10]
mov dword [ebp + 0x10], 1
push eax
push 8
push 0xffff
push edi
call ebx
test eax, eax
je 0x4af8bf
test esi, esi
jne 0x4af8c3
call sub.WS2_32.dll_WSAGetLastError
mov esi, eax
test esi, esi
je 0x4af8e0
push esi
push str.Unable_to_set_default_socket_options__error__d
push 0x898
push str.C:_buildworker_steam_rel_client_win32_build_srccommon_net.cpp
call fcn.0053aeb0
add esp, 0x10
test al, al
jne 0x4af8e0
int3
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret