Function at 0x45a480
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push 0xffffffffffffffff
push 0x4c2504
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ebx
mov ebx, ecx
push ebp
push esi
mov dword [ebx], 0
mov eax, dword [0x4ffbf8]
or ebp, 0xffffffff
xor esi, esi
cmp eax, ebp
push edi
je 0x45a54c
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x45a54c
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
mov dword [esp + 0x1c], esi
je 0x45a4e9
mov ecx, eax
call fcn.00457230
mov esi, eax
jmp 0x45a4eb
xor esi, esi
mov eax, dword [0x4ffbf8]
push esi
push eax
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45a519
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x10]
push 0x4e2f88
push ecx
mov dword [esp + 0x18], eax
call fcn.00499f84
push 8
call fcn.004b2d7a
add esp, 4
mov edi, eax
push 0x4ffc00
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x4ffbfc]
push 0x4ffc00
mov dword [edi + 4], edx
mov dword [0x4ffbfc], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
inc dword [esi + 4]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x1c], 1
test eax, eax
jne 0x45a62a
mov dword [ebx], 5
mov eax, dword [0x4ffbf8]
xor edi, edi
cmp eax, ebp
mov dword [esp + 0x1c], ebp
je 0x45a716
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45a716
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x24], eax
test eax, eax
mov dword [esp + 0x1c], 2
je 0x45a5b5
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45a5b7
xor edi, edi
mov eax, dword [0x4ffbf8]
push edi
push eax
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45a6e3
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x24]
push 0x4e2f88
push ecx
mov dword [esp + 0x2c], eax
call fcn.00499f84
push 8
call fcn.004b2d7a
add esp, 4
mov esi, eax
push 0x4ffc00
mov dword [esi], edi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x4ffbfc]
push 0x4ffc00
mov dword [esi + 4], edx
mov dword [0x4ffbfc], esi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [edi + 4]
dec eax
mov dword [edi + 4], eax
xor eax, eax
jmp 0x45a80f
mov bp, word [eax + 0xe]
mov edx, dword [eax + 0x20]
mov ecx, ebp
and ecx, 0xffff
test edx, edx
jne 0x45a644
mov edx, 1
shl edx, cl
mov ecx, dword [eax + 0x10]
mov esi, dword [eax + 4]
mov edi, dword [eax + 8]
test ecx, ecx
je 0x45a724
cmp ecx, 3
je 0x45a724
mov dword [ebx], 7
mov eax, dword [0x4ffbf8]
or esi, 0xffffffff
xor edi, edi
cmp eax, esi
mov dword [esp + 0x1c], esi
je 0x45a716
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45a716
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x24], eax
test eax, eax
mov dword [esp + 0x1c], 3
je 0x45a6b3
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45a6b5
xor edi, edi
mov eax, dword [0x4ffbf8]
push edi
push eax
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45a6e3
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x24]
push 0x4e2f88
push ecx
mov dword [esp + 0x2c], eax
call fcn.00499f84
push 8
call fcn.004b2d7a
add esp, 4
mov esi, eax
push 0x4ffc00
mov dword [esi], edi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x4ffbfc]
push 0x4ffc00
mov dword [esi + 4], edx
mov dword [0x4ffbfc], esi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [edi + 4]
dec eax
mov dword [edi + 4], eax
xor eax, eax
jmp 0x45a80f
cmp bp, 8
lea ecx, [eax + 0x28]
ja 0x45a731
lea ecx, [eax + edx*4 + 0x28]
lea edx, [eax + 0x28]
push edx
push eax
push ecx
mov ecx, ebx
call fcn.0045a830
mov ebx, eax
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov dword [eax], esi
mov eax, edi
cdq
xor eax, edx
or esi, 0xffffffff
sub eax, edx
xor edi, edi
mov dword [ecx], eax
mov eax, dword [0x4ffbf8]
cmp eax, esi
mov dword [esp + 0x1c], esi
je 0x45a806
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45a806
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x24], eax
test eax, eax
mov dword [esp + 0x1c], 4
je 0x45a7a2
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45a7a4
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45a7d3
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x24]
push 0x4e2f88
push eax
call fcn.00499f84
push 8
call fcn.004b2d7a
add esp, 4
mov esi, eax
push 0x4ffc00
mov dword [esi], edi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov ecx, dword [0x4ffbfc]
push 0x4ffc00
mov dword [esi + 4], ecx
mov dword [0x4ffbfc], esi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [edi + 4]
dec eax
mov dword [edi + 4], eax
mov eax, ebx
mov ecx, dword [esp + 0x14]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x10
ret 0xc