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

Disassembly:
push 0xffffffffffffffff
push 0x4c2724
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push ebp
mov ebp, ecx
push esi
xor ebx, ebx
push edi
mov ecx, 0x4ffbf8
mov dword [esp + 0x10], ebp
mov dword [ebp], ebx
call fcn.00457460
mov ecx, dword [eax + 4]
add eax, 4
inc ecx
mov dword [eax], ecx
mov esi, dword [esp + 0x40]
mov edi, dword [esp + 0x48]
cmp esi, edi
mov dword [esp + 0x2c], ebx
ja 0x45c8e5
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x4c]
cmp ecx, eax
ja 0x45c8e5
cmp esi, edi
je 0x45c8ec
cmp ecx, eax
je 0x45c8ec
mov ebp, dword [esp + 0x38]
sub edi, esi
sub eax, ecx
cmp edi, ebp
ja 0x45c8d9
cmp eax, dword [esp + 0x3c]
ja 0x45c8d9
imul eax, edi
lea eax, [eax + eax*2]
push eax
push 0x42
call dword [sym.imp.KERNEL32.DLL_GlobalAlloc]
cmp eax, ebx
mov dword [esp + 0x38], eax
jne 0x45c5ee
mov ecx, dword [esp + 0x10]
mov dword [ecx], 1
jmp 0x45c8ec
push eax
call dword [sym.imp.KERNEL32.DLL_GlobalLock]
cmp eax, ebx
jne 0x45c613
mov edx, dword [esp + 0x38]
push edx
call dword [sym.imp.KERNEL32.DLL_GlobalFree]
mov eax, dword [esp + 0x10]
mov dword [eax], 1
jmp 0x45c8ec
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x34]
lea ecx, [ebp + ebp*2]
lea edx, [edi + edi*2]
mov dword [esp + 0x18], ecx
lea ecx, [eax + esi*2]
mov eax, dword [esp + 0x3c]
add esi, ecx
xor ebp, ebp
cmp eax, ebx
mov dword [esp + 0x14], edx
mov dword [esp + 0x48], esi
jbe 0x45c811
cmp ebp, dword [esp + 0x4c]
jae 0x45c66d
cmp ebp, dword [esp + 0x44]
jb 0x45c66d
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x48]
mov edi, dword [esp + 0x40]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov eax, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [esp + 0x40], eax
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
add edx, ecx
mov ecx, 0x4ffbf8
mov dword [esp + 0x48], edx
call fcn.00457460
cmp dword [eax + 4], 1
jne 0x45c7fa
mov eax, dword [0x4ffbf8]
xor edi, edi
cmp eax, 0xffffffff
je 0x45c73e
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x45c739
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x20], eax
cmp eax, ebx
mov byte [esp + 0x2c], 1
je 0x45c6d5
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45c6d7
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov byte [esp + 0x34], bl
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x45c706
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [esp + 0x34], eax
lea eax, [esp + 0x34]
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 [0x4ffbf8]
cmp dword [edi], ebx
je 0x45c7fa
xor edi, edi
cmp eax, 0xffffffff
je 0x45c7eb
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x45c7eb
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x20], eax
cmp eax, ebx
mov byte [esp + 0x2c], 2
je 0x45c787
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45c789
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov byte [esp + 0x34], bl
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x45c7b8
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
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 edx, dword [esp + 0x3c]
push edx
push ebp
call dword [edi]
neg eax
sbb eax, eax
inc eax
jmp 0x45c7fc
xor eax, eax
cmp eax, ebx
jne 0x45c91e
mov eax, dword [esp + 0x3c]
inc ebp
cmp ebp, eax
jb 0x45c641
mov ebp, dword [esp + 0x38]
push ebp
call dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
mov eax, dword [0x4ffbf8]
or esi, 0xffffffff
xor edi, edi
cmp eax, esi
mov dword [esp + 0x2c], esi
je 0x45c8ce
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x45c8ce
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x3c], eax
cmp eax, ebx
mov dword [esp + 0x2c], 4
je 0x45c86b
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45c86d
xor edi, edi
mov ecx, dword [0x4ffbf8]
push edi
push ecx
mov dword [esp + 0x34], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x45c89c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea edx, [esp + 0x3c]
push 0x4e2f88
push edx
mov dword [esp + 0x44], 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 eax, dword [0x4ffbfc]
push 0x4ffc00
mov dword [esi + 4], eax
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, ebp
jmp 0x45c909
mov ecx, dword [esp + 0x10]
mov dword [ecx], 5
jmp 0x45c8ec
mov dword [ebp], 5
mov ecx, 0x4ffbf8
mov dword [esp + 0x2c], 0xffffffff
call fcn.00457460
mov ecx, dword [eax + 4]
add eax, 4
dec ecx
mov dword [eax], ecx
xor eax, eax
mov ecx, dword [esp + 0x24]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x20
ret 0x1c
mov esi, dword [esp + 0x38]
push esi
call dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.DLL_GlobalFree]
mov eax, dword [esp + 0x10]
or esi, 0xffffffff
xor edi, edi
mov dword [esp + 0x2c], esi
mov dword [eax], 0xe
mov eax, dword [0x4ffbf8]
cmp eax, esi
je 0x45c9ec
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
cmp edi, ebx
jne 0x45c9ec
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x3c], eax
cmp eax, ebx
mov dword [esp + 0x2c], 3
je 0x45c989
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45c98b
xor edi, edi
mov ecx, dword [0x4ffbf8]
push edi
push ecx
mov dword [esp + 0x34], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x45c9ba
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea edx, [esp + 0x3c]
push 0x4e2f88
push edx
mov dword [esp + 0x44], 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 eax, dword [0x4ffbfc]
push 0x4ffc00
mov dword [esi + 4], eax
mov dword [0x4ffbfc], esi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
dec dword [edi + 4]
jmp 0x45c907