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

Disassembly:
push 0xffffffffffffffff
push 0x4c25af
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x10
mov eax, dword [0x4ffbf8]
push ebx
push ebp
push esi
xor esi, esi
cmp eax, 0xffffffff
push edi
mov dword [esp + 0x14], ecx
je 0x45ad5c
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x45ad5c
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
mov dword [esp + 0x28], esi
je 0x45acf5
mov ecx, eax
call fcn.00457230
mov esi, eax
jmp 0x45acf7
xor esi, esi
mov eax, dword [0x4ffbf8]
push esi
push eax
mov dword [esp + 0x30], 0xffffffff
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45ad29
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x18]
push 0x4e2f88
push ecx
mov dword [esp + 0x20], 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 ebp, dword [esp + 0x30]
xor edi, edi
mov esi, 1
xor ebx, ebx
cmp ebp, edi
mov dword [esp + 0x28], esi
mov dword [esp + 0x10], edi
jne 0x45ae4a
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], 0xffffffff
mov dword [eax], 5
mov eax, dword [0x4ffbf8]
cmp eax, 0xffffffff
je 0x45b0d1
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b0d1
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
mov dword [esp + 0x28], 2
je 0x45add5
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45add7
xor edi, edi
mov ecx, dword [0x4ffbf8]
push edi
push ecx
mov dword [esp + 0x30], 0xffffffff
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45ae0a
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea edx, [esp + 0x34]
push 0x4e2f88
push edx
mov dword [esp + 0x3c], 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
xor eax, eax
jmp 0x45b1fe
push edi
call dword [sym.imp.USER32.dll_GetDC]
mov edi, eax
test edi, edi
jne 0x45af28
mov ecx, dword [esp + 0x14]
or esi, 0xffffffff
mov dword [esp + 0x28], esi
mov dword [ecx], 0xa
mov eax, dword [0x4ffbf8]
cmp eax, esi
je 0x45b0d1
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b0d1
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
mov dword [esp + 0x28], 3
je 0x45aeb2
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45aeb4
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov dword [esp + 0x30], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b09e
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 [edi + 4]
dec eax
mov dword [edi + 4], eax
xor eax, eax
jmp 0x45b1fe
mov eax, dword [ebp + 0x20]
test eax, eax
je 0x45af33
mov esi, eax
jmp 0x45af38
mov cl, byte [ebp + 0xe]
shl esi, cl
cmp word [ebp + 0xe], 8
jbe 0x45af5a
mov ecx, dword [ebp + 0x10]
xor edx, edx
cmp ecx, 3
setne dl
dec edx
and edx, 3
add edx, eax
lea eax, [ebp + edx*4 + 0x28]
mov dword [esp + 0x30], eax
jmp 0x45af62
lea ecx, [ebp + esi*4 + 0x28]
mov dword [esp + 0x30], ecx
mov eax, dword [esp + 0x34]
test eax, eax
jne 0x45b0df
cmp esi, 0x100
jg 0x45b0f4
push 0x26
push edi
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
test ah, 1
je 0x45b0f4
lea edx, [esi*4 + 8]
push edx
call fcn.004b2d7a
mov edx, eax
add esp, 4
test edx, edx
mov dword [esp + 0x1c], edx
je 0x45b00b
test esi, esi
mov word [edx], 0x300
mov word [edx + 2], si
jle 0x45afd7
lea eax, [edx + 5]
lea ecx, [ebp + 0x29]
mov bl, byte [ecx + 1]
add ecx, 4
mov byte [eax - 1], bl
mov bl, byte [ecx - 4]
mov byte [eax], bl
mov bl, byte [ecx - 5]
mov byte [eax + 1], bl
mov byte [eax + 2], 0
add eax, 4
dec esi
jne 0x45afb9
push edx
call dword [sym.imp.GDI32.dll_CreatePalette]
mov ebx, eax
test ebx, ebx
je 0x45aff9
push 0
push ebx
push edi
call dword [sym.imp.GDI32.dll_SelectPalette]
push edi
mov dword [esp + 0x14], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
mov eax, dword [esp + 0x1c]
push eax
call fcn.004b2da3
add esp, 4
jmp 0x45b0f4
mov ecx, dword [esp + 0x14]
push edi
push 0
mov dword [ecx], 1
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [0x4ffbf8]
or esi, 0xffffffff
xor edi, edi
cmp eax, esi
mov dword [esp + 0x28], esi
je 0x45b0d1
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b0d1
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
mov dword [esp + 0x28], 4
je 0x45b06d
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45b06f
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov dword [esp + 0x30], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b09e
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 [edi + 4]
dec eax
mov dword [edi + 4], eax
xor eax, eax
jmp 0x45b1fe
push 0
push eax
push edi
call dword [sym.imp.GDI32.dll_SelectPalette]
push edi
mov dword [esp + 0x14], eax
call dword [sym.imp.GDI32.dll_RealizePalette]
mov edx, dword [esp + 0x30]
push 0
push ebp
push edx
push 4
push ebp
push edi
call dword [sym.imp.GDI32.dll_CreateDIBitmap]
test ebx, ebx
mov ebp, eax
je 0x45b123
mov eax, dword [esp + 0x10]
push 0
push eax
push edi
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebx
call dword [sym.imp.GDI32.dll_DeleteObject]
jmp 0x45b139
mov eax, dword [esp + 0x34]
test eax, eax
je 0x45b139
mov ecx, dword [esp + 0x10]
push 0
push ecx
push edi
call dword [sym.imp.GDI32.dll_SelectPalette]
push edi
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [0x4ffbf8]
or esi, 0xffffffff
xor edi, edi
cmp eax, esi
mov dword [esp + 0x28], esi
je 0x45b1f5
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x45b1f5
push 0xb8
call fcn.004b2d7a
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
mov dword [esp + 0x28], 5
je 0x45b191
mov ecx, eax
call fcn.00457230
mov edi, eax
jmp 0x45b193
xor edi, edi
mov edx, dword [0x4ffbf8]
push edi
push edx
mov dword [esp + 0x30], esi
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x45b1c2
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 [edi + 4]
dec eax
mov dword [edi + 4], eax
mov eax, ebp
mov ecx, dword [esp + 0x20]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x1c
ret 8