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

Disassembly:
push 0xffffffffffffffff
push 0x4aa744
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
push ebx
push ebp
push esi
push edi
mov edi, ecx
xor ebx, ebx
mov ecx, 0x4e7ef0
mov dword [edi], ebx
call fcn.00446ce0
mov ecx, dword [eax + 4]
add eax, 4
inc ecx
mov dword [eax], ecx
mov esi, dword [esp + 0x50]
mov dword [esp + 0x44], ebx
cmp esi, ebx
je 0x452899
mov eax, dword [esp + 0x4c]
cmp eax, ebx
jne 0x4528c1
mov ecx, 0x4e7ef0
mov dword [edi], 5
mov dword [esp + 0x44], 0xffffffff
call fcn.00446ce0
mov ecx, dword [eax + 4]
add eax, 4
dec ecx
mov dword [eax], ecx
xor eax, eax
jmp 0x452cb1
push 0x26
push eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
and eax, 0x2000
cmp eax, 0x2000
je 0x4529a0
mov dword [edi], 0x1a
mov eax, dword [0x4e7ef0]
or edi, 0xffffffff
xor esi, esi
cmp eax, edi
mov dword [esp + 0x44], edi
je 0x452b5f
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
cmp esi, ebx
jne 0x452b5f
push 0xb8
call fcn.0049c3ad
add esp, 4
mov dword [esp + 0x54], eax
cmp eax, ebx
mov dword [esp + 0x44], 1
je 0x45292f
mov ecx, eax
call fcn.00446ab0
mov esi, eax
jmp 0x452931
xor esi, esi
mov eax, dword [0x4e7ef0]
push esi
push eax
mov dword [esp + 0x4c], edi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x45295f
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x54]
push 0x4ca180
push ecx
mov dword [esp + 0x5c], eax
call fcn.00483664
push 8
call fcn.0049c3ad
add esp, 4
mov edi, eax
push 0x4e7ef8
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x4e7ef4]
push 0x4e7ef8
mov dword [edi + 4], edx
mov dword [0x4e7ef4], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
xor eax, eax
jmp 0x452cb1
mov ebp, dword [esp + 0x58]
mov ecx, dword [esp + 0x54]
lea eax, [esp + 0x10]
mov dword [esp + 0x10], ebx
push eax
push ebp
push ecx
push esi
mov ecx, edi
call fcn.0044e250
mov esi, eax
cmp esi, ebx
jne 0x452a90
mov dword [edi], 1
mov eax, dword [0x4e7ef0]
or edi, 0xffffffff
xor esi, esi
cmp eax, edi
mov dword [esp + 0x44], edi
je 0x452b5f
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
cmp esi, ebx
jne 0x452b5f
push 0xb8
call fcn.0049c3ad
add esp, 4
mov dword [esp + 0x54], eax
cmp eax, ebx
mov dword [esp + 0x44], 2
je 0x452a1a
mov ecx, eax
call fcn.00446ab0
mov esi, eax
jmp 0x452a1c
xor esi, esi
mov edx, dword [0x4e7ef0]
push esi
push edx
mov dword [esp + 0x4c], edi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x452b2c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [esp + 0x54], eax
lea eax, [esp + 0x54]
push 0x4ca180
push eax
call fcn.00483664
push 8
call fcn.0049c3ad
add esp, 4
mov edi, eax
push 0x4e7ef8
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov ecx, dword [0x4e7ef4]
push 0x4e7ef8
mov dword [edi + 4], ecx
mov dword [0x4e7ef4], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
xor eax, eax
jmp 0x452cb1
push esi
call dword [sym.imp.KERNEL32.DLL_GlobalLock]
cmp eax, ebx
jne 0x452b6d
push esi
call dword [sym.imp.KERNEL32.DLL_GlobalFree]
mov dword [edi], 1
mov eax, dword [0x4e7ef0]
or edi, 0xffffffff
xor esi, esi
cmp eax, edi
mov dword [esp + 0x44], edi
je 0x452b5f
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
cmp esi, ebx
jne 0x452b5f
push 0xb8
call fcn.0049c3ad
add esp, 4
mov dword [esp + 0x54], eax
cmp eax, ebx
mov dword [esp + 0x44], 3
je 0x452afb
mov ecx, eax
call fcn.00446ab0
mov esi, eax
jmp 0x452afd
xor esi, esi
mov edx, dword [0x4e7ef0]
push esi
push edx
mov dword [esp + 0x4c], edi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x452b2c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [esp + 0x54], eax
lea eax, [esp + 0x54]
push 0x4ca180
push eax
call fcn.00483664
push 8
call fcn.0049c3ad
add esp, 4
mov edi, eax
push 0x4e7ef8
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov ecx, dword [0x4e7ef4]
push 0x4e7ef8
mov dword [edi + 4], ecx
mov dword [0x4e7ef4], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
xor eax, eax
jmp 0x452cb1
mov ecx, dword [esp + 0x54]
push 0xcc0020
lea edx, [esp + 0x18]
push ebx
push edx
mov edx, dword [esp + 0x6c]
push eax
mov eax, dword [esp + 0x78]
push ebp
push ecx
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x7c]
push ebx
push ebx
push eax
mov eax, dword [esp + 0x80]
push ecx
mov ecx, dword [esp + 0x74]
push edx
push eax
push ecx
mov dword [esp + 0x48], 0x28
mov dword [esp + 0x50], ebp
mov word [esp + 0x54], 1
mov word [esp + 0x56], 0x18
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], ebx
mov dword [esp + 0x6c], ebx
call dword [sym.imp.GDI32.dll_StretchDIBits]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.DLL_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.DLL_GlobalFree]
mov esi, dword [esp + 0x1c]
mov eax, dword [0x4e7ef0]
xor edx, edx
cmp edi, esi
sete dl
or edi, 0xffffffff
xor esi, esi
cmp eax, edi
mov ebp, edx
mov dword [esp + 0x44], edi
je 0x452ca8
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
cmp esi, ebx
jne 0x452ca8
push 0xb8
call fcn.0049c3ad
add esp, 4
mov dword [esp + 0x54], eax
cmp eax, ebx
mov dword [esp + 0x44], 4
je 0x452c45
mov ecx, eax
call fcn.00446ab0
mov esi, eax
jmp 0x452c47
xor esi, esi
mov eax, dword [0x4e7ef0]
push esi
push eax
mov dword [esp + 0x4c], edi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, ebx
jne 0x452c75
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x54]
push 0x4ca180
push ecx
mov dword [esp + 0x5c], eax
call fcn.00483664
push 8
call fcn.0049c3ad
add esp, 4
mov edi, eax
push 0x4e7ef8
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x4e7ef4]
push 0x4e7ef8
mov dword [edi + 4], edx
mov dword [0x4e7ef4], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
mov eax, ebp
mov ecx, dword [esp + 0x3c]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x38
ret 0x20