Function at 0x40b8a0
Capabilities:
Set socket configuration

Disassembly:
push ebx
push ebp
push esi
mov esi, dword [esp + 0x14]
xor ebp, ebp
push edi
mov eax, dword [esi + 0x2024]
mov edi, dword [esp + 0x20]
cmp eax, 1
je 0x40b8df
cmp eax, ebp
je 0x40b8df
cmp dword [esp + 0x24], ebp
je 0x40b8c7
cmp edi, ebp
jne 0x40b8df
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x14]
push eax
push esi
push ecx
call fcn.0040b740
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
ret
cmp eax, 6
ja case.default.0x40b8e8
jmp dword [eax*4 + 0x40bc44]
mov eax, dword [esi + 0x201c]
lea edx, [esi + 0x2678]
push 4
push edx
push 0x700b
push 0xffff
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x40b952
cmp dword [esi + 0x201c], ebp
je case.default.0x40b8e8
mov edi, dword [esp + 0x14]
push str.SO_UPDATE_ACCEPT_CONTEXT_failed_to_update_accept_socket
push 3
push 0x4cc
mov ecx, dword [edi + 0x24]
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
mov edx, dword [esi + 0x201c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 0x201c], ebp
jmp 0x40bac4
mov ebx, dword [esp + 0x14]
mov ecx, ebx
call fcn.0040cc10
mov edi, eax
cmp edi, ebp
jne 0x40b9cb
push 8
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebp
jne 0x40b9cb
cmp dword [esi + 0x201c], ebp
je case.default.0x40b8e8
mov eax, dword [ebx + 0x24]
push str.HeapAlloc___for_lpNewperHandlecontext_failed:10031
push 3
push 0x4cc
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [esi + 0x201c]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
push ebp
push esi
mov ecx, ebx
mov dword [esi + 0x201c], ebp
mov dword [esi + 0x2698], ebp
call fcn.0040cb40
push esi
mov ecx, ebx
call fcn.0040ced0
pop edi
pop esi
pop ebp
pop ebx
ret
mov edx, dword [esi + 0x201c]
mov dword [edi + 4], ebp
mov dword [edi], edx
mov ecx, dword [esi + 0x201c]
mov dword [esi + 0x268c], edi
mov eax, dword [ebx + 0x28]
push ebp
push edi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
test eax, eax
jne 0x40ba20
mov edx, dword [ebx + 0x24]
push str.CreateIoCompletionPort___failed:_error_is_10023
push 3
push 0x4cc
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
push ebp
push edi
push esi
mov ecx, ebx
call fcn.0040cf20
push esi
mov ecx, ebx
call fcn.0040ced0
pop edi
pop esi
pop ebp
pop ebx
ret
mov eax, dword [esi + 0x2658]
mov dword [esi + 0x2670], ebp
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
pop edi
pop esi
pop ebp
pop ebx
ret
mov edi, dword [esp + 0x14]
mov edx, dword [esi + 0x201c]
push 4
lea ecx, [edi + 0x2c]
push ecx
push 0x700b
push 0xffff
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x40ba7d
mov eax, dword [edi + 0x24]
push str.SO_UPDATE_ACCEPT_CONTEXT_failed_to_update_accept_socket:_error_is_10033
push 3
push 0x4cc
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [esi + 0x201c]
push ecx
jmp 0x40babe
mov ecx, edi
call fcn.0040cc10
mov ebx, eax
cmp ebx, ebp
jne 0x40bae0
push 8
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
cmp ebx, ebp
jne 0x40bae0
mov edx, dword [edi + 0x24]
push str.HeapAlloc___for_lpNewperHandlecontext_failed:_error_is_10034
push 3
push 0x4cc
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
mov eax, dword [esi + 0x201c]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push ebp
push esi
mov ecx, edi
mov dword [esi + 0x2698], ebp
call fcn.0040cb40
push esi
mov ecx, edi
call fcn.0040ced0
pop edi
pop esi
pop ebp
pop ebx
ret
mov ecx, dword [esi + 0x201c]
mov dword [ebx + 4], ebp
mov dword [ebx], ecx
mov eax, dword [esi + 0x201c]
mov dword [esi + 0x268c], ebx
mov edx, dword [edi + 0x28]
push ebp
push ebx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
test eax, eax
jne 0x40bb35
mov ecx, dword [edi + 0x24]
push str.CreateIoCompletionPort___failed:_error_is_10024
push 3
push 0x4cc
push ecx
call dword [sym.imp.USER32.dll_SendMessageA]
push ebp
push ebx
push esi
mov ecx, edi
call fcn.0040cf20
push esi
mov ecx, edi
call fcn.0040ced0
pop edi
pop esi
pop ebp
pop ebx
ret
lea ebp, [edi + 0x48]
push ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
mov ecx, edi
call fcn.0040c4e0
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [edi]
push 0x12c
push esi
mov ecx, edi
call dword [edx]
mov eax, dword [edi]
push ebx
push esi
mov ecx, edi
call dword [eax + 4]
pop edi
pop esi
pop ebp
pop ebx
ret
push edi
mov edi, dword [esp + 0x18]
push esi
mov ecx, edi
call fcn.0040ccd0
mov edx, dword [edi]
push 0x64
push esi
mov ecx, edi
call dword [edx]
mov ecx, dword [esp + 0x1c]
mov eax, dword [edi]
push ecx
push esi
mov ecx, edi
call dword [eax + 4]
pop edi
pop esi
pop ebp
pop ebx
ret
push edi
mov edi, dword [esp + 0x18]
push esi
mov ecx, edi
call fcn.0040cd00
mov edx, dword [edi]
push 0xc8
push esi
mov ecx, edi
call dword [edx]
mov ecx, dword [esp + 0x1c]
mov eax, dword [edi]
push ecx
push esi
mov ecx, edi
call dword [eax + 4]
pop edi
pop esi
pop ebp
pop ebx
ret
push edi
mov edi, dword [esp + 0x18]
push esi
mov ecx, edi
call fcn.0040cd00
mov edx, dword [edi]
push 0x190
push esi
mov ecx, edi
call dword [edx]
mov ecx, dword [esp + 0x1c]
mov eax, dword [edi]
push ecx
push esi
mov ecx, edi
call dword [eax + 4]
pop edi
pop esi
pop ebp
pop ebx
ret
push edi
mov edi, dword [esp + 0x18]
push esi
mov ecx, edi
call fcn.0040cd00
mov edx, dword [edi]
push 0x258
push esi
mov ecx, edi
call dword [edx]
mov ecx, dword [esp + 0x1c]
mov eax, dword [edi]
push ecx
push esi
mov ecx, edi
call dword [eax + 4]
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebx, dword [esp + 0x14]
push edi
push esi
mov ecx, ebx
call fcn.0040ccd0
mov dword [esi + 0x2014], edi
mov edx, dword [ebx]
push 0x2bc
push esi
mov ecx, ebx
call dword [edx]
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebx]
push ecx
push esi
mov ecx, ebx
call dword [eax + 4]
pop edi
pop esi
pop ebp
pop ebx
ret