Function at 0x40d050
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x568560
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x34
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x10], esp
push str.OnClientReading
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x14], edi
call fcn.0054c666
mov eax, dword [0x5bc6c4]
mov dword [ebp - 4], 0
mov dword [ebp - 0x3c], eax
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 1
push ecx
lea ecx, [ebp - 0x3c]
call fcn.0054c731
push 0x5cfa20
mov dword [ebp - 0x40], 0x5cfa20
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 3
call fcn.0054c5f8
mov al, byte [0x5cfa00]
mov byte [ebp - 4], 4
test al, 1
jne 0x40d0e3
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
or al, 1
mov byte [0x5cfa00], al
call esi
mov dword [0x5cfa44], eax
jmp 0x40d0e9
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, dword [ebp + 0xc]
mov eax, dword [0x5cfa54]
add eax, ebx
mov dword [0x5cfa54], eax
call esi
sub eax, dword [0x5cfa44]
cmp eax, 0x3e8
jb 0x40d13c
call esi
push str.InterlockedExchange
push str.kernel32.dll
mov dword [0x5cfa44], eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [0x5cfa54]
lea ecx, [edi + 0x18]
push edx
push ecx
call eax
mov dword [0x5cfa54], 0
test ebx, ebx
jne 0x40d17a
mov edx, dword [ebp + 8]
push ebx
push edx
mov ecx, edi
call fcn.0040d620
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [ebp - 0x3c]
mov dword [ebp - 4], 0xffffffff
call fcn.0054c5f8
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp ebx, 5
jne 0x40d1bf
mov ecx, ebx
mov ebx, dword [ebp + 8]
add edi, 0x26
xor edx, edx
lea esi, [ebx + 0x58]
repe cmpsb byte [esi], byte es:[edi]
jne 0x40d1c2
lea esi, [ebx + 0x34]
mov ecx, esi
call fcn.00401fb0
push 0
mov ecx, esi
mov edi, eax
call fcn.00402170
mov esi, dword [ebp - 0x14]
push edi
push eax
push ebx
mov ecx, esi
call fcn.0040ce80
push ebx
mov ecx, esi
call fcn.0040ce00
jmp 0x40d37f
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
add ebx, 0x14
push ecx
lea edx, [esi + 0x58]
mov ecx, ebx
push edx
call fcn.00401ec0
push 4
push esi
mov esi, dword [ebp - 0x14]
mov eax, dword [esi + 8]
push eax
call dword [esi + 4]
mov ecx, ebx
call fcn.00401fb0
cmp eax, 0xd
jbe 0x40d374
push 0
mov ecx, ebx
call fcn.00402170
mov ecx, dword [eax]
add esi, 0x26
mov dword [ebp - 0x38], ecx
mov dl, byte [eax + 4]
mov ecx, 5
lea edi, [ebp - 0x38]
xor eax, eax
mov byte [ebp - 0x34], dl
repe cmpsb byte [esi], byte es:[edi]
je 0x40d22e
lea ecx, [ebp - 0x28]
push 0x59d848
push ecx
mov dword [ebp - 0x28], str.bad_buffer
call fcn.00530f24
xor esi, esi
push 5
mov ecx, ebx
mov dword [ebp + 0xc], esi
call fcn.00402170
mov edx, dword [eax]
mov ecx, ebx
mov dword [ebp + 0xc], edx
call fcn.00401fb0
mov ecx, dword [ebp + 0xc]
lea eax, [eax + eax*4]
xor edx, edx
lea eax, [eax + eax*4]
shl eax, 2
div ecx
mov edx, dword [ebp + 8]
cmp ecx, esi
mov dword [edx + 0x4c], eax
je 0x40d371
mov ecx, ebx
call fcn.00401fb0
cmp eax, dword [ebp + 0xc]
jb 0x40d371
lea eax, [ebp - 0x38]
push 5
push eax
mov ecx, ebx
mov dword [ebp - 0x18], esi
call fcn.00401f10
lea ecx, [ebp + 0xc]
push 4
push ecx
mov ecx, ebx
call fcn.00401f10
lea edx, [ebp - 0x18]
push 4
push edx
mov ecx, ebx
call fcn.00401f10
mov eax, dword [ebp + 0xc]
lea esi, [eax - 0xd]
push esi
call fcn.00547b9a
mov ecx, dword [ebp - 0x18]
add esp, 4
mov edi, eax
push ecx
call fcn.00547b9a
add esp, 4
mov dword [ebp - 0x1c], eax
test edi, edi
je 0x40d35c
test eax, eax
je 0x40d35c
push esi
push edi
mov ecx, ebx
call fcn.00401f10
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
push esi
lea eax, [ebp - 0x24]
push edi
push eax
push ecx
mov dword [ebp - 0x24], edx
call fcn.00422190
add esp, 0x10
test eax, eax
jne 0x40d347
mov esi, dword [ebp + 8]
lea ecx, [esi + 0x24]
call fcn.00402150
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x1c]
push edx
push eax
lea ecx, [esi + 0x24]
call fcn.00401ec0
mov eax, dword [ebp - 0x14]
push 5
push esi
mov ecx, dword [eax + 8]
push ecx
call dword [eax + 4]
push edi
call fcn.00547bc3
mov edx, dword [ebp - 0x1c]
add esp, 4
push edx
call fcn.00547bc3
mov eax, dword [esi + 0x2064]
add esp, 4
inc eax
mov dword [esi + 0x2064], eax
mov esi, dword [ebp - 0x14]
jmp 0x40d1e4
lea eax, [ebp - 0x2c]
push 0x59d848
push eax
mov dword [ebp - 0x2c], str.bad_buffer
call fcn.00530f24
lea ecx, [ebp - 0x30]
push 0x59d848
push ecx
mov dword [ebp - 0x30], str.bad_Allocate
call fcn.00530f24
mov esi, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
mov ecx, esi
push edx
call fcn.0040ce00
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [ebp - 0x3c]
mov dword [ebp - 4], 0xffffffff
call fcn.0054c5f8
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov al, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 8