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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
cmp dword [0x520138], 0xffffffff
push ebx
push esi
push edi
mov dword [ebp - 0x18], edx
mov esi, ecx
jne 0x40c465
mov ecx, dword [0x520490]
push str.RecvBthCmd6
push 4
sub esp, 0xc
mov dword [ebp - 0x24], 0
mov eax, esp
mov dword [ebp - 0x20], 0
movq xmm0, qword [ebp - 0x24]
movq qword [eax], xmm0
mov dword [eax + 8], 0
call fcn.00433d50
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor edi, edi
mov byte [ebp - 1], 0
push edi
push 0x5022e4
mov dword [ebp - 8], edi
call fcn.00457020
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebx
mov dword [ebp - 0x14], eax
call ebx
sub eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
jae 0x40c626
test byte [0x520134], 4
je 0x40c4c5
push 0x520220
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 1
lea eax, [ebp - 1]
mov ecx, 0x52020c
push eax
call fcn.004021d0
push 0x520220
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x40c4d9
push 0xffffffffffffffff
push 1
lea eax, [ebp - 1]
mov ecx, 0x520130
push eax
call fcn.00401660
mov edi, eax
test edi, edi
je 0x40c647
mov ecx, dword [esi + 0x10]
mov edi, dword [esi + 0x14]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], edi
cmp ecx, edi
jae 0x40c510
lea eax, [ecx + 1]
mov edx, esi
mov dword [esi + 0x10], eax
cmp edi, 0x10
jb 0x40c500
mov edx, dword [esi]
mov al, byte [ebp - 1]
mov byte [ecx + edx], al
mov byte [ecx + edx + 1], 0
jmp 0x40c619
mov al, byte [ebp - 1]
mov byte [ebp - 2], al
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, 1
jb 0x40c65a
lea ebx, [ecx + 1]
or ebx, 0xf
cmp ebx, 0x7fffffff
jbe 0x40c53b
mov ebx, 0x7fffffff
jmp 0x40c559
mov edx, edi
mov eax, 0x7fffffff
shr edx, 1
sub eax, edx
cmp edi, eax
jbe 0x40c551
mov ebx, 0x7fffffff
jmp 0x40c559
lea eax, [edx + edi]
cmp ebx, eax
cmovb ebx, eax
lea edx, [ebx + 1]
cmp edx, 0x1000
jb 0x40c590
lea eax, [edx + 0x23]
mov ecx, 0xffffffff
cmp eax, edx
cmovbe eax, ecx
push eax
call fcn.004760bd
add esp, 4
test eax, eax
je 0x40c65f
mov ecx, dword [ebp - 0xc]
lea edi, [eax + 0x23]
and edi, 0xffffffe0
mov dword [edi - 4], eax
jmp 0x40c5a6
test edx, edx
je 0x40c5a4
push edx
call fcn.004760bd
mov ecx, dword [ebp - 0xc]
add esp, 4
mov edi, eax
jmp 0x40c5a6
xor edi, edi
cmp dword [ebp - 0x10], 0x10
lea eax, [ecx + 1]
mov dword [esi + 0x14], ebx
lea ebx, [edi + ecx]
mov dword [esi + 0x10], eax
mov dword [ebp - 0xc], ebx
push ecx
jb 0x40c5fe
mov ebx, dword [esi]
push ebx
push edi
call fcn.00498930
mov eax, dword [ebp - 0xc]
add esp, 0xc
mov cl, byte [ebp - 2]
mov byte [eax], cl
mov ecx, dword [ebp - 0x10]
inc ecx
mov byte [eax + 1], 0
cmp ecx, 0x1000
jb 0x40c5f2
mov edx, dword [ebx - 4]
add ecx, 0x23
sub ebx, edx
lea eax, [ebx - 4]
cmp eax, 0x1f
ja 0x40c65f
mov ebx, edx
push ecx
push ebx
call fcn.00476085
add esp, 8
jmp 0x40c611
push esi
push edi
call fcn.00498930
mov cl, byte [ebp - 2]
add esp, 0xc
mov byte [ebx], cl
mov byte [ebx + 1], 0
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esi], edi
mov edi, dword [ebp - 8]
inc edi
cmp byte [ebp - 1], 0xd
mov dword [ebp - 8], edi
jne 0x40c64a
cmp dword [esi + 0x14], 0x10
jb 0x40c62e
mov esi, dword [esi]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call esi
push 0x4fd744
call esi
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 8]
call ebx
sub eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
jb 0x40c492
jmp 0x40c626
call fcn.00456bb0
call fcn.004a3cba
int3