Function at 0x412e9f
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.0040feb5
movzx eax, ax
mov dword [ebp - 0xc], eax
test al, 1
je 0x412ec6
mov al, 1
jmp 0x4131ea
xor ebx, ebx
cmp ax, bx
jne 0x412ed7
mov dword [ebp - 0xc], 2
mov eax, dword [ebp - 0xc]
cmp byte [ebp + 0x10], bl
je 0x412eeb
test al, 2
je 0x412eeb
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 0x412f1c
xor al, al
jmp 0x4131ea
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 0x412f5f
mov ecx, dword [edi + 4]
mov eax, dword [ebp - 0x98]
cmp eax, ecx
jge 0x412f4e
sub eax, ecx
mov dword [ebp - 0x10], eax
mov ecx, dword [edi]
mov eax, dword [ebp - 0x9c]
cmp eax, ecx
jge 0x412f5f
sub eax, ecx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0xc]
and eax, 2
mov dword [ebp - 0x44], eax
je 0x412fb6
test dword [ebp - 0x7c], 0x20000000
je 0x412f78
mov byte [ebp + 0x13], bl
jmp 0x412fb9
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 0x412fb9
mov ecx, dword [edi + 4]
mov eax, dword [ebp - 0x88]
cmp eax, ecx
jge 0x412fa3
sub eax, ecx
mov dword [ebp - 0x1c], eax
mov ecx, dword [edi]
mov eax, dword [ebp - 0x8c]
cmp eax, ecx
jge 0x412fb9
sub eax, ecx
mov dword [ebp - 0x18], eax
jmp 0x412fb9
mov byte [ebp + 0x13], dl
cmp byte [ebp - 6], bl
jne 0x412fc7
cmp byte [ebp + 0x13], bl
je 0x412ebf
push ebx
call dword [sym.imp.USER32.dll_GetDC]
mov edi, eax
cmp edi, ebx
je 0x412f15
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 0x412f15
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 0x413011
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
jmp 0x412f15
mov byte [ebp - 5], 1
cmp word [ebp - 0x44], bx
je 0x413190
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 [0x423424]
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 0x4130e0
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x2c]
push eax
call dword [sym.imp.USER32.dll_EqualRect]
test eax, eax
jne 0x4130e0
push esi
call dword [sym.imp.GDI32.dll_SaveDC]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x14], ebx
jne 0x413089
cmp dword [ebp - 0x10], ebx
je 0x413097
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.00412dbd
push ebx
push 1
push 0x85
push dword [ebp + 0xc]
mov byte [ebp - 0x64], bl
call edi
cmp byte [ebp - 0x64], bl
jne 0x4130c9
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.00412dbd
push dword [ebp - 0xc]
push esi
call dword [sym.imp.GDI32.dll_RestoreDC]
cmp byte [ebp + 0x13], 1
jne 0x413181
cmp dword [ebp - 0x18], ebx
jne 0x4130f7
mov byte [ebp + 0x13], bl
cmp dword [ebp - 0x1c], ebx
je 0x4130fb
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 0x413118
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.00412dbd
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 0x413152
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 0x413174
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.00412dbd
push ebx
push dword [0x423424]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x4131d6
test byte [ebp - 0xc], 4
je 0x4131f1
cmp dword [ebp - 0x14], ebx
jne 0x4131a0
cmp dword [ebp - 0x10], ebx
je 0x4131ae
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.00412dbd
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.00412dbd
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 0x4131d6
cmp dword [ebp - 0x14], ebx
jne 0x413201
cmp dword [ebp - 0x10], ebx
je 0x41320f
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.00412dbd
push ebx
push esi
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_PrintWindow]
test eax, eax
jne 0x4131ca
mov byte [ebp - 5], bl
jmp 0x4131d6