Function at 0x40a9d0
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x440
mov eax, dword [0x43fbfc]
xor eax, esp
mov dword [esp + 0x43c], eax
mov eax, dword [esp + 0x44c]
mov ecx, dword [esp + 0x448]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x1c], eax
xor edi, edi
mov eax, ecx
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edi
lea esi, [eax + 1]
lea esp, [esp]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x40aa10
sub eax, esi
mov ebx, eax
push ebx
push ecx
lea ecx, [esp + 0x58]
push ecx
mov dword [esp + 0x58], ebx
call fcn.0041d420
add ebx, 4
push ebx
lea edx, [esp + 0x5c]
push edx
push 0x354e
call fcn.0040d060
add esp, 0x18
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
cmp eax, edi
mov ebp, dword [esp + 0x454]
mov dword [esp + 0x14], eax
jne 0x40aa62
push str.NDBQuery::socketProc_1_:_WSACreateEvent_n
jmp 0x40abaf
push 0x23
push eax
push ebp
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
jne 0x40aa7b
push str.NDBQuery::socketProc_2_:_WSAEventSelect_n
jmp 0x40abaf
xor esi, esi
push esi
push 0x927c0
push esi
lea eax, [esp + 0x20]
push eax
push 1
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp eax, 0xffffffff
je 0x40abaa
lea ebx, [ebx]
cmp eax, 0x102
je 0x40abaa
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x20]
push ecx
push edx
push ebp
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
cmp eax, 0xffffffff
je 0x40ab8b
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40ab8b
test al, 2
je 0x40ab20
test esi, esi
jne 0x40ab20
mov esi, ebx
sub esi, edi
push esi
lea eax, [esp + edi + 0x50]
push eax
push ebp
call fcn.0040b480
add esp, 0xc
test eax, eax
jl 0x40ac05
cmp eax, esi
jge 0x40aafe
xor esi, esi
add edi, eax
jmp 0x40ab1c
mov ecx, dword [esp + 0x14]
push 0x21
push ecx
push ebp
mov esi, 1
add edi, eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x40ac0c
mov eax, dword [esp + 0x20]
test al, 1
je 0x40ab83
lea edx, [esp + 0x10]
push edx
push 0x4004667f
push ebp
mov dword [esp + 0x1c], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
jne 0x40abb9
cmp dword [esp + 0x10], 4
jb 0x40ab8b
push 4
call fcn.0041beca
mov esi, eax
push 4
push esi
push ebp
mov dword [esi], 0
call fcn.0040b510
add esp, 0x10
cmp eax, 4
je 0x40ac13
push esi
call fcn.0041b986
push str.NDBQuery::socketProc_6_:_NSocketUtil::recvPacketExact_error_n
push 1
call fcn.00403ef0
add esp, 0xc
jmp 0x40abb9
test al, 0x20
jne 0x40acda
push 0
push 0x927c0
push 0
lea eax, [esp + 0x20]
push eax
push 1
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp eax, 0xffffffff
jne 0x40aaa0
push str.NDBQuery::socketProc_3_:_WSAWaitForMultipleEvents_Timeout_n
push 1
call fcn.00403ef0
add esp, 8
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40abd6
push 0
push eax
push ebp
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
test ebp, ebp
je 0x40abe6
cmp ebp, 0xffffffff
je 0x40abe6
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x44c]
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041a1b8
add esp, 0x440
ret 0x10
push str.NDBQuery::socketProc_4_:_NSocketUtil::sendPacket_error_n
jmp 0x40abaf
push str.NDBQuery::socketProc_5_:_WSAEventSelect_error_n
jmp 0x40abaf
push 4
push esi
push 0x354e
call fcn.0040d110
mov ecx, dword [esi]
push esi
mov dword [esp + 0x20], ecx
call fcn.0041b986
mov eax, dword [esp + 0x20]
lea edx, [eax - 1]
add esp, 0x10
cmp edx, 0xfffff
ja 0x40acd0
add eax, 1
push eax
call fcn.0041beca
mov esi, eax
mov eax, dword [esp + 0x14]
add eax, 1
push eax
push 0
push esi
call fcn.0041a540
mov ecx, dword [esp + 0x20]
push ecx
push esi
push ebp
call fcn.0040b510
add esp, 0x1c
cmp eax, dword [esp + 0x10]
je 0x40ac8c
push esi
call fcn.0041b986
push str.NDBQuery::socketProc_8_:_NSocketUtil::recvPacketExact_error_n
push 1
call fcn.00403ef0
add esp, 0xc
jmp 0x40abb9
push eax
push esi
push 0x354e
call fcn.0040d110
mov eax, dword [esp + 0x46c]
lea edx, [eax - 1]
push edx
push esi
push eax
mov eax, dword [esp + 0x34]
push eax
call fcn.0041b13a
add esp, 0x1c
test esi, esi
mov dword [esp + 0x18], 1
je 0x40abb9
push esi
call fcn.0041b986
add esp, 4
jmp 0x40abb9
push str.NDBQuery::socketProc_7_:_recv_size_error_n
jmp 0x40abaf
push str.socketProc::socketProc_9_:_remote_socket_closed_n
push 3
jmp 0x40abb1