Function at 0x412f53
Capabilities:
Allocate thread local storage
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe4
push esi
mov dword [ebp - 0xc], 0x89
mov dword [ebp - 0x20], 0xce
mov dword [ebp - 0x2c], 0xef
mov dword [ebp - 4], 0xba
push fcn.0040d0d3
mov eax, dword [0x41c0c4]
push eax
mov ecx, dword [0x41c124]
push ecx
call fcn.00413893
add esp, 0xc
mov esi, eax
push fcn.0040d0d3
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0xc]
push eax
call fcn.00413893
add esp, 0xc
cmp esi, eax
je 0x412fb7
mov dword [ebp - 0x30], 1
jmp 0x412fbe
mov dword [ebp - 0x30], 0
mov ecx, dword [0x41c134]
push ecx
mov edx, dword [0x41c0cc]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x412fec
mov eax, dword [0x41c118]
and eax, dword [0x41c130]
je 0x412fec
mov dword [ebp - 0x34], 1
jmp 0x412ff3
mov dword [ebp - 0x34], 0
mov ecx, dword [ebp - 0x30]
cmp ecx, dword [ebp - 0x34]
je 0x413004
mov dword [ebp - 0x38], 1
jmp 0x41300b
mov dword [ebp - 0x38], 0
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [0x41c0cc]
push eax
mov ecx, dword [0x41c134]
push ecx
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [0x41c12c]
or ecx, dword [0x41c0c8]
cmp eax, ecx
je 0x41303f
mov dword [ebp - 0x3c], 1
jmp 0x413046
mov dword [ebp - 0x3c], 0
mov edx, dword [ebp - 0x38]
cmp edx, dword [ebp - 0x3c]
jne 0x4131a1
mov dword [ebp - 0xa8], 0xdc
push fcn.0040d5a3
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040ab83
add esp, 8
mov esi, eax
push fcn.0040cca3
mov ecx, dword [0x41c110]
push ecx
mov edx, dword [str.p4vH_]
push edx
call fcn.00413893
add esp, 0xc
cmp esi, eax
je 0x4130d2
mov dword [ebp - 0xac], 0x11
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [0x41c134]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [0x41c0c8], eax
push fcn.0040d5a3
mov edx, dword [0x41c0c4]
push edx
call fcn.0040b613
add esp, 8
mov eax, dword [str.p4vH_]
push eax
call fcn.0040cca3
add esp, 4
jmp 0x41305c
mov ecx, dword [0x41c118]
push ecx
mov edx, dword [0x41c110]
push edx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [0x41c130], eax
mov eax, dword [str.p4vH_]
xor eax, dword [0x41c124]
mov dword [0x41c0cc], eax
mov ecx, dword [str.p4vH_]
push ecx
mov edx, dword [0x41c0c8]
push edx
call fcn.0040d5a3
add esp, 8
cmp dword [0x41c0cc], eax
jbe 0x413122
mov dword [ebp - 0x40], 1
jmp 0x413129
mov dword [ebp - 0x40], 0
mov eax, dword [ebp - 0x2c]
and eax, dword [0x41c0d0]
mov dword [ebp - 0xc], eax
je 0x41315b
mov eax, dword [0x41c0d8]
xor edx, edx
div dword [0x41c0d0]
mov dword [0x41c0d0], eax
cmp dword [0x41c0d0], 0
je 0x41315b
mov dword [ebp - 0x44], 1
jmp 0x413162
mov dword [ebp - 0x44], 0
mov ecx, dword [ebp - 0x40]
cmp ecx, dword [ebp - 0x44]
jne 0x413190
mov dword [ebp - 0xb0], 0x3a
mov dword [ebp - 0xb4], 0xec
mov edx, dword [str.p4vH_]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp - 0x28], eax
jmp 0x41319c
mov eax, dword [ebp + 8]
imul eax, dword [ebp - 0x2c]
mov dword [0x41c11c], eax
jmp 0x412f79
mov ecx, dword [0x41c12c]
push ecx
mov edx, dword [0x41c120]
push edx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [ebp - 4], eax
mov eax, dword [0x41c118]
mov dword [ebp - 8], eax
jmp 0x4131cb
mov ecx, dword [ebp - 8]
add ecx, 1
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 8]
cmp edx, dword [ebp - 0x28]
jae 0x413452
mov dword [ebp - 0x58], 0xf5
mov dword [ebp - 0x10], 0xda
mov eax, dword [ebp - 0x10]
imul eax, dword [0x41c0cc]
mov dword [ebp + 8], eax
mov ecx, dword [ebp - 0x58]
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x18], edx
mov eax, dword [ebp + 8]
xor eax, dword [ebp - 4]
mov dword [ebp - 0x54], eax
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [ebp - 0x54]
jbe 0x413218
mov dword [ebp - 0x48], 1
jmp 0x41321f
mov dword [ebp - 0x48], 0
cmp dword [ebp - 0x48], 0
je 0x413299
mov edx, dword [0x41c118]
push edx
mov eax, dword [0x41c11c]
push eax
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
test eax, eax
je 0x41325f
mov ecx, dword [0x41c0d4]
push ecx
mov edx, dword [0x41c128]
push edx
call fcn.0040d5a3
add esp, 8
test eax, eax
je 0x41325f
mov dword [ebp - 0x4c], 1
jmp 0x413266
mov dword [ebp - 0x4c], 0
cmp dword [ebp - 0x4c], 0
je 0x413299
mov dword [ebp - 0xb8], 0xa2
mov eax, dword [0x41c130]
push eax
call fcn.0040cca3
add esp, 4
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0xbc], eax
jmp 0x4131f2
mov edx, dword [ebp - 8]
mov dword [ebp - 0x24], edx
cmp dword [ebp - 0x24], 0x60
je 0x4132f4
cmp dword [ebp - 0x24], 0x78
je 0x4132b3
cmp dword [ebp - 0x24], 0x7f
je 0x4132d5
jmp 0x413313
mov dword [ebp - 0xc0], 0x65
mov dword [ebp - 0x50], 0x20
mov eax, dword [ebp - 4]
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 0x50]
mov dword [0x41c124], ecx
jmp 0x413328
mov dword [ebp - 0xc4], 0xea
mov edx, dword [0x41c124]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
mov dword [str.p4vH_], eax
jmp 0x413328
mov dword [ebp - 0xc8], 0x3d
mov ecx, dword [0x41c120]
push ecx
mov edx, dword [ebp - 0x20]
push edx
call fcn.0040d5a3
add esp, 8
jmp 0x413328
mov eax, dword [0x41c0c4]
push eax
mov ecx, dword [ebp - 0x54]
push ecx
call dword [sym.imp.GDI32.dll_SetArcDirection]
mov dword [0x41c0d8], eax
push fcn.0040d5a3
mov edx, dword [ebp - 0x10]
push edx
call fcn.0040ab83
add esp, 8
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x58]
jne 0x41335b
mov ecx, dword [str.p4vH_]
imul ecx, dword [0x41c124]
test ecx, ecx
jne 0x41335b
mov dword [ebp - 0x5c], 0
jmp 0x413362
mov dword [ebp - 0x5c], 1
push fcn.0040ab83
mov edx, dword [ebp - 0x14]
push edx
call fcn.0040ab83
add esp, 8
test eax, eax
je 0x41339d
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [str.p4vH_]
push edx
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.USER32.dll_CallNextHookEx]
test eax, eax
je 0x41339d
mov dword [ebp - 0x60], 1
jmp 0x4133a4
mov dword [ebp - 0x60], 0
mov ecx, dword [ebp - 0x5c]
cmp ecx, dword [ebp - 0x60]
jae 0x4133b5
mov dword [ebp - 0x64], 1
jmp 0x4133bc
mov dword [ebp - 0x64], 0
cmp dword [ebp - 0x64], 0
jne 0x413402
mov edx, dword [0x41c0c4]
push edx
mov eax, dword [0x41c11c]
push eax
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov esi, eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [0x41c0c0]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp esi, eax
jne 0x4133f5
mov dword [ebp - 0x68], 1
jmp 0x4133fc
mov dword [ebp - 0x68], 0
cmp dword [ebp - 0x68], 0
je 0x413431
mov dword [ebp - 0xcc], 0xc0
push fcn.0040ab83
mov eax, dword [0x41c128]
push eax
call fcn.0040ab83
add esp, 8
mov ecx, dword [ebp - 0x18]
imul ecx, dword [0x41c124]
mov dword [0x41c0c0], ecx
jmp 0x41344d
mov dword [ebp - 0xd0], 0x34
mov edx, dword [0x41c12c]
and edx, dword [0x41c120]
mov dword [0x41c12c], edx
jmp 0x4131c2
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x20]
mov dword [0x41c124], eax
jne 0x413481
push fcn.0040d0d3
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call fcn.00413893
add esp, 0xc
test eax, eax
jne 0x413481
mov dword [ebp - 0x6c], 0
jmp 0x413488
mov dword [ebp - 0x6c], 1
mov esi, dword [0x41c118]
imul esi, dword [0x41c0c0]
mov eax, dword [0x41c110]
push eax
call fcn.0040cca3
add esp, 4
cmp esi, eax
jne 0x4134b0
mov dword [ebp - 0x70], 1
jmp 0x4134b7
mov dword [ebp - 0x70], 0
mov ecx, dword [ebp - 0x6c]
cmp ecx, dword [ebp - 0x70]
jae 0x4134dc
mov edx, dword [ebp - 0xd4]
push edx
mov eax, dword [0x41c118]
push eax
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [0x41c128], eax
jmp 0x413452
mov ecx, dword [ebp - 0x20]
mov dword [0x41c0bc], ecx
mov edx, dword [0x41c0bc]
mov dword [0x41c120], edx
mov eax, dword [0x41c0c8]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp dword [0x41c120], eax
jbe 0x41350e
mov dword [ebp - 0x74], 1
jmp 0x413515
mov dword [ebp - 0x74], 0
push fcn.0040cca3
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [0x41c11c]
push edx
call fcn.00413893
add esp, 0xc
test eax, eax
je 0x413551
mov eax, dword [0x41c134]
push eax
mov ecx, dword [str.p4vH_]
push ecx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
test eax, eax
je 0x413551
mov dword [ebp - 0x78], 1
jmp 0x413558
mov dword [ebp - 0x78], 0
mov edx, dword [ebp - 0x74]
cmp edx, dword [ebp - 0x78]
jbe 0x41369d
mov dword [ebp - 0x9c], 0xa
mov eax, dword [ebp - 0x18]
push eax
call fcn.0040cca3
add esp, 4
mov eax, dword [0x41c0d4]
xor edx, edx
div dword [ebp - 0x14]
mov dword [0x41c0c8], eax
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov esi, eax
mov ecx, dword [0x41c110]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
cmp esi, eax
jae 0x4135af
mov dword [ebp - 0x7c], 1
jmp 0x4135b6
mov dword [ebp - 0x7c], 0
cmp dword [ebp - 0x7c], 0
jne 0x413604
mov eax, dword [0x41c0bc]
push eax
mov ecx, dword [0x41c124]
push ecx
call fcn.0040d5a3
add esp, 8
mov esi, eax
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [0x41c0c0]
push eax
mov ecx, dword [0x41c0c8]
push ecx
call dword [sym.imp.GDI32.dll_PolylineTo]
cmp esi, eax
jne 0x4135f7
mov dword [ebp - 0x80], 1
jmp 0x4135fe
mov dword [ebp - 0x80], 0
cmp dword [ebp - 0x80], 0
je 0x41364e
mov dword [ebp - 0xd8], 0xe
mov dword [ebp - 0xdc], 0x4d
mov edx, dword [ebp - 0x2c]
mov dword [0x41c0c8], edx
mov eax, dword [0x41c0c8]
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [str.p4vH_]
push edx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [ebp + 8], eax
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x41c11c], eax
jmp 0x413689
push fcn.0040ab83
mov ecx, dword [0x41c12c]
push ecx
call fcn.0040b613
add esp, 8
mov edx, dword [0x41c124]
mov eax, 1
lock xadd dword [edx], eax
inc eax
mov dword [ebp - 0x9c], eax
push fcn.0040ab83
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.0040b613
add esp, 8
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x41c118], eax
jmp 0x413863
mov dword [ebp - 0xa0], 0x99
mov eax, dword [0x41c134]
or eax, dword [0x41c134]
mov dword [0x41c130], eax
mov ecx, dword [0x41c110]
push ecx
call dword [sym.imp.GDI32.dll_CreateBrushIndirect]
mov esi, eax
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.OLEAUT32.dll_SafeArrayCopy]
cmp esi, eax
je 0x4136e4
mov dword [ebp - 0x84], 1
jmp 0x4136ee
mov dword [ebp - 0x84], 0
mov ecx, dword [0x41c128]
and ecx, dword [ebp - 0xc]
mov dword [0x41c0d8], ecx
je 0x413721
mov edx, dword [ebp - 0xc]
imul edx, dword [ebp - 4]
mov dword [0x41c124], edx
cmp dword [0x41c124], 0
je 0x413721
mov dword [ebp - 0x88], 1
jmp 0x41372b
mov dword [ebp - 0x88], 0
mov eax, dword [ebp - 0x84]
cmp eax, dword [ebp - 0x88]
jae 0x413745
mov dword [ebp - 0x8c], 1
jmp 0x41374f
mov dword [ebp - 0x8c], 0
mov ecx, dword [0x41c0c8]
imul ecx, dword [0x41c118]
mov dword [ebp + 0xc], ecx
mov edx, dword [0x41c118]
push edx
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, dword [ebp + 0xc]
jbe 0x413781
mov dword [ebp - 0x90], 1
jmp 0x41378b
mov dword [ebp - 0x90], 0
mov ecx, dword [ebp - 0x8c]
cmp ecx, dword [ebp - 0x90]
jne 0x4137a5
mov dword [ebp - 0x94], 1
jmp 0x4137af
mov dword [ebp - 0x94], 0
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4137de
mov ecx, dword [0x41c110]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsFree]
test eax, eax
jne 0x4137de
mov dword [ebp - 0x98], 0
jmp 0x4137e8
mov dword [ebp - 0x98], 1
mov edx, dword [ebp - 0x94]
cmp edx, dword [ebp - 0x98]
je 0x413824
mov dword [ebp - 0xe0], 0x66
mov eax, dword [ebp - 0xa0]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp - 0x1c], eax
mov ecx, dword [0x41c0cc]
and ecx, dword [0x41c12c]
mov dword [0x41c12c], ecx
jmp 0x413863
mov dword [ebp - 0xe4], 0x8a
mov dword [ebp - 0xa4], 0x3c
push fcn.0040b613
mov edx, dword [ebp + 8]
push edx
call fcn.0040b613
add esp, 8
push fcn.0040cca3
mov eax, dword [str.p4vH_]
push eax
mov ecx, dword [ebp - 0xa4]
push ecx
call fcn.00413893
add esp, 0xc
mov edx, dword [0x41c12c]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x41c0d8], eax
mov eax, dword [0x41c120]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
pop esi
mov esp, ebp
pop ebp
ret