Function at 0x1000d310
Capabilities:
Connect socket
Connect udp socket
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x1003e620]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0xc]
push edi
lea edi, [eax - 0xc]
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x38], edi
cmp eax, edi
jbe case.0x1000d35d.6
mov esi, dword [ebp - 0x30]
add eax, 0xffffffd5
mov dword [ebp - 0x24], eax
jmp 0x1000d354
mov ecx, dword [ebp - 0x34]
cmp eax, 0xe
ja case.0x1000d35d.3
jmp dword [eax*4 + 0x1000d634]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
push str._nh_malloc_dbg
call fcn.1000c050
add esp, 4
call fcn.100281e1
mov ecx, dword [ebp - 0x18]
mov dword [eax], ecx
mov dword [ebp - 0x28], 0xffffffff
jmp case.0x1000d35d.3
xor eax, eax
push 4
lea edx, [ebp - 0x30]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
push edx
lea eax, [ebp - 0x10]
push eax
call fcn.10026900
add esp, 0xc
jmp case.0x1000d35d.3
mov ecx, dword [ebp - 0x3c]
movzx edx, word [ecx]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x12], ax
push 0x10
lea eax, [ebp - 0x14]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x1000d416
call fcn.100281e1
cmp dword [eax], 0x70
je 0x1000d416
mov edi, 0x1d
mov eax, edi
sub eax, 0x1d
je 0x1000d400
dec eax
je 0x1000d3f7
dec eax
je 0x1000d4da
jmp 0x1000d40d
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x1000d40d
push str.L4_loadbzw2_ap
call fcn.1000c050
add esp, 4
inc edi
cmp edi, 0x20
jb 0x1000d3e4
mov edi, dword [ebp - 0x38]
lea ecx, [ebp - 0x40]
push ecx
lea edx, [ebp - 0x20]
push 0x7c
push edx
mov dword [ebp - 0x40], 0x77
mov dword [ebp - 0x20], esi
call fcn.1000ca30
add esp, 0xc
mov dword [ebp - 0x1c], 0x10
jmp case.0x1000d35d.3
cmp dword [ecx], 0
je 0x1000d5e2
mov eax, dword [0x10040174]
push 0x31
push eax
lea ecx, [ebx + 8]
push ecx
call fcn.10022c00
add esp, 0xc
jmp case.0x1000d35d.3
cmp dword [ebx + 4], 0
jne case.0x1000d35d.3
cmp dword [ebx + 0x10], 0
jne case.0x1000d35d.3
inc dword [ebx]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10027670
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x30]
push edx
push ecx
push 0xc2
call fcn.1001df60
add esp, 0xc
test eax, eax
js 0x1000d4da
push str.netdial
call fcn.1000c050
mov eax, dword [ebx]
add esp, 4
neg eax
sbb eax, eax
push 0
add eax, 2
push eax
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
test esi, esi
jns case.0x1000d35d.3
push str.V783_DeltaInt
call fcn.1000c050
add esp, 4
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10027670
mov esp, ebp
pop ebp
ret
mov eax, 2
mov word [ebp - 0x14], ax
jmp case.0x1000d35d.3
lea ecx, [ebp - 0x1c]
push ecx
lea edx, [ebp - 0x14]
push edx
push esi
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
js case.0x1000d35d.3
push str.controlValueTable
call fcn.1000c050
add esp, 4
pop edi
mov eax, esi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10027670
mov esp, ebp
pop ebp
ret
push 0xab
push 0
push 0
push 0
lea eax, [ebp - 0x20]
push eax
push 0
mov dword [ebp - 0x20], esi
call fcn.1001f730
add esp, 0x18
cmp dword [ebx], 0
jne case.0x1000d35d.3
push 4
lea ecx, [ebp - 0x18]
push ecx
push 0x20
push 0xffff
push esi
mov dword [ebp - 0x18], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
jmp case.0x1000d35d.3
lea edx, [ebp - 0x1c]
push edx
lea eax, [ebp - 0x18]
push eax
push 0x1007
push 0xffff
push esi
mov dword [ebp - 0x1c], 4
call dword [sym.imp.WS2_32.dll_getsockopt]
cmp dword [ebp - 0x18], 0
jne case.0x1000d35d.3
mov dword [ebp - 0x18], 0x6b
jmp case.0x1000d35d.3
mov eax, 0xb4
cmp eax, 0xb4
je 0x1000d5f5
add eax, 0xce
cmp eax, 0x182
jb 0x1000d5a5
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x24]
dec ecx
dec eax
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x24], eax
cmp ecx, edi
ja 0x1000d351
mov eax, dword [ebp - 0x28]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10027670
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10027670
mov esp, ebp
pop ebp
ret
push str.rlock
call fcn.1000c050
mov ecx, dword [0x10040174]
push 0x4e
add ecx, 0x210
push ecx
push 0x10040154
call fcn.10023a30
mov ecx, dword [ebp - 4]
add esp, 0x10
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.10027670
mov esp, ebp
pop ebp
ret