Function at 0x40abef
Capabilities:
Resolve function by parsing pe exports
Set thread local storage value

Disassembly:
sub esp, 0xa4
push ebx
push ebp
push esi
mov esi, edx
mov dword [esp + 0x14], ecx
push edi
mov ecx, esi
mov dword [esp + 0x1c], esi
call fcn.00414504
movzx ebx, ax
xor eax, eax
inc eax
test al, bl
jne 0x40afce
push 2
test bx, bx
pop eax
cmove ebx, eax
cmp byte [esp + 0xbc], 0
je 0x40ac38
test al, bl
je 0x40ac38
and ebx, 0xfffd
or ebx, 8
lea eax, [esp + 0x74]
mov dword [esp + 0x74], 0x3c
push eax
xor edi, edi
xor ebp, ebp
and dword [esp + 0x2c], edi
and dword [esp + 0x28], edi
push esi
call dword [sym.imp.USER32.dll_GetWindowInfo]
test eax, eax
je 0x40ad5d
mov esi, dword [esp + 0xb8]
lea eax, [esp + 0x78]
push esi
push eax
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.USER32.dll_IntersectRect]
test eax, eax
mov dword [esp + 0x30], eax
setne cl
mov byte [esp + 0x17], cl
test eax, eax
je 0x40aca3
mov eax, dword [esp + 0x7c]
cmp eax, dword [esi + 4]
jge 0x40ac97
mov edi, eax
sub edi, dword [esi + 4]
mov eax, dword [esp + 0x78]
cmp eax, dword [esi]
jge 0x40aca3
mov ebp, eax
sub ebp, dword [esi]
mov eax, ebx
and eax, 2
mov dword [esp + 0x20], eax
je 0x40ad08
test dword [esp + 0x98], 0x20000000
je 0x40acc3
xor cl, cl
mov byte [esp + 0x17], cl
jmp 0x40ad08
push esi
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.USER32.dll_IntersectRect]
test eax, eax
setne cl
mov byte [esp + 0x17], cl
test eax, eax
je 0x40ad08
mov eax, dword [esp + 0x8c]
cmp eax, dword [esi + 4]
jge 0x40acf7
sub eax, dword [esi + 4]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x88]
cmp eax, dword [esi]
jge 0x40ad08
sub eax, dword [esi]
mov dword [esp + 0x28], eax
cmp dword [esp + 0x30], 0
jne 0x40ad17
test cl, cl
je 0x40afcb
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40ad5d
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push dword [esp + 0x2c]
mov esi, eax
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
test esi, esi
je 0x40ad5d
mov eax, dword [esp + 0x18]
push dword [eax + 0x1c]
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x2c], eax
test eax, eax
jne 0x40ad64
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
xor al, al
jmp 0x40afce
cmp word [esp + 0x20], 0
je 0x40af22
mov eax, dword [esp + 0x1c]
xor ebx, ebx
and dword [esp + 0x60], 0
inc ebx
and dword [esp + 0x64], 0
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x3c]
sub eax, dword [esp + 0x34]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x40]
sub eax, dword [esp + 0x38]
mov dword [esp + 0x6c], eax
lea eax, [esp + 0x54]
push eax
push dword [0x4293a4]
mov dword [esp + 0x64], esi
mov dword [esp + 0x78], ebx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp dword [esp + 0x30], 0
je 0x40ae4b
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_EqualRect]
test eax, eax
jne 0x40ae4b
push esi
call dword [sym.imp.GDI32.dll_SaveDC]
mov dword [esp + 0x20], eax
test ebp, ebp
jne 0x40ade8
test edi, edi
je 0x40adf3
push 0
push edi
push ebp
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
mov edi, dword [esp + 0x18]
lea edx, [esp + 0x44]
push 0
mov ecx, edi
call fcn.0040ab0d
mov ebp, dword [esp + 0x1c]
push 0
push ebx
push 0x85
push ebp
mov byte [esp + 0x64], 0
call dword [sym.imp.USER32.dll_SendMessageW]
cmp byte [esp + 0x54], 0
jne 0x40ae32
push 2
push esi
push 0x317
push ebp
call dword [sym.imp.USER32.dll_DefWindowProcW]
push ebx
lea edx, [esp + 0x48]
mov ecx, edi
call fcn.0040ab0d
push dword [esp + 0x20]
push esi
call dword [sym.imp.GDI32.dll_RestoreDC]
jmp 0x40ae53
mov edi, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
cmp byte [esp + 0x17], bl
jne 0x40af0f
cmp dword [esp + 0x28], 0
jne 0x40ae70
cmp dword [esp + 0x24], 0
mov byte [esp + 0x17], 0
je 0x40ae74
mov byte [esp + 0x17], bl
push esi
call dword [sym.imp.GDI32.dll_SaveDC]
cmp byte [esp + 0x17], 0
mov dword [esp + 0x20], eax
je 0x40ae97
push 0
push dword [esp + 0x28]
push dword [esp + 0x30]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
push 0
lea edx, [esp + 0x38]
mov ecx, edi
call fcn.0040ab0d
push 0
push esi
push 0x14
push ebp
call dword [sym.imp.USER32.dll_SendMessageW]
push dword [esp + 0x20]
neg eax
push esi
sbb eax, eax
inc eax
mov dword [esp + 0x78], eax
call dword [sym.imp.GDI32.dll_RestoreDC]
cmp byte [esp + 0x17], 0
je 0x40aedc
push 0
push dword [esp + 0x28]
push dword [esp + 0x30]
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
xor eax, eax
push eax
push eax
push 0xf
push ebp
mov byte [esp + 0x64], al
call dword [sym.imp.USER32.dll_SendMessageW]
cmp byte [esp + 0x54], 0
jne 0x40af03
push 4
push esi
push 0x317
push ebp
call dword [sym.imp.USER32.dll_DefWindowProcW]
push ebx
lea edx, [esp + 0x38]
mov ecx, edi
call fcn.0040ab0d
push 0
push dword [0x4293a4]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x40afb5
test bl, 4
je 0x40af6f
test ebp, ebp
jne 0x40af2f
test edi, edi
je 0x40af3a
push 0
push edi
push ebp
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x44]
push 0
call fcn.0040ab0d
mov eax, dword [esp + 0x1c]
push 0xe
push esi
push 0x317
push eax
call dword [sym.imp.USER32.dll_DefWindowProcW]
mov ecx, dword [esp + 0x18]
xor ebx, ebx
lea edx, [esp + 0x44]
inc ebx
push ebx
call fcn.0040ab0d
jmp 0x40afb5
test bl, 8
je 0x40afb2
test ebp, ebp
jne 0x40af7c
test edi, edi
je 0x40af87
push 0
push edi
push ebp
push esi
call dword [sym.imp.GDI32.dll_SetViewportOrgEx]
mov ebp, dword [esp + 0x18]
lea edx, [esp + 0x44]
push 0
mov ecx, ebp
call fcn.0040ab0d
mov eax, dword [esp + 0x1c]
push 0
push esi
push eax
call dword [sym.imp.USER32.dll_PrintWindow]
test eax, eax
jne 0x40afae
xor bl, bl
jmp 0x40afb5
mov ecx, ebp
jmp 0x40af60
xor ebx, ebx
inc ebx
push dword [esp + 0x2c]
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
mov al, bl
jmp 0x40afce
xor eax, eax
inc eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa4
ret 8