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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c25f4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0x10
mov eax, dword [0x4ffbf8]
push ebx
push esi
push edi
or esi, 0xffffffff
mov ebx, ecx
xor edi, edi
cmp eax, esi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x14], ebx
je 0x45b2eb
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b2eb
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [ebp - 0x20], eax
cmp eax, edi
mov dword [ebp - 4], edi
je 0x45b28a
mov ecx, eax
call fcn.00457230
mov edi, eax
mov eax, dword [0x4ffbf8]
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b2b5
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [ebp - 0x18]
push 0x4e2f88
push ecx
mov dword [ebp - 0x18], 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]
or esi, 0xffffffff
inc dword [edi + 4]
mov eax, dword [ebp + 8]
mov dword [ebp - 4], 1
test eax, eax
mov dword [ebx], 0
jne 0x45b3d1
mov dword [ebx], 5
mov eax, dword [0x4ffbf8]
xor edi, edi
cmp eax, esi
mov dword [ebp - 4], esi
je 0x45b4dc
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b4dc
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [ebp + 0x10], eax
test eax, eax
mov dword [ebp - 4], 2
je 0x45b355
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45b357
xor edi, edi
mov eax, dword [0x4ffbf8]
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b382
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [ebp + 0x10]
push 0x4e2f88
push ecx
mov dword [ebp + 0x10], 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
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
mov byte [ebp - 4], 3
lea eax, [edi + edi*2]
lea eax, [eax*8 + 0x1f]
shr eax, 5
shl eax, 2
mov dword [ebp - 0x20], eax
imul eax, ebx
add eax, 0x28
push eax
call fcn.004b2d7a
add esp, 4
mov esi, eax
jmp 0x45b417
test esi, esi
mov dword [ebp - 4], 1
jne 0x45b4f8
mov ecx, dword [ebp - 0x14]
or esi, 0xffffffff
xor edi, edi
mov dword [ebp - 4], esi
mov dword [ecx], 1
mov eax, dword [0x4ffbf8]
cmp eax, esi
je 0x45b4dc
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b4dc
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [ebp + 0x10], eax
test eax, eax
mov dword [ebp - 4], 5
je 0x45b47b
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45b47d
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b4a9
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebp + 0x10], eax
lea eax, [ebp + 0x10]
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
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebp + 8]
push edx
push ebx
lea eax, [esi + 0x28]
push edi
push eax
push ecx
mov ecx, dword [ebp - 0x14]
call fcn.0045bd40
lea edx, [edi + edi*2]
xor eax, eax
mov dword [esi], 0x28
mov dword [esi + 4], edi
lea ecx, [edx*8 + 0x1f]
mov edx, dword [ebp + 0x14]
shr ecx, 3
and ecx, 0x1ffffffc
push edx
imul ecx, ebx
mov dword [esi + 0x14], ecx
mov ecx, dword [ebp - 0x14]
push esi
mov dword [esi + 8], ebx
mov word [esi + 0xc], 1
mov word [esi + 0xe], 0x18
mov dword [esi + 0x10], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x20], eax
mov dword [esi + 0x24], eax
call fcn.0045ac90
push esi
mov ebx, eax
call fcn.004b2da3
mov eax, dword [0x4ffbf8]
or edi, 0xffffffff
add esp, 4
xor esi, esi
cmp eax, edi
mov dword [ebp - 4], edi
je 0x45b614
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x45b614
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [ebp + 0x10], eax
test eax, eax
mov dword [ebp - 4], 6
je 0x45b5b4
mov ecx, eax
call fcn.00457230
mov esi, eax
jmp 0x45b5b6
xor esi, esi
mov eax, dword [0x4ffbf8]
push esi
push eax
mov dword [ebp - 4], edi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b5e1
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [ebp + 0x10]
push 0x4e2f88
push ecx
mov dword [ebp + 0x10], 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]
mov eax, dword [esi + 4]
mov ecx, dword [ebp - 0xc]
dec eax
pop edi
mov dword [esi + 4], eax
mov eax, ebx
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0x10