Function at 0x41b368
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa0
push ebx
push esi
push edi
push dword [ebp + 0xc]
mov edi, eax
call fcn.0041ca78
movzx eax, ax
mov dword [ebp - 0xc], eax
test al, 1
je 0x41b38f
mov al, 1
jmp 0x41b6b3
xor ebx, ebx
cmp ax, bx
jne 0x41b3a0
mov dword [ebp - 0xc], 2
mov eax, dword [ebp - 0xc]
cmp byte [ebp + 0x10], bl
je 0x41b3b4
test al, 2
je 0x41b3b4
and eax, 0xfffd
or eax, 8
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0xa0]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0xa0], 0x3c
call dword [sym.imp.USER32.dll_GetWindowInfo]
test eax, eax
jne 0x41b3e5
xor al, al
jmp 0x41b6b3
mov esi, dword [sym.imp.USER32.dll_IntersectRect]
push edi
lea eax, [ebp - 0x9c]
push eax
lea eax, [ebp - 0x3c]
push eax
call esi
test eax, eax
setne dl
mov byte [ebp - 6], dl
cmp dl, bl
je 0x41b428
mov ecx, dword [edi + 4]
mov eax, dword [ebp - 0x98]
cmp eax, ecx
jge 0x41b417
sub eax, ecx
mov dword [ebp - 0x10], eax
mov ecx, dword [edi]
mov eax, dword [ebp - 0x9c]
cmp eax, ecx
jge 0x41b428
sub eax, ecx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0xc]
and eax, 2
mov dword [ebp - 0x44], eax
je 0x41b47f
test dword [ebp - 0x7c], 0x20000000
je 0x41b441
mov byte [ebp + 0x13], bl
jmp 0x41b482
push edi
lea eax, [ebp - 0x8c]
push eax
lea eax, [ebp - 0x2c]
push eax
call esi
test eax, eax
setne byte [ebp + 0x13]
cmp byte [ebp + 0x13], bl
je 0x41b482
mov ecx, dword [edi + 4]
mov eax, dword [ebp - 0x88]
cmp eax, ecx
jge 0x41b46c
sub eax, ecx
mov dword [ebp - 0x1c], eax
mov ecx, dword [edi]
mov eax, dword [ebp - 0x8c]
cmp eax, ecx
jge 0x41b482
sub eax, ecx
mov dword [ebp - 0x18], eax
jmp 0x41b482
mov byte [ebp + 0x13], dl
cmp byte [ebp - 6], bl
jne 0x41b490
cmp byte [ebp + 0x13], bl
je 0x41b388
push ebx
call dword [sym.imp.USER32.dll_GetDC]
mov edi, eax
cmp edi, ebx
je 0x41b3de
push edi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push edi
push ebx
mov esi, eax
call dword [sym.imp.USER32.dll_ReleaseDC]
cmp esi, ebx
je 0x41b3de
mov edi, dword [ebp + 8]
push dword [edi + 0x1c]
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [ebp - 0x40], eax
cmp eax, ebx
jne 0x41b4da
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
jmp 0x41b3de
mov byte [ebp - 5], 1
cmp word [ebp - 0x44], bx
je 0x41b659
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x24]
sub eax, dword [ebp - 0x2c]
mov dword [ebp - 0x5c], esi
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x28]
mov dword [ebp - 0x48], 1
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x64]
push eax
push dword [0x423ea4]
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x54], ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp byte [ebp - 6], 1
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
jne 0x41b5a9
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x2c]
push eax
call dword [sym.imp.USER32.dll_EqualRect]
test eax, eax
jne 0x41b5a9
push esi
call dword [sym.imp.GDI32.dll_SaveDC]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x14], ebx
jne 0x41b552
cmp dword [ebp - 0x10], ebx
je 0x41b560
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
mov eax, dword [ebp + 8]
push ebx
lea ecx, [ebp - 0x3c]
call fcn.0041b286
push ebx
push 1
push 0x85
push dword [ebp + 0xc]
mov byte [ebp - 0x64], bl
call edi
cmp byte [ebp - 0x64], bl
jne 0x41b592
push 2
push esi
push 0x317
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_DefWindowProcW]
mov eax, dword [ebp + 8]
push 1
lea ecx, [ebp - 0x3c]
call fcn.0041b286
push dword [ebp - 0xc]
push esi
call dword [sym.imp.GDI32.dll_RestoreDC]
cmp byte [ebp + 0x13], 1
jne 0x41b64a
cmp dword [ebp - 0x18], ebx
jne 0x41b5c0
mov byte [ebp + 0x13], bl
cmp dword [ebp - 0x1c], ebx
je 0x41b5c4
mov byte [ebp + 0x13], 1
push esi
call dword [sym.imp.GDI32.dll_SaveDC]
mov dword [ebp - 0xc], eax
cmp byte [ebp + 0x13], bl
je 0x41b5e1
push ebx
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
mov eax, dword [ebp + 8]
push ebx
lea ecx, [ebp - 0x2c]
call fcn.0041b286
push ebx
push esi
push 0x14
push dword [ebp + 0xc]
call edi
push dword [ebp - 0xc]
neg eax
sbb eax, eax
inc eax
push esi
mov dword [ebp - 0x48], eax
call dword [sym.imp.GDI32.dll_RestoreDC]
cmp byte [ebp + 0x13], bl
je 0x41b61b
push ebx
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
push ebx
push ebx
push 0xf
push dword [ebp + 0xc]
mov byte [ebp - 0x64], bl
call edi
cmp byte [ebp - 0x64], bl
jne 0x41b63d
push 4
push esi
push 0x317
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_DefWindowProcW]
mov eax, dword [ebp + 8]
push 1
lea ecx, [ebp - 0x2c]
call fcn.0041b286
push ebx
push dword [0x423ea4]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x41b69f
test byte [ebp - 0xc], 4
je 0x41b6ba
cmp dword [ebp - 0x14], ebx
jne 0x41b669
cmp dword [ebp - 0x10], ebx
je 0x41b677
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
push ebx
lea ecx, [ebp - 0x3c]
mov eax, edi
call fcn.0041b286
push 0xe
push esi
push 0x317
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_DefWindowProcW]
push 1
lea ecx, [ebp - 0x3c]
mov eax, edi
call fcn.0041b286
push dword [ebp - 0x40]
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
mov al, byte [ebp - 5]
pop edi
pop esi
pop ebx
leave
ret 0xc
test byte [ebp - 0xc], 8
je 0x41b69f
cmp dword [ebp - 0x14], ebx
jne 0x41b6ca
cmp dword [ebp - 0x10], ebx
je 0x41b6d8
push ebx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
push ebx
lea ecx, [ebp - 0x3c]
mov eax, edi
call fcn.0041b286
push ebx
push esi
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_PrintWindow]
test eax, eax
jne 0x41b693
mov byte [ebp - 5], bl
jmp 0x41b69f