Function at 0x420570
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
push ebx
mov ebx, ecx
push esi
push edi
mov dword [esp + 0x10], ebx
cmp byte [ebx + 0x24], 0
mov dword [ebx], 0x4ef300
je 0x4205cb
mov ecx, 0x5281f4
call fcn.00415100
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp byte [0x528210], 0
mov ecx, 1
mov eax, 4
cmovne eax, ecx
sub dword [0x528224], ecx
jne 0x4205c4
push eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor esi, esi
mov dword [esp + 0xc], esi
mov ecx, ebx
call fcn.00421a20
cmp dword [ebx + 0x1c], 0
jne 0x420674
mov edi, dword [ebx + 0xac]
mov dword [esp + 0x14], edi
lea esi, [edi + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [edi + 0x38], 0
jne 0x420602
mov byte [edi + 0x44], 0
jmp 0x420658
lea edx, [ebx + 0xc]
lea eax, [edi + 0x28]
cmp eax, edx
je 0x420658
mov ecx, dword [eax]
mov eax, dword [edx]
mov dword [edi + 0x28], eax
lea eax, [edi + 0x28]
mov dword [edx], ecx
mov ecx, dword [eax]
test ecx, ecx
je 0x420620
mov dword [ecx], eax
mov ecx, dword [edx]
test ecx, ecx
je 0x420628
mov dword [ecx], edx
mov ecx, dword [eax + 4]
mov eax, dword [edx + 4]
mov dword [edi + 0x2c], eax
mov dword [edx + 4], ecx
mov ecx, dword [edi + 0x30]
mov eax, dword [edx + 8]
mov dword [edi + 0x30], eax
mov dword [edx + 8], ecx
mov ecx, dword [edi + 0x34]
mov eax, dword [edx + 0xc]
mov dword [edi + 0x34], eax
mov dword [edx + 0xc], ecx
mov ecx, dword [edi + 0x38]
mov eax, dword [edx + 0x10]
mov dword [edi + 0x38], eax
mov dword [edx + 0x10], ecx
mov eax, dword [esp + 0x14]
mov edi, dword [edi + 8]
push esi
mov dword [eax + 8], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
add dword [ebx + 0x20], edi
mov esi, dword [esp + 0xc]
mov ecx, ebx
call fcn.00421a20
test al, al
je 0x42068d
inc esi
mov dword [esp + 0xc], esi
cmp esi, 0x64
jl 0x4205d1
mov eax, dword [ebx + 0x58]
lea ecx, [ebx + 0x54]
cmp eax, dword [ecx + 8]
jne 0x4206ba
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
jmp 0x4206c4
push ecx
lea ecx, [esp + 0x1c]
call fcn.00422970
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0
push eax
lea ecx, [esp + 0x1c]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 0
call fcn.00422b50
test al, al
jne 0x420780
nop word [eax + eax]
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x1c]
test eax, eax
je 0x420738
cmp byte [eax + 5], 0
je 0x420738
test edi, edi
je 0x420738
mov ecx, dword [edi + 8]
sub ecx, dword [edi + 4]
mov eax, dword [esp + 0x24]
sar ecx, 2
cmp ecx, eax
cmovb eax, ecx
cmp esi, eax
jae 0x420738
mov eax, dword [edi + 4]
mov ecx, dword [eax + esi*4]
jmp 0x42073a
xor ecx, ecx
mov edx, dword [ecx]
mov eax, dword [edx]
cmp eax, 0x430e60
jne 0x420c43
push 1
call dword [edx + 4]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x42076e
cmp byte [eax + 5], 0
je 0x42076e
test edi, edi
je 0x42076e
inc esi
lea ecx, [esp + 0x18]
mov dword [esp + 0x20], esi
call fcn.00422c10
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x1c]
call fcn.00422b50
test al, al
je 0x420700
mov ecx, dword [esp + 0x28]
or esi, 0xffffffff
test ecx, ecx
je 0x42085a
cmp byte [ecx + 5], 0
je 0x420842
mov edx, dword [esp + 0x2c]
test edx, edx
je 0x420842
add dword [edx + 0x10], esi
jne 0x420842
xor eax, eax
cmp byte [ecx + 5], al
cmovne eax, edx
mov dword [esp + 0xc], eax
mov edx, dword [eax + 8]
mov edi, dword [eax + 4]
cmp edi, edx
je 0x420810
cmp dword [edi], 0
je 0x4207d0
add edi, 4
cmp edi, edx
jne 0x4207c4
cmp edi, edx
je 0x420810
lea eax, [edi + 4]
mov esi, edx
sub esi, eax
xor ecx, ecx
add esi, 3
shr esi, 2
cmp eax, edx
cmova esi, ecx
mov dword [esp + 0x14], esi
test esi, esi
je 0x420809
mov ebx, esi
mov esi, dword [eax]
test esi, esi
je 0x4207fd
mov dword [edi], esi
add edi, 4
inc ecx
add eax, 4
cmp ecx, ebx
jne 0x4207f2
mov ebx, dword [esp + 0x10]
mov eax, dword [esp + 0xc]
or esi, 0xffffffff
mov ecx, dword [eax + 4]
cmp edi, ecx
jne 0x420821
cmp edx, dword [eax + 8]
jne 0x420821
mov dword [eax + 8], ecx
jmp 0x420842
cmp edi, edx
je 0x420842
mov esi, dword [eax + 8]
sub esi, edx
push esi
push edx
push edi
call fcn.004a8100
mov ecx, dword [esp + 0x18]
lea eax, [esi + edi]
add esp, 0xc
or esi, 0xffffffff
mov dword [ecx + 8], eax
mov ecx, dword [esp + 0x28]
mov eax, esi
lock xadd dword [ecx], eax
sub eax, 1
jne 0x42085a
push ecx
call fcn.0046101e
add esp, 4
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x420935
cmp byte [ecx + 5], 0
je 0x42091d
mov edx, dword [esp + 0x1c]
test edx, edx
je 0x42091d
add dword [edx + 0x10], 0xffffffff
jne 0x42091d
xor eax, eax
cmp byte [ecx + 5], al
cmovne eax, edx
mov dword [esp + 0xc], eax
mov edx, dword [eax + 8]
mov edi, dword [eax + 4]
cmp edi, edx
je 0x4208eb
nop dword [eax]
cmp dword [edi], 0
je 0x4208ac
add edi, 4
cmp edi, edx
jne 0x4208a0
cmp edi, edx
je 0x4208eb
lea eax, [edi + 4]
mov esi, edx
sub esi, eax
xor ecx, ecx
add esi, 3
shr esi, 2
cmp eax, edx
cmova esi, ecx
mov dword [esp + 0x14], esi
test esi, esi
je 0x4208e7
mov ebx, esi
nop
mov esi, dword [eax]
test esi, esi
je 0x4208db
mov dword [edi], esi
add edi, 4
inc ecx
add eax, 4
cmp ecx, ebx
jne 0x4208d0
mov ebx, dword [esp + 0x10]
mov eax, dword [esp + 0xc]
mov ecx, dword [eax + 4]
cmp edi, ecx
jne 0x4208fc
cmp edx, dword [eax + 8]
jne 0x4208fc
mov dword [eax + 8], ecx
jmp 0x42091a
cmp edi, edx
je 0x42091a
mov esi, dword [eax + 8]
sub esi, edx
push esi
push edx
push edi
call fcn.004a8100
mov ecx, dword [esp + 0x18]
lea eax, [esi + edi]
add esp, 0xc
mov dword [ecx + 8], eax
or esi, 0xffffffff
mov ecx, dword [esp + 0x18]
mov eax, esi
lock xadd dword [ecx], eax
sub eax, 1
jne 0x420935
push ecx
call fcn.0046101e
add esp, 4
mov edi, dword [ebx + 0xb8]
mov dword [ebx + 0xb8], 0
test edi, edi
je 0x4209c4
call fcn.00428a20
mov ecx, dword [0x51f2e4]
push ecx
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, eax
test edx, edx
jne 0x42096c
call fcn.00428da0
mov edx, eax
mov eax, dword [esp + 0x10]
mov eax, dword [eax + 4]
mov dword [edx + eax*8], 0
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 4]
mov eax, dword [eax + 8]
mov dword [edx + ecx*8 + 4], eax
mov edx, dword [edi]
test edx, edx
je 0x4209bb
lea ecx, [edx + 4]
mov eax, esi
lock xadd dword [ecx], eax
sub eax, 1
jne 0x4209bb
lea eax, [edx + 4]
xor ecx, ecx
test eax, eax
cmovne ecx, edx
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
cmp eax, 0x412fc0
jne 0x420c4a
push 1
call dword [edx + 8]
push edi
call fcn.0046101e
add esp, 4
mov esi, dword [ebx + 0xac]
mov ecx, dword [esi + 0x24]
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [esi + 0x3c], 0
mov ecx, dword [esi + 0x24]
mov eax, dword [ecx]
call dword [eax + 8]
mov ecx, dword [ebx + 0xac]
or esi, 0xffffffff
mov dword [ebx + 0xac], 0
test ecx, ecx
je 0x420a15
lea edx, [ecx + 4]
mov eax, esi
lock xadd dword [edx], eax
sub eax, 1
jne 0x420a15
test edx, edx
cmove ecx, eax
test ecx, ecx
je 0x420a15
mov eax, dword [ecx]
push 1
call dword [eax]
mov ecx, dword [ebx + 0xb0]
mov dword [ebx + 0xb0], 0
test ecx, ecx
je 0x420a55
lea edx, [ecx + 4]
mov eax, esi
lock xadd dword [edx], eax
sub eax, 1
jne 0x420a55
test edx, edx
cmove ecx, eax
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
cmp eax, 0x412fc0
jne 0x420c51
test ecx, ecx
je 0x420a55
push 1
call dword [edx + 8]
mov ecx, dword [ebx + 0xb4]
mov dword [ebx + 0xb4], 0
test ecx, ecx
je 0x420a95
lea edx, [ecx + 4]
mov eax, esi
lock xadd dword [edx], eax
sub eax, 1
jne 0x420a95
test edx, edx
cmove ecx, eax
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
cmp eax, 0x412fc0
jne 0x420c58
test ecx, ecx
je 0x420a95
push 1
call dword [edx + 8]
call fcn.00422220
mov ecx, dword [0x51f2e4]
mov edi, eax
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, eax
test ecx, ecx
jne 0x420ab6
call fcn.00428da0
mov ecx, eax
mov eax, dword [edi + 4]
lea ecx, [ecx + eax*8]
mov eax, dword [ecx + 4]
cmp eax, dword [edi + 8]
je 0x420ac8
xor eax, eax
jmp 0x420aca
mov eax, dword [ecx]
cmp eax, ebx
jne 0x420b03
call fcn.00422220
mov ecx, dword [0x51f2e4]
mov edi, eax
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, eax
test edx, edx
jne 0x420aef
call fcn.00428da0
mov edx, eax
mov eax, dword [edi + 4]
mov dword [edx + eax*8], 0
mov ecx, dword [edi + 4]
mov eax, dword [edi + 8]
mov dword [edx + ecx*8 + 4], eax
mov edi, dword [ebx + 0xb8]
test edi, edi
je 0x420b1d
mov ecx, edi
call fcn.004289b0
push edi
call fcn.0046101e
add esp, 4
mov edx, dword [ebx + 0xb4]
test edx, edx
je 0x420b51
lea edi, [edx + 4]
mov eax, esi
lock xadd dword [edi], eax
sub eax, 1
jne 0x420b51
xor ecx, ecx
test edi, edi
cmovne ecx, edx
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
cmp eax, 0x412fc0
jne 0x420c5f
push 1
call dword [edx + 8]
mov edx, dword [ebx + 0xb0]
test edx, edx
je 0x420b85
lea edi, [edx + 4]
mov eax, esi
lock xadd dword [edi], eax
sub eax, 1
jne 0x420b85
xor ecx, ecx
test edi, edi
cmovne ecx, edx
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
cmp eax, 0x412fc0
jne 0x420c66
push 1
call dword [edx + 8]
mov ecx, dword [ebx + 0xac]
test ecx, ecx
je 0x420bab
lea edx, [ecx + 4]
mov eax, esi
lock xadd dword [edx], eax
sub eax, 1
jne 0x420bab
test edx, edx
je 0x420bab
test ecx, ecx
je 0x420bab
mov eax, dword [ecx]
push 1
call dword [eax]
lea ecx, [ebx + 0x90]
call fcn.00422330
mov edx, dword [ebx + 0x88]
test edx, edx
je 0x420bd5
lea eax, [edx + 4]
lock xadd dword [eax], esi
sub esi, 1
jne 0x420bd5
mov eax, dword [edx + 8]
push edx
call eax
add esp, 4
lea ecx, [ebx + 0x6c]
call fcn.00422330
lea ecx, [ebx + 0x54]
call fcn.00422330
lea ecx, [ebx + 0x40]
call fcn.004224b0
push 8
push 1
push dword [ebx + 0x40]
call fcn.00405760
add esp, 0xc
mov dword [ebx + 0x40], 0
lea ecx, [ebx + 0x28]
call fcn.00420ca0
lea ecx, [ebx + 0xc]
call fcn.004224b0
push 8
push 1
push dword [ebx + 0xc]
call fcn.00405760
mov dword [ebx + 0xc], 0
add esp, 0xc
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x420c36
mov eax, dword [ecx]
push 1
call dword [eax]
pop edi
pop esi
mov dword [ebx], 0x4ef2f0
pop ebx
mov esp, ebp
pop ebp
ret
call eax
jmp 0x42074e
call eax
jmp 0x4209bb
call eax
jmp 0x420a55
call eax
jmp 0x420a95
call eax
jmp 0x420b51
call eax
jmp 0x420b85