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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x540de8
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x5a38c0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x20], ecx
push str.OnClientReading
lea ecx, [ebp - 0x3c]
mov dword [ebp - 0x28], ebx
call fcn.00406eb0
mov dword [ebp - 4], 0
call fcn.00428115
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40ee15
push 0x80004005
call fcn.00401050
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x34], eax
lea ecx, [ebp - 0x3c]
push ecx
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 1
call fcn.00403f10
push 0x5a4d74
mov dword [ebp - 0x38], 0x5a4d74
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x3c]
add eax, 0xfffffff0
mov byte [ebp - 4], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40ee69
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test byte [0x5a4d94], 1
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov byte [ebp - 4], 4
jne 0x40ee8a
or dword [0x5a4d94], 1
call esi
mov dword [0x5a4d90], eax
mov edi, dword [ebp + 0xc]
add dword [0x5a4d8c], edi
call esi
sub eax, dword [0x5a4d90]
cmp eax, 0x3e8
jb 0x40eec9
call esi
mov ecx, dword [0x5a4d8c]
mov esi, dword [ebp - 0x20]
push ecx
lea edx, [esi + 0x18]
push edx
mov dword [0x5a4d90], eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov dword [0x5a4d8c], 0
jmp 0x40eecc
mov esi, dword [ebp - 0x20]
test edi, edi
jne 0x40ef11
push edi
push ebx
mov ecx, esi
call fcn.0040ebd0
push 0x5a4d74
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ef0a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x40f14b
cmp edi, 5
jne 0x40ef67
mov edx, dword [ebx + 0x58]
cmp edx, dword [esi + 0x26]
jne 0x40ef67
mov al, byte [esi + 0x2a]
cmp al, byte [ebx + 0x5c]
jne 0x40ef67
lea esi, [ebx + 0x34]
mov ecx, esi
call fcn.0040dc00
push 0
mov ecx, esi
mov ebx, eax
call fcn.0040ddc0
mov edi, dword [ebp - 0x28]
mov esi, dword [ebp - 0x20]
push ebx
push eax
push edi
mov ecx, esi
call fcn.0040e0f0
push edi
mov ecx, esi
call fcn.0040ed30
lea ecx, [ebp - 0x38]
mov dword [ebp - 4], 0xffffffff
call fcn.0040e860
jmp 0x40f149
push edi
mov edi, dword [ebp - 0x28]
lea ecx, [edi + 0x58]
add ebx, 0x14
push ecx
mov ecx, ebx
call fcn.0040de70
mov esi, dword [ebp - 0x20]
mov edx, dword [esi + 8]
mov eax, dword [esi + 4]
push 4
push edi
push edx
call eax
mov ecx, ebx
call fcn.0040dc00
cmp eax, 0xd
jbe 0x40f111
push 0
mov ecx, ebx
call fcn.0040ddc0
mov ecx, dword [eax]
mov dword [ebp - 0x1c], ecx
mov dl, byte [eax + 4]
mov byte [ebp - 0x18], dl
cmp dword [esi + 0x26], ecx
jne 0x40f0fc
cmp dl, byte [esi + 0x2a]
jne 0x40f0fc
push 5
mov ecx, ebx
mov dword [ebp - 0x24], 0
call fcn.0040ddc0
mov ecx, dword [eax]
mov dword [ebp - 0x24], ecx
mov ecx, ebx
call fcn.0040dc00
imul eax, eax, 0x64
mov ecx, dword [ebp - 0x24]
xor edx, edx
div ecx
mov dword [edi + 0x4c], eax
test ecx, ecx
je 0x40f111
mov ecx, ebx
call fcn.0040dc00
cmp eax, dword [ebp - 0x24]
jb 0x40f111
push 5
lea edx, [ebp - 0x1c]
push edx
mov ecx, ebx
mov dword [ebp - 0x2c], 0
call fcn.0040deb0
push 4
lea eax, [ebp - 0x24]
push eax
mov ecx, ebx
call fcn.0040deb0
push 4
lea ecx, [ebp - 0x2c]
push ecx
mov ecx, ebx
call fcn.0040deb0
mov esi, dword [ebp - 0x24]
add esi, 0xfffffff3
push esi
call fcn.00426c26
mov edx, dword [ebp - 0x2c]
add esp, 4
push edx
mov edi, eax
call fcn.00426c26
add esp, 4
mov dword [ebp - 0x30], eax
test edi, edi
je 0x40f0e7
test eax, eax
je 0x40f0e7
push esi
push edi
mov ecx, ebx
call fcn.0040deb0
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
push esi
push edi
lea ecx, [ebp - 0x40]
push ecx
push edx
mov dword [ebp - 0x40], eax
call fcn.00421240
add esp, 0x10
test eax, eax
jne 0x40f0d2
mov esi, dword [ebp - 0x28]
lea ecx, [esi + 0x24]
call fcn.0040dda0
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x30]
push eax
push ecx
lea ecx, [esi + 0x24]
call fcn.0040de70
mov eax, dword [ebp - 0x20]
mov edx, dword [eax + 8]
mov eax, dword [eax + 4]
push 5
push esi
push edx
call eax
push edi
call fcn.00426c1b
mov ecx, dword [ebp - 0x30]
add esp, 4
push ecx
call fcn.00426c1b
mov edi, dword [ebp - 0x28]
add esp, 4
inc dword [esi + 0x2064]
mov esi, dword [ebp - 0x20]
jmp 0x40ef88
push 0x5899c0
lea edx, [ebp - 0x4c]
push edx
mov dword [ebp - 0x4c], str.bad_buffer
call fcn.00529ac1
push 0x5899c0
lea eax, [ebp - 0x48]
push eax
mov dword [ebp - 0x48], str.bad_Allocate
call fcn.00529ac1
push 0x5899c0
lea ecx, [ebp - 0x44]
push ecx
mov dword [ebp - 0x44], str.bad_buffer
call fcn.00529ac1
push edi
mov ecx, esi
call fcn.0040ed30
mov edx, dword [ebp - 0x38]
push edx
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f149
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00527098
mov esp, ebp
pop ebp
ret 8