Function at 0x412350
Capabilities:
Create tcp socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
sub esp, 0x24
mov eax, dword [0x65ada4]
xor eax, esp
mov dword [esp + 0x20], eax
push ebp
mov ebp, dword [esp + 0x34]
push esi
mov esi, dword [esp + 0x30]
push 6
push 1
push 2
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], ebp
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [ebp], eax
jg 0x4123a1
push 0x725
call fcn.004073f0
add esp, 4
pop esi
pop ebp
mov ecx, dword [esp + 0x20]
xor ecx, esp
call fcn.00586584
add esp, 0x24
ret
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov eax, 2
mov word [esp + 0x18], ax
mov eax, dword [0x622e84]
push ebx
mov dword [esp + 0x20], 0
cmp eax, 0xffffffff
jne 0x41246a
call fcn.0056c2e0
push eax
call dword [sym.imp.MSVCR90.dll_srand]
push str.DYNSEARCHPORTS
call fcn.0056c440
add esp, 8
test eax, eax
je 0x412456
mov edx, 0x5a8ea0
mov ecx, eax
mov bl, byte [ecx]
cmp bl, byte [edx]
jne 0x412418
test bl, bl
je 0x412414
mov bl, byte [ecx + 1]
cmp bl, byte [edx + 1]
jne 0x412418
add ecx, 2
add edx, 2
test bl, bl
jne 0x4123f8
xor ecx, ecx
jmp 0x41241d
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
je 0x41244f
mov ecx, 0x5a8e9c
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x412446
test dl, dl
je 0x412442
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x412446
add eax, 2
add ecx, 2
test dl, dl
jne 0x412426
xor eax, eax
jmp 0x41244b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x412456
mov eax, 1
jmp 0x412465
call fcn.00405920
mov ecx, 0x2000
cmp ecx, eax
sbb eax, eax
inc eax
mov dword [0x622e84], eax
mov ecx, dword [0x622e80]
cmp ecx, 0xffffffff
jne 0x412501
push str.LOCALLOOPBACK
call fcn.0056c440
add esp, 4
test eax, eax
je 0x4124f5
mov edx, 0x5a8edc
mov ecx, eax
mov bl, byte [ecx]
cmp bl, byte [edx]
jne 0x4124b1
test bl, bl
je 0x4124ad
mov bl, byte [ecx + 1]
cmp bl, byte [edx + 1]
jne 0x4124b1
add ecx, 2
add edx, 2
test bl, bl
jne 0x412491
xor ecx, ecx
jmp 0x4124b6
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
je 0x4124e9
mov ecx, 0x5a8c1c
nop
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4124e0
test dl, dl
je 0x4124dc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4124e0
add eax, 2
add ecx, 2
test dl, dl
jne 0x4124c0
xor eax, eax
jmp 0x4124e5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4124f5
mov dword [0x622e80], 0
jmp 0x412505
mov dword [0x622e80], 1
jmp 0x41252c
test ecx, ecx
jne 0x412531
lea ebx, [esp + 0xc]
mov ecx, 2
xor edx, edx
call fcn.00411910
mov eax, dword [esp + 0xc]
movsx edx, byte [eax + 4]
push edx
push eax
lea eax, [esp + 0x28]
push eax
call sub.MSVCR90.dll_memcpy
add esp, 0xc
mov eax, dword [0x622e84]
push edi
test eax, eax
jne 0x41255c
cmp dword [esi], eax
jne 0x41255c
call dword [sym.imp.MSVCR90.dll_rand]
cdq
mov ecx, 0x7530
idiv ecx
mov ebx, dword [esp + 0x18]
mov esi, 0x3e8
add edx, 0x4e20
movzx edi, dx
jmp 0x412572
movzx edi, word [esi]
mov esi, dword [esp + 0x3c]
mov ebx, dword [esp + 0x18]
sub esi, dword [ebx]
inc esi
test esi, esi
jle 0x4126a7
push edi
call sub.WSOCK32.dll_htons
push 0x10
lea edx, [esp + 0x24]
mov word [esp + 0x26], ax
mov eax, dword [ebp]
push edx
push eax
call sub.WSOCK32.dll_bind
test eax, eax
jge 0x4125b0
inc edi
cmp dword [ebx], 0
jne 0x4125a6
mov ecx, 0xc350
cmp di, cx
jne 0x4125a6
mov edi, 0x4e20
dec esi
test esi, esi
jg 0x412572
jmp 0x4126a5
mov eax, dword [0x622e88]
cmp eax, 0xffffffff
jne 0x4125fb
push str.SOMAXCONN
call fcn.0056c440
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4125ed
mov ebp, dword [sym.imp.MSVCR90.dll_atoi]
push ebx
call ebp
add esp, 4
test eax, eax
jle 0x4125e9
push ebx
call ebp
mov ebp, dword [esp + 0x20]
add esp, 4
jmp 0x4125f2
mov ebp, dword [esp + 0x1c]
mov eax, 0x20
mov ebx, dword [esp + 0x18]
mov dword [0x622e88], eax
mov edx, dword [ebp]
push eax
push edx
call sub.WSOCK32.dll_listen
test eax, eax
je 0x41266d
call fcn.00410c40
mov eax, dword [ebp]
push 2
push eax
call sub.WSOCK32.dll_shutdown
mov esi, dword [ebp]
push 8
lea eax, [esp + 0x14]
push eax
push 0x80
push 0xffff
push esi
mov dword [esp + 0x24], 1
mov dword [esp + 0x28], 0x32
call sub.WSOCK32.dll_setsockopt
push esi
call sub.WSOCK32.dll_closesocket
mov ecx, dword [ebp]
push ecx
push 0x716
call fcn.004073f0
add esp, 8
pop edi
pop ebx
pop esi
pop ebp
mov ecx, dword [esp + 0x20]
xor ecx, esp
call fcn.00586584
add esp, 0x24
ret
cmp dword [0x622e84], 0
je 0x4126a0
mov ecx, dword [ebp]
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x24]
push eax
push ecx
mov dword [esp + 0x1c], 0x10
call sub.WSOCK32.dll_getsockname
mov edx, dword [esp + 0x22]
push edx
call sub.WSOCK32.dll_ntohs
cwde
mov dword [ebx], eax
jmp 0x4126a5
movzx ecx, di
mov dword [ebx], ecx
test esi, esi
jne 0x4126f9
mov esi, dword [ebp]
push 8
lea edx, [esp + 0x14]
push edx
push 0x80
push 0xffff
push esi
mov dword [esp + 0x24], 1
mov dword [esp + 0x28], 0x32
call sub.WSOCK32.dll_setsockopt
push esi
call sub.WSOCK32.dll_closesocket
push 0x2b0a
call fcn.004073f0
add esp, 4
pop edi
pop ebx
pop esi
pop ebp
mov ecx, dword [esp + 0x20]
xor ecx, esp
call fcn.00586584
add esp, 0x24
ret
mov ecx, dword [esp + 0x30]
pop edi
pop ebx
pop esi
pop ebp
xor ecx, esp
xor eax, eax
call fcn.00586584
add esp, 0x24
ret