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

Disassembly:
push 0xffffffffffffffff
push 0x4e5351
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x48
push ebx
push ebp
mov dword [ecx], 0
mov eax, dword [0x55c9d8]
push esi
xor esi, esi
cmp eax, 0xffffffff
push edi
mov dword [esp + 0x10], ecx
je 0x4877a2
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
test esi, esi
jne 0x4877a2
push 0xb8
call fcn.004d576b
add esp, 4
mov dword [esp + 0x28], eax
test eax, eax
mov dword [esp + 0x60], esi
je 0x48773b
mov ecx, eax
call fcn.0047dee0
mov esi, eax
jmp 0x48773d
xor esi, esi
mov eax, dword [0x55c9d8]
push esi
push eax
mov dword [esp + 0x68], 0xffffffff
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
test eax, eax
jne 0x48776f
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x14]
push 0x507ad0
push ecx
mov dword [esp + 0x1c], eax
call fcn.004bade4
push 8
call fcn.004d576b
add esp, 4
mov edi, eax
push 0x55c9e0
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x55c9dc]
push 0x55c9e0
mov dword [edi + 4], edx
mov dword [0x55c9dc], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
inc dword [esi + 4]
mov edi, dword [esp + 0x68]
mov ebx, dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov ebp, 1
push edi
mov dword [esp + 0x64], ebp
call ebx
mov esi, eax
test esi, esi
jne 0x48796b
mov eax, dword [esp + 0x10]
or ebx, 0xffffffff
mov dword [esp + 0x60], ebx
mov dword [eax], 0xa
mov eax, dword [0x55c9d8]
cmp eax, ebx
je 0x48795d
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
xor edi, edi
cmp esi, edi
jne 0x48795d
push 0xb8
call fcn.004d576b
mov esi, eax
add esp, 4
mov dword [esp + 0x68], esi
cmp esi, edi
mov dword [esp + 0x60], 2
je 0x4878f9
lea ecx, [esp + 0x6c]
push ecx
lea ecx, [esi + 0x34]
call fcn.0047dfe0
lea edx, [esp + 0x74]
lea ecx, [esi + 0x44]
push edx
mov byte [esp + 0x64], 3
call fcn.0047dfe0
lea eax, [esp + 0x70]
lea ecx, [esi + 0x88]
push eax
mov byte [esp + 0x64], 4
call fcn.0047dfe0
lea ecx, [esp + 0x68]
mov byte [esp + 0x60], 5
push ecx
lea ecx, [esi + 0x98]
call fcn.0047dfe0
mov byte [esp + 0x34], 0
mov word [esp + 0x36], di
mov ecx, dword [esp + 0x34]
lea edx, [esi + 0x28]
mov word [esp + 0x38], di
mov word [esp + 0x3a], di
mov dword [edx], ecx
mov ecx, dword [esp + 0x38]
xor ax, ax
mov dword [esi + 0x20], 0x33333333
mov dword [edx + 4], ecx
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], ebp
mov dword [esi + 0xc], ebp
mov dword [esi + 0x10], edi
mov dword [esi + 0x14], ebp
mov dword [esi + 0x18], ebp
mov dword [esi + 0x1c], edi
mov dword [esi + 0x24], 0x40073333
mov word [edx + 8], ax
mov dword [esi + 0x54], ebp
mov dword [esi + 0x58], ebp
mov dword [esi + 0x5c], ebp
mov dword [esi + 0x60], ebp
mov dword [esi + 0x64], ebp
mov dword [esi + 0x68], ebp
mov dword [esi + 0x6c], edi
mov dword [esi + 0x70], ebp
mov dword [esi + 0x74], ebp
mov dword [esi + 0x78], edi
mov dword [esi + 0x7c], ebp
mov dword [esi + 0x80], ebp
mov dword [esi + 0x84], edi
mov dword [esi + 0xa8], edi
mov dword [esi + 0xac], edi
mov byte [esi + 0xb0], al
mov dword [esi + 0xb4], edi
jmp 0x4878fb
xor esi, esi
mov edx, dword [0x55c9d8]
push esi
push edx
mov dword [esp + 0x68], ebx
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, edi
jne 0x48792a
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [esp + 0x78], eax
lea eax, [esp + 0x78]
push 0x507ad0
push eax
call fcn.004bade4
push 8
call fcn.004d576b
add esp, 4
mov edi, eax
push 0x55c9e0
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov ecx, dword [0x55c9dc]
push 0x55c9e0
mov dword [edi + 4], ecx
mov dword [0x55c9dc], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
xor eax, eax
jmp 0x487dcd
mov edx, dword [esp + 0x6c]
mov ebp, dword [sym.imp.GDI32.dll_SelectObject]
push edx
push esi
call ebp
mov ecx, dword [esp + 0x6c]
lea eax, [esp + 0x40]
push eax
push 0x18
push ecx
call dword [sym.imp.GDI32.dll_GetObjectA]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x48]
lea ecx, [esp + 0x2c]
push 1
push ecx
push esi
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], eax
call dword [sym.imp.GDI32.dll_DPtoLP]
push edi
call ebx
push edi
mov dword [esp + 0x14], eax
call ebx
push edi
mov dword [esp + 0x6c], eax
call ebx
push edi
mov dword [esp + 0x70], eax
call ebx
mov edx, dword [esp + 0x30]
push 0
mov ebx, eax
mov eax, dword [esp + 0x30]
push 1
push 1
push edx
push eax
mov dword [esp + 0x3c], ebx
call dword [sym.imp.GDI32.dll_CreateBitmap]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
push 0
push 1
push 1
push ecx
push edx
mov dword [esp + 0x2c], eax
call dword [sym.imp.GDI32.dll_CreateBitmap]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x30]
push eax
push ecx
push edi
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x2c]
push edx
push eax
push edi
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
push ecx
push edx
mov dword [esp + 0x2c], eax
call ebp
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1c]
push eax
push ecx
call ebp
mov edx, dword [esp + 0x20]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x6c]
push edx
push eax
call ebp
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x20], eax
push ecx
push ebx
call ebp
push edi
mov dword [esp + 0x28], eax
call dword [sym.imp.GDI32.dll_GetMapMode]
push eax
push esi
call dword [sym.imp.GDI32.dll_SetMapMode]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push 0xcc0020
push 0
push 0
push esi
push edx
push eax
push 0
push 0
push ebx
mov ebx, dword [sym.imp.GDI32.dll_BitBlt]
call ebx
mov ecx, dword [esp + 0x78]
push ecx
push esi
call dword [sym.imp.GDI32.dll_SetBkColor]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x68]
push 0xcc0020
push 0
mov dword [esp + 0x80], eax
mov eax, dword [esp + 0x34]
push 0
push esi
push edx
push eax
push 0
push 0
push ecx
call ebx
mov edx, dword [esp + 0x78]
push edx
push esi
call dword [sym.imp.GDI32.dll_SetBkColor]
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
push 0x330008
push 0
push 0
push eax
mov eax, dword [esp + 0x20]
push ecx
push edx
push 0
push 0
push eax
call ebx
mov ecx, dword [esp + 0x74]
mov edx, dword [esp + 0x70]
mov eax, dword [esp + 0x30]
push 0xcc0020
push ecx
mov ecx, dword [esp + 0x34]
push edx
mov edx, dword [esp + 0x78]
push edi
push eax
push ecx
push 0
push 0
push edx
call ebx
mov eax, dword [esp + 0x68]
push 0x8800c6
push 0
push 0
push eax
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x7c]
push ecx
push edx
push 0
push 0
push eax
call ebx
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push 0x8800c6
push 0
push 0
push ecx
push edx
push eax
push 0
push 0
push esi
call ebx
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x6c]
push 0xee0086
push 0
push 0
push esi
push ecx
push edx
push 0
push 0
push eax
call ebx
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push 0xcc0020
push 0
push 0
push ecx
mov ecx, dword [esp + 0x84]
push edx
mov edx, dword [esp + 0x84]
push eax
push ecx
push edx
push edi
call ebx
mov edi, dword [esp + 0x28]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
push 0xcc0020
push 0
push 0
push edi
push eax
push ecx
push 0
push 0
push esi
call ebx
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
push edx
push eax
call ebp
mov ebx, dword [sym.imp.GDI32.dll_DeleteObject]
push eax
call ebx
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x68]
push ecx
push edx
call ebp
push eax
call ebx
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x6c]
push eax
push ecx
call ebp
push eax
call ebx
mov edx, dword [esp + 0x24]
push edx
push edi
call ebp
push eax
call ebx
mov eax, dword [esp + 0x6c]
mov ebx, dword [sym.imp.GDI32.dll_DeleteDC]
push eax
call ebx
mov ecx, dword [esp + 0x10]
push ecx
call ebx
mov edx, dword [esp + 0x68]
push edx
call ebx
push edi
call ebx
push esi
call ebx
mov eax, dword [0x55c9d8]
or ebp, 0xffffffff
xor edi, edi
xor esi, esi
cmp eax, ebp
mov dword [esp + 0x60], ebp
je 0x487dbf
push eax
call dword [sym.imp.KERNEL32.DLL_TlsGetValue]
mov esi, eax
cmp esi, edi
jne 0x487dbf
push 0xb8
call fcn.004d576b
mov esi, eax
add esp, 4
mov dword [esp + 0x70], esi
cmp esi, edi
mov dword [esp + 0x60], 6
je 0x487d55
mov al, byte [esp + 0x6c]
mov dword [esi + 0x38], edi
mov byte [esi + 0x34], al
mov dword [esi + 0x3c], edi
mov dword [esi + 0x40], edi
lea ecx, [esp + 0x6c]
mov byte [esp + 0x60], 7
push ecx
lea ecx, [esi + 0x44]
call fcn.0047dfe0
lea edx, [esp + 0x74]
lea ecx, [esi + 0x88]
push edx
mov byte [esp + 0x64], 8
call fcn.0047dfe0
lea eax, [esp + 0x70]
lea ecx, [esi + 0x98]
push eax
mov byte [esp + 0x64], 9
call fcn.0047dfe0
mov byte [esp + 0x34], 0
mov word [esp + 0x36], di
mov edx, dword [esp + 0x34]
lea ecx, [esi + 0x28]
mov word [esp + 0x38], di
mov word [esp + 0x3a], di
mov dword [ecx], edx
mov edx, dword [esp + 0x38]
mov ebx, 1
xor ax, ax
mov dword [ecx + 4], edx
mov dword [esi + 0x20], 0x33333333
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
mov dword [esi + 0x10], edi
mov dword [esi + 0x14], ebx
mov dword [esi + 0x18], ebx
mov dword [esi + 0x1c], edi
mov dword [esi + 0x24], 0x40073333
mov word [ecx + 8], ax
mov dword [esi + 0x54], ebx
mov dword [esi + 0x58], ebx
mov dword [esi + 0x5c], ebx
mov dword [esi + 0x60], ebx
mov dword [esi + 0x64], ebx
mov dword [esi + 0x68], ebx
mov dword [esi + 0x6c], edi
mov dword [esi + 0x70], ebx
mov dword [esi + 0x74], ebx
mov dword [esi + 0x78], edi
mov dword [esi + 0x7c], ebx
mov dword [esi + 0x80], ebx
mov dword [esi + 0x84], edi
mov dword [esi + 0xa8], edi
mov dword [esi + 0xac], edi
mov byte [esi + 0xb0], al
mov dword [esi + 0xb4], edi
jmp 0x487d5c
xor esi, esi
mov ebx, 1
mov eax, dword [0x55c9d8]
push esi
push eax
mov dword [esp + 0x68], ebp
call dword [sym.imp.KERNEL32.DLL_TlsSetValue]
cmp eax, edi
jne 0x487d8a
call dword [sym.imp.KERNEL32.DLL_GetLastError]
lea ecx, [esp + 0x68]
push 0x507ad0
push ecx
mov dword [esp + 0x70], eax
call fcn.004bade4
push 8
call fcn.004d576b
add esp, 4
mov edi, eax
push 0x55c9e0
mov dword [edi], esi
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov edx, dword [0x55c9dc]
push 0x55c9e0
mov dword [edi + 4], edx
mov dword [0x55c9dc], edi
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
jmp 0x487dc4
mov ebx, 1
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
mov eax, ebx
mov ecx, dword [esp + 0x58]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x54
ret 0x14