Function at 0x419420
Capabilities:
Check for time delay via gettickcount
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x217c
call fcn.0047e620
mov eax, dword [0x4cf06c]
xor eax, esp
mov dword [esp + 0x2178], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
push esi
push edi
cmp dword [ebx + 0xff4], 0
mov dword [esp + 0x14], eax
je 0x419473
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2178]
xor ecx, esp
call fcn.0047d39f
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 0x10]
mov esi, eax
shr esi, 1
mov edi, eax
not esi
and edi, 1
mov ecx, eax
mov dword [esp + 0x1c], edi
and esi, 1
and ecx, 4
mov dword [esp + 0xc], esi
mov dword [esp + 0x18], ecx
test edi, edi
je 0x4194a1
mov dword [ebx + 0xff4], edi
jmp 0x4194ae
cmp dword [ebx + 0x85c], 0
jne 0x4196c6
test esi, esi
je 0x4194e5
test al, 8
je 0x4194dd
mov esi, dword [ebx + 0x14]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push edi
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, dword [esp + 0xc]
mov edi, dword [esp + 0x1c]
jmp 0x4194eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4194e7
xor eax, eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
test eax, eax
je 0x41950d
push ecx
lea ecx, [esp + 0x1144]
push ecx
push eax
call fcn.004193c0
lea eax, [esp + 0x1140]
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x38]
call fcn.0041ae30
cmp dword [esp + 0x18], 0
lea ecx, [esp + 0x38]
lea ecx, [ecx + eax*2]
mov dword [esp + 0xc], ecx
je 0x419541
mov edx, 0x4b0660
call fcn.0041ae30
mov ecx, dword [esp + 0xc]
lea ecx, [ecx + eax*2]
mov dword [esp + 0xc], ecx
test esi, esi
mov esi, dword [esp + 0x10]
je 0x4195bc
test esi, esi
je 0x4195bc
mov edx, 0x4b05fc
call fcn.0041ae30
mov ecx, dword [esp + 0xc]
lea ecx, [ecx + eax*2]
mov eax, dword [ebx + 0x700]
test eax, eax
mov dword [esp + 0x18], ecx
movzx eax, ax
jg 0x419574
mov eax, 0x400
push 0
push 0x820
push ecx
push eax
push esi
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov ecx, dword [esp + 0x18]
cmp word [ecx + eax*2 - 2], 0xa
lea eax, [ecx + eax*2]
lea esi, [eax - 4]
cmovne esi, eax
mov eax, dword [esp + 0x10]
push eax
push 0x4b0688
push esi
call fcn.0040e1d0
add esp, 0xc
lea ecx, [esi + eax*2]
mov esi, dword [esp + 0x10]
mov dword [esp + 0xc], ecx
mov edx, dword [esp + 0x14]
mov eax, 0x4b0690
test edx, edx
cmovne eax, edx
push eax
push 0x4b0694
push ecx
call fcn.0040e1d0
mov ecx, dword [esp + 0x18]
add esp, 0xc
lea eax, [ecx + eax*2]
lea ecx, [esp + 0x38]
sub eax, ecx
sar eax, 1
push eax
mov eax, ecx
mov ecx, ebx
push eax
call fcn.00419730
cmp dword [ebx + 0xcc0], 0
je 0x419621
cmp dword [ebx + 0x854], 0
je 0x419621
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push ecx
push 0x20000
lea eax, [esp + 0x54]
mov ecx, ebx
push eax
call fcn.00416d90
test edi, edi
jne 0x419632
test byte [ebx + 0x680], 1
jne 0x4196c6
lea eax, [esp + 0x38]
mov dword [esp + 0x30], esi
xor edi, 1
mov dword [esp + 0x24], eax
test byte [ebx + 0x680], 2
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x34], 2
jne 0x4196ad
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebx + 0xff8], 1
call esi
mov dword [ebx + 0xfe8], eax
lea eax, [esp + 0x24]
push eax
push 1
push dword [ebx + 0x6fc]
push dword [ebx + 0x6f8]
call dword [sym.imp.USER32.dll_SendMessageA]
mov dword [ebx + 0xff8], 0
call esi
sub eax, dword [ebx + 0xfe8]
add dword [ebx + 0xfdc], eax
mov eax, dword [esp + 0x34]
jmp 0x4196b3
xor eax, eax
mov dword [esp + 0x34], eax
mov ecx, eax
sub ecx, 0
je 0x4196e2
sub ecx, 1
jne 0x4196cb
or dword [ebx + 0x680], 1
mov eax, 2
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2178]
xor ecx, esp
call fcn.0047d39f
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebx + 0xff4], 0
jne 0x4196cb
mov eax, dword [ebx + 0x680]
mov ecx, ebx
shr eax, 1
and eax, 1
push eax
call fcn.00419860
mov eax, dword [ebx + 0xb50]
mov ecx, dword [esp + 0x2184]
pop edi
pop esi
add dword [eax + 0x130], 1
pop ebx
adc dword [eax + 0x134], 0
xor ecx, esp
mov eax, dword [esp + 0x28]
call fcn.0047d39f
mov esp, ebp
pop ebp
ret 0xc