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

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
mov esi, ecx
push edi
xor ebp, ebp
mov ebx, dword [esi + 8]
mov edi, 1
mov dword [esi + 0x10], ebp
mov dword [esi + 0x68], edi
mov dword [esi + 0x70], edi
mov eax, dword [esi + 0x18]
cmp eax, ebp
mov dword [esp + 0x14], ebp
je 0x40dac2
mov eax, dword [ebx + 0x14]
mov dword [esp + 0x10], edi
cmp eax, ebp
jne 0x40dac6
mov dword [esp + 0x10], ebp
mov eax, dword [esi + 0x74]
mov dword [esi + 0x18], ebp
cmp eax, ebp
je 0x40dada
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x14], eax
mov dword [esi + 0x2c], 0xffffffff
mov eax, dword [ebx + 0x18]
cmp eax, ebp
jne 0x40db0f
mov ecx, esi
mov dword [esi + 0x40], edi
call fcn.0040d8b0
test eax, eax
je 0x40db02
mov dword [esi + 0x68], 0x132
jmp 0x40dca0
cmp dword [esi + 0xc], ebp
je 0x40db0f
mov dword [esi + 0x68], ebp
jmp 0x40dca0
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [ebx + 0x20]
mov dword [esp + 0x18], eax
cmp eax, ecx
jne 0x40db38
mov eax, dword [ebx + 0x24]
mov dword [esi + 0x1c], eax
mov eax, dword [ebx + 0x24]
inc eax
mov dword [ebx + 0x24], eax
mov dword [esi + 0xc], edi
mov dword [esi + 0x68], ebp
jmp 0x40dca0
cmp dword [0x45bacc], ebp
je 0x40db57
cmp dword [esp + 0x10], ebp
je 0x40db57
cmp dword [esi + 0x14], ebp
jne 0x40db57
cmp dword [esi + 0x74], ebp
je 0x40db57
mov dword [esi + 0x28], edi
xor edi, edi
jmp 0x40db5d
mov edi, dword [esi + 0x74]
mov dword [esi + 0x28], ebp
mov eax, dword [esi + 0x14]
cmp eax, ebp
je 0x40db69
mov dword [esi + 0x7c], eax
jmp 0x40db8a
mov ecx, dword [ebx + 0x20]
push ebp
mov dword [esi + 0x24], ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [ebx + 0x18]
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [esi + 0x7c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x6c], eax
mov eax, dword [esi + 0x7c]
cmp eax, 0xffffffff
je 0x40dc58
cmp eax, ebp
je 0x40dc74
cmp eax, 0x80
je 0x40dc6a
cmp eax, 0x102
jne 0x40dc61
neg edi
sbb edi, edi
and edi, 3
add edi, 0x138
mov dword [esi + 0x68], edi
mov ecx, dword [esi + 0x24]
mov dword [esi + 0x78], 1
mov eax, dword [ebx + 0x20]
cmp ecx, ebp
jne 0x40dbdf
cmp eax, ebp
je 0x40dbdf
mov dword [esi + 0x24], eax
cmp dword [esi + 0x74], ebp
je 0x40dbf1
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x14]
mov dword [esi + 0x2c], eax
cmp dword [0x45bacc], ebp
je 0x40dc9b
cmp dword [esp + 0x10], ebp
je 0x40dcb0
cmp dword [esi + 0x74], ebp
je 0x40dc9b
cmp dword [esi + 0x14], ebp
jne 0x40dc9b
mov ecx, esi
call fcn.0040dcc0
mov edi, dword [esi + 0x74]
mov dword [esi + 0x28], ebp
cmp edi, 0xffffffff
je 0x40dc3c
mov eax, dword [esi + 0x2c]
cmp eax, edi
jae 0x40dc9b
sub edi, eax
cmp edi, 0x309
jbe 0x40dc48
mov dword [esi + 0x28], 1
mov edi, 0x309
mov eax, 1
mov dword [esi + 0x68], eax
mov dword [esi + 0x70], eax
jmp 0x40db5d
mov dword [esi + 0x68], 0x12d
jmp 0x40dc9b
mov dword [esi + 0x68], 0x13c
jmp 0x40dc9b
mov eax, 1
mov dword [esi + 0x10], eax
jmp 0x40dc79
mov eax, 1
mov ecx, dword [esp + 0x18]
mov dword [ebx + 0x24], eax
mov dword [ebx + 0x20], ecx
mov dword [esi + 0xc], eax
cmp dword [esi + 0x74], ebp
je 0x40dc98
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x14]
mov dword [esi + 0x2c], eax
mov dword [esi + 0x68], ebp
mov edi, 1
cmp dword [esp + 0x10], ebp
je 0x40dcb0
mov ecx, esi
call fcn.0040dcc0
mov dword [esi + 0x18], edi
mov eax, dword [esi + 0x68]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret