Function at 0x414566
Capabilities:
Allocate thread local storage

Disassembly:
sub esp, 0x5dc
push ebx
push ebp
push esi
push edi
push 0x18c
xor ebx, ebx
mov byte [esp + 0x1b], dl
mov edi, ecx
push ebx
push edi
call fcn.0041869b
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [edi + 4], eax
cmp eax, 0xffffffff
je 0x4147c1
push ebx
lea edx, [esp + 0x20]
mov ecx, 0x84889911
call fcn.00420763
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.USER32.dll_RegisterWindowMessageW]
mov dword [edi + 8], eax
test eax, eax
je 0x4147c1
xor eax, eax
lea edx, [esp + 0x1c]
inc eax
mov ecx, 0x84889912
push eax
call fcn.00420763
lea eax, [esp + 0x1c]
mov ebp, 0x429568
push eax
push ebx
push 1
push ebp
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [edi + 0xc], eax
test eax, eax
je 0x4147c1
push 1
lea edx, [esp + 0x20]
mov ecx, 0x18782822
call fcn.00420763
lea eax, [esp + 0x1c]
push eax
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [edi + 0x14], eax
test eax, eax
je 0x4147c1
push 1
lea edx, [esp + 0x20]
mov ecx, 0x9878a222
call fcn.00420763
lea eax, [esp + 0x1c]
push eax
push 0x3d09128
push ebx
push 4
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [edi], eax
test eax, eax
je 0x4147c1
push ebx
push ebx
push ebx
push 2
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
test eax, eax
je 0x4147c1
mov dword [edi + 0x10], eax
add eax, 0x128
push ebx
mov dword [edi + 0x18], eax
call dword [sym.imp.USER32.dll_GetDC]
mov ebp, eax
test ebp, ebp
je 0x4147bd
and dword [edi + 0x24], ebx
and dword [edi + 0x28], ebx
mov esi, dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 8
push ebp
call esi
push 0xa
push ebp
mov dword [edi + 0x2c], eax
call esi
mov edx, dword [edi + 0x2c]
lea ecx, [edi + 0x20]
push ebx
push ebx
push ecx
lea ecx, [esp + 0x24]
mov dword [edi + 0x30], eax
push ecx
push eax
mov ecx, ebp
call fcn.0041f799
push ebp
mov ebp, dword [sym.imp.USER32.dll_ReleaseDC]
push ebx
mov dword [edi + 0x1c], eax
call ebp
cmp dword [edi + 0x1c], ebx
je 0x4147bd
mov ecx, dword [esp + 0x18]
mov ax, word [ecx + 0xe]
shr ax, 3
mov byte [edi + 0x38], al
movzx eax, al
imul eax, dword [edi + 0x2c]
test al, 3
je 0x4146db
and eax, 0xfffffffc
add eax, 4
mov dword [edi + 0x34], eax
call fcn.00418601
mov bl, 1
cmp byte [esp + 0x17], bl
jne 0x4147bd
lea ecx, [esp + 0x26c]
xor bl, bl
call fcn.00420ab6
lea ecx, [esp + 0x84]
call fcn.00420ae7
push 0x10
push 0x4297a8
lea eax, [edi + 0x3c]
push eax
call fcn.0041863c
mov eax, dword [esp + 0x262]
mov dword [edi + 0x4c], eax
lea eax, [esp + 0x4b2]
push 0x102
push eax
lea eax, [edi + 0x50]
push eax
call fcn.0041863c
push 1
lea edx, [esp + 0x20]
mov ecx, 0x1898b122
call fcn.00420763
lea eax, [esp + 0x1c]
push eax
push 0
push 0x429568
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [edi + 0x160], eax
test eax, eax
je 0x4147c1
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
test esi, esi
je 0x4147bd
push esi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov dword [edi + 0x154], eax
test eax, eax
je 0x4147b8
xor eax, eax
inc eax
push eax
push eax
push esi
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov dword [edi + 0x15c], eax
test eax, eax
je 0x4147b8
push eax
push dword [edi + 0x154]
call dword [sym.imp.GDI32.dll_SelectObject]
test eax, eax
mov dword [edi + 0x158], eax
push 1
movzx ebx, bl
pop eax
cmovne ebx, eax
push esi
push 0
call ebp
mov al, bl
jmp 0x4147c3
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5dc
ret