Function at 0x407cd6
Capabilities:
Check for time delay via gettickcount
Print debug messages

Disassembly:
push 0xffffffffffffffff
push 0x41f86d
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x434018]
xor eax, esp
mov dword [esp + 0x34], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x434018]
xor eax, esp
push eax
lea eax, [esp + 0x4c]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x5c]
mov esi, ecx
mov eax, dword [esi + 0x1d0]
xor edi, edi
lea ecx, [esp + 0x14]
mov dword [esp + 0x18], ebp
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], edi
call dword [sym.imp.mfc90.dll_Ordinal_316]
push 3
mov dword [esi + 0x200], edi
mov dword [esi + 0x1e8], edi
pop eax
mov byte [ebp], 0
mov dword [esp + 0x54], edi
mov dword [esp + 0x1c], edi
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dword [esp + 0x24], 0xa
cmp ax, word [esi + 0x1e0]
jne 0x407d77
push str.EX_TERMINATE_recieved__terminating_
push ebp
call dword [sym.imp.MSVCR90.dll_sprintf]
pop ecx
pop ecx
push ebp
call edi
mov dword [esp + 0x1c], 1
or dword [esi + 0x1ec], 0xffffffff
push 2
pop eax
cmp ax, word [esi + 0x1e0]
jne 0x40828a
mov ebx, dword [sym.imp.mfc90.dll_Ordinal_2539]
xor ecx, ecx
cmp dword [esp + 0x1c], ecx
jne 0x40828a
xor eax, eax
push 3
inc eax
pop edx
mov dword [esp + 0x1c], ecx
mov dword [esi + 0x200], eax
cmp dx, word [esi + 0x1e0]
je 0x40828a
cmp dword [esi + 0x1e8], ecx
jne 0x407ffb
mov edx, dword [esi]
push eax
mov ecx, esi
mov dword [esi + 0x200], 2
mov dword [esp + 0x28], 0xa
call dword [edx + 0x14]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
lea eax, [esp + 0x18]
push str.__4d__Listen_for_connection..._n
push eax
call ebx
add esp, 0xc
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
mov ebp, dword [esi]
lea ecx, [esp + 0x14]
add ebp, 0x1c
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
mov ecx, esi
call dword [ebp]
mov eax, dword [esi + 8]
push bind
push dword [eax]
call dword [sym.imp.WSOCK32.dll_listen]
cmp eax, 0xffffffff
jne 0x407e5d
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push dword [eax*4 + 0x427a00]
push str.Listen_returned_with_a_socket_error_:__s_n
push dword [esp + 0x20]
call dword [sym.imp.MSVCR90.dll_sprintf]
add esp, 0xc
push dword [esp + 0x18]
call edi
mov dword [esp + 0x1c], 1
push 0
mov dword [esp + 0x38], 0x10
call dword [sym.imp.WSOCK32.dll_WSASetLastError]
cmp dword [esi + 0x1ec], 0xffffffff
jne 0x407e7d
and dword [esi + 0x1e8], 0
mov ebp, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esi + 0x200], 3
call ebp
push eax
lea eax, [esp + 0x18]
push str.__4d__Accept_connection..._n
push eax
call ebx
add esp, 0xc
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x3c]
push eax
mov eax, dword [esi + 8]
push dword [eax]
call dword [sym.imp.WSOCK32.dll_accept]
mov dword [esi + 0x1ec], eax
cmp eax, 0xffffffff
je 0x407f6e
mov dword [esi + 0x200], 4
call ebp
push eax
mov eax, dword [esi + 8]
push dword [eax]
lea eax, [esp + 0x1c]
push str.__d___4d__Connection_accepted._n
push eax
call ebx
add esp, 0x10
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
mov ebp, dword [esi]
lea ecx, [esp + 0x14]
add ebp, 0x1c
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
mov ecx, esi
call dword [ebp]
mov ebp, dword [sym.imp.WSOCK32.dll_WSAGetLastError]
call ebp
cmp dword [esi + 0x1ec], 0xffffffff
jne 0x407f62
call ebp
cmp eax, 0x2733
je 0x407f62
mov dword [esi + 0x200], 5
call ebp
push dword [eax*4 + 0x427a00]
push str.Listen_Accept_returned_with_a_socket_error_:__s_n
push dword [esp + 0x20]
call dword [sym.imp.MSVCR90.dll_sprintf]
add esp, 0xc
push dword [esp + 0x18]
call edi
mov dword [esp + 0x1c], 1
jmp 0x407fca
mov dword [esi + 0x1e8], 1
jmp 0x407fca
mov dword [esi + 0x200], 6
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
sub eax, 0x2710
js 0x407fa0
push dword [eax*4 + 0x431640]
push str.Accept___Error_on_Listen_socket_:__s_n
push dword [esp + 0x20]
call dword [sym.imp.MSVCR90.dll_sprintf]
add esp, 0xc
jmp 0x407fb1
push str.Unknown_Accept___error_on_Listen_socket_n
push dword [esp + 0x1c]
call dword [sym.imp.MSVCR90.dll_sprintf]
pop ecx
pop ecx
push dword [esp + 0x18]
call edi
push dword [esp + 0x18]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x1c]
push 0
call dword [sym.imp.WSOCK32.dll_WSASetLastError]
push 2
pop eax
cmp ax, word [esi + 0x1e0]
jne 0x407ff7
cmp dword [esp + 0x1c], 0
jne 0x407ff7
cmp dword [esi + 0x1ec], 0xffffffff
jne 0x407ff7
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x407e7d
mov ebp, dword [esp + 0x18]
cmp dword [esi + 0x1ec], 0xffffffff
je 0x40827a
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x2c], eax
mov dword [esi + 0x200], 7
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
lea eax, [esp + 0x18]
push str._4d_Currently_connected._n
push eax
call ebx
add esp, 0xc
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
lea eax, [esp + 0x20]
push eax
push 0x4004667f
push dword [esi + 0x1ec]
mov dword [esi + 0x200], 8
call dword [sym.imp.WSOCK32.dll_ioctlsocket]
cmp dword [esp + 0x20], 0
mov dword [esp + 0x30], eax
jne 0x408074
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40807d
mov eax, dword [esi]
push 2
mov ecx, esi
call dword [eax + 0x14]
movzx eax, word [esi + 0x1d4]
cmp eax, dword [esp + 0x20]
ja 0x40808f
dec eax
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x2c]
cmp eax, 0x2710
mov eax, dword [esp + 0x20]
ja 0x4080be
push 3
pop ecx
cmp cx, word [esi + 0x1e0]
je 0x4080b6
test eax, eax
je 0x40803f
jmp 0x4080be
mov dword [esp + 0x1c], 1
cmp dword [esp + 0x30], 0xffffffff
je 0x4081c3
test eax, eax
je 0x4081f4
mov dword [esi + 0x200], 9
mov dword [esp + 0x24], 0xa
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
lea eax, [esp + 0x18]
push str._4d_Server_socket_thread_reading._n
push eax
call ebx
add esp, 0xc
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
push ebp
push dword [esp + 0x2c]
mov ecx, esi
push dword [esp + 0x28]
push dword [esi + 0x1ec]
call fcn.00407a46
mov ecx, dword [esp + 0x20]
sub eax, ecx
neg eax
sbb eax, eax
push 2
pop edx
inc eax
mov dword [esi + 0x200], 0xa
cmp dx, word [esi + 0x1e0]
jne 0x40828a
test eax, eax
je 0x40827a
mov eax, dword [esp + 0x28]
push ecx
mov byte [ecx + eax], 0
mov edx, dword [esi]
push eax
push dword [esi + 0x1ec]
mov ecx, esi
mov dword [esi + 0x200], 0xc
call dword [edx + 0x20]
test eax, eax
jne 0x4081b4
push dword [esi + 0x1ec]
mov dword [esi + 0x200], 0xd
call dword [sym.imp.WSOCK32.dll_closesocket]
and dword [esi + 0x1e8], 0
push str.Closing_socket_normally._n
call edi
mov eax, dword [esi]
push 4
mov ecx, esi
call dword [eax + 0x14]
mov ebp, dword [esi]
lea ecx, [esp + 0x14]
add ebp, 0x1c
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
mov ecx, esi
call dword [ebp]
mov ebp, dword [esp + 0x18]
mov dword [esi + 0x200], 0xe
jmp 0x40827a
push eax
push str.Listen_Poll_Failed_on_rx__BytesRxd_:__d_n
push ebp
call dword [sym.imp.MSVCR90.dll_sprintf]
add esp, 0xc
push ebp
call edi
push dword [esi + 0x1ec]
call dword [sym.imp.WSOCK32.dll_closesocket]
and dword [esi + 0x1e8], 0
push str.Closing_socket_after_error._n
call edi
push 4
jmp 0x408224
dec dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [esp + 0x24], 0
push eax
lea eax, [esp + 0x18]
jle 0x40822d
push str.__4d__Listen_Poll_idle._n
push eax
call ebx
add esp, 0xc
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
push 5
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x14]
jmp 0x40827a
push str.__4d__Closing_socket__idle_for_too_long._n
push eax
call ebx
add esp, 0xc
lea ecx, [esp + 0x14]
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
call edi
mov ebp, dword [esi]
lea ecx, [esp + 0x14]
add ebp, 0x1c
call dword [sym.imp.mfc90.dll_Ordinal_910]
push eax
mov ecx, esi
call dword [ebp]
push dword [esi + 0x1ec]
call dword [sym.imp.WSOCK32.dll_closesocket]
mov eax, dword [esi]
and dword [esi + 0x1e8], 0
push 4
mov ecx, esi
call dword [eax + 0x14]
mov ebp, dword [esp + 0x18]
push 2
pop eax
cmp ax, word [esi + 0x1e0]
je 0x407d94
push 4
pop eax
lea ecx, [esp + 0x14]
mov word [esi + 0x1e0], ax
call dword [sym.imp.mfc90.dll_Ordinal_601]
mov ecx, dword [esp + 0x4c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.0041de66
add esp, 0x44
ret 4