Function at 0x4154e4
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe4
push esi
mov dword [ebp - 0x14], 0xde
mov dword [ebp - 0x1c], 0xb0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
test eax, eax
jne 0x415528
push fcn.00418e94
mov eax, dword [0x4217e8]
push eax
mov ecx, dword [0x4217f4]
push ecx
call fcn.00412234
add esp, 0xc
test eax, eax
je 0x4155da
mov edx, dword [0x421814]
xor edx, dword [0x421814]
jne 0x415540
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
test eax, eax
je 0x415573
mov dword [ebp - 0x78], 0x63
mov eax, dword [0x4217e4]
push eax
call fcn.0040bf14
add esp, 4
mov ecx, dword [0x421818]
push ecx
call fcn.00418e94
add esp, 4
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 0x78], eax
jmp 0x4155a0
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [0x421804]
push ecx
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.GDI32.dll_PolylineTo]
mov dword [0x4217e4], eax
mov eax, dword [0x4217ec]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x74], eax
mov edx, dword [0x421800]
push edx
mov eax, dword [0x4217f4]
push eax
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [ebp - 0x1c], eax
mov ecx, dword [0x421814]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [0x4217e0], eax
mov edx, dword [0x421808]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp + 8], eax
jmp 0x415601
mov dword [ebp - 0x9c], 8
mov eax, dword [0x4217e0]
push eax
call fcn.0040bf14
add esp, 4
mov ecx, dword [ebp - 8]
add ecx, dword [0x421804]
mov dword [0x421808], ecx
mov edx, dword [0x4217e0]
push edx
mov eax, dword [0x4217ec]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
mov ecx, dword [0x4217f4]
push ecx
call fcn.00418e94
add esp, 4
cmp esi, eax
jae 0x415632
mov dword [ebp - 0x20], 1
jmp 0x415639
mov dword [ebp - 0x20], 0
mov edx, dword [ebp - 0x80]
push edx
call dword [ebp + 0xc]
add esp, 4
test eax, eax
je 0x415660
mov eax, dword [0x421808]
push eax
call dword [ebp + 0xc]
add esp, 4
test eax, eax
je 0x415660
mov dword [ebp - 0x24], 1
jmp 0x415667
mov dword [ebp - 0x24], 0
mov ecx, dword [ebp - 0x20]
cmp ecx, dword [ebp - 0x24]
je 0x415678
mov dword [ebp - 0x28], 1
jmp 0x41567f
mov dword [ebp - 0x28], 0
cmp dword [ebp - 0x28], 0
je 0x415785
push fcn.0040e4a4
mov edx, dword [0x421820]
push edx
call fcn.0040e4a4
add esp, 8
mov esi, eax
push fcn.0040e4a4
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040e4a4
add esp, 8
cmp esi, eax
jbe 0x4156bd
mov dword [ebp - 0x2c], 1
jmp 0x4156c4
mov dword [ebp - 0x2c], 0
cmp dword [ebp - 0x2c], 0
je 0x415785
mov dword [ebp - 0x7c], 0x87
push fcn.0040bf14
mov ecx, dword [0x421818]
push ecx
call fcn.00415df4
add esp, 8
mov edx, dword [str.AJ]
mov eax, 1
lock xadd dword [edx], eax
inc eax
mov dword [0x4217f8], eax
mov eax, dword [0x4217e8]
xor edx, edx
div dword [ebp + 8]
mov dword [ebp - 0x10], eax
mov ecx, dword [0x421808]
push ecx
mov edx, dword [0x421808]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [0x4217e8]
and ecx, dword [ebp - 0x10]
cmp eax, ecx
jbe 0x415745
mov dword [ebp - 0xa0], 0x21
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 8], eax
jmp 0x415765
mov dword [ebp - 0xa4], 0xda
mov dword [ebp - 0xa8], 0x3b
mov eax, dword [ebp - 0x7c]
push eax
call fcn.0040b7d4
add esp, 4
push fcn.00418e94
mov ecx, dword [0x421818]
push ecx
mov edx, dword [str.AJ]
push edx
call fcn.00412234
add esp, 0xc
jmp 0x4159bd
mov dword [ebp - 0x40], 0x82
mov dword [ebp - 0x18], 0xc4
mov eax, dword [0x4217e8]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
jne 0x4157b7
mov ecx, dword [ebp - 0x18]
xor ecx, dword [str.AJ]
jne 0x4157b7
mov dword [ebp - 0x30], 0
jmp 0x4157be
mov dword [ebp - 0x30], 1
cmp dword [ebp - 0x30], 0
jne 0x415808
mov edx, dword [str.AJ]
push edx
call fcn.00418e94
add esp, 4
test eax, eax
je 0x4157f2
mov eax, dword [0x4217fc]
add eax, dword [0x421818]
mov dword [0x4217e0], eax
je 0x4157f2
mov dword [ebp - 0x34], 1
jmp 0x4157f9
mov dword [ebp - 0x34], 0
cmp dword [ebp - 0x34], 0
jne 0x415808
mov dword [ebp - 0x38], 0
jmp 0x41580f
mov dword [ebp - 0x38], 1
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.00418e94
add esp, 4
mov edx, dword [0x4217f4]
and edx, dword [ebp - 0x14]
cmp eax, edx
je 0x415831
mov dword [ebp - 0x3c], 1
jmp 0x415838
mov dword [ebp - 0x3c], 0
mov eax, dword [ebp - 0x38]
cmp eax, dword [ebp - 0x3c]
jae 0x415883
mov dword [ebp - 0xac], 0xd6
mov dword [ebp - 0xb0], 0x2d
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0x40]
mov dword [ebp - 4], ecx
push fcn.00418e94
mov edx, dword [0x421800]
push edx
call fcn.00415df4
add esp, 8
mov eax, dword [0x4217e4]
add eax, dword [0x4217e0]
mov dword [0x4217e0], eax
jmp 0x4158bd
mov dword [ebp - 0xb4], 0x89
mov ecx, dword [0x421800]
and ecx, dword [0x421814]
mov dword [0x4217ec], ecx
mov eax, dword [0x42180c]
xor edx, edx
div dword [ebp - 0xc]
mov dword [0x42180c], eax
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x421824], eax
push fcn.0040e4a4
mov eax, dword [0x42180c]
push eax
call fcn.0040e4a4
add esp, 8
mov ecx, dword [0x4217ec]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov esi, eax
push fcn.0040bf14
mov eax, dword [0x421800]
push eax
mov ecx, dword [0x421820]
push ecx
call fcn.00412234
add esp, 0xc
cmp esi, eax
jne 0x41590a
mov dword [ebp - 0x44], 1
jmp 0x415911
mov dword [ebp - 0x44], 0
mov edx, dword [ebp - 0x18]
imul edx, dword [0x4217f8]
mov dword [ebp + 8], edx
push fcn.00418e94
mov eax, dword [ebp - 0x40]
push eax
call fcn.00415df4
add esp, 8
cmp dword [ebp + 8], eax
jae 0x41593d
mov dword [ebp - 0x48], 1
jmp 0x415944
mov dword [ebp - 0x48], 0
mov ecx, dword [ebp - 0x44]
cmp ecx, dword [ebp - 0x48]
jne 0x415974
mov edx, dword [0x421800]
or edx, dword [str.AJ]
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0xb8]
push eax
mov ecx, dword [0x421800]
push ecx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [ebp - 0xc], eax
jmp 0x4159bd
mov dword [ebp - 0xbc], 0x14
mov edx, dword [0x4217e4]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x4217ec], eax
mov eax, dword [0x4217f4]
push eax
mov ecx, dword [0x4217f8]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [ebp + 0xc], eax
push fcn.00418e94
mov edx, dword [ebp - 0x80]
push edx
mov eax, dword [0x4217f8]
push eax
call fcn.00412234
add esp, 0xc
mov ecx, dword [str.AJ]
push ecx
call dword [ebp + 0xc]
add esp, 4
mov edx, dword [0x421824]
xor edx, dword [0x421824]
cmp eax, edx
jae 0x4159e3
mov dword [ebp - 0x4c], 1
jmp 0x4159ea
mov dword [ebp - 0x4c], 0
mov eax, dword [ebp - 0xc]
add eax, dword [str.AJ]
mov dword [0x421818], eax
mov ecx, dword [0x4217e4]
push ecx
call dword [ebp + 0xc]
add esp, 4
cmp dword [0x421818], eax
je 0x415a16
mov dword [ebp - 0x50], 1
jmp 0x415a1d
mov dword [ebp - 0x50], 0
mov edx, dword [ebp - 0x4c]
cmp edx, dword [ebp - 0x50]
jae 0x415a2e
mov dword [ebp - 0x54], 1
jmp 0x415a35
mov dword [ebp - 0x54], 0
mov eax, dword [0x421824]
add eax, dword [0x421820]
mov dword [ebp - 0x14], eax
jne 0x415a5c
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jne 0x415a5c
mov dword [ebp - 0x58], 0
jmp 0x415a63
mov dword [ebp - 0x58], 1
mov edx, dword [ebp - 0x54]
cmp edx, dword [ebp - 0x58]
je 0x415c29
mov dword [ebp - 0xc0], 0xbb
mov dword [ebp - 0x84], 0x37
mov dword [ebp - 0xc4], 0x9f
mov eax, dword [ebp - 0xc]
xor edx, edx
div dword [0x4217f0]
mov dword [str.AJ], eax
cmp dword [str.AJ], 0
je 0x415abc
mov eax, dword [ebp - 4]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
je 0x415abc
mov dword [ebp - 0x5c], 1
jmp 0x415ac3
mov dword [ebp - 0x5c], 0
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp + 8]
cmp eax, ecx
je 0x415ae4
mov dword [ebp - 0x60], 1
jmp 0x415aeb
mov dword [ebp - 0x60], 0
mov edx, dword [ebp - 0x5c]
cmp edx, dword [ebp - 0x60]
jae 0x415b13
mov eax, dword [0x4217f0]
xor edx, edx
div dword [0x421804]
mov dword [0x4217f8], eax
mov eax, dword [ebp - 0x10]
push eax
call fcn.0040b7d4
add esp, 4
jmp 0x415b29
mov dword [ebp - 0xc8], 0x37
mov ecx, dword [ebp - 0x1c]
push ecx
call fcn.00418e94
add esp, 4
push fcn.0040e4a4
mov edx, dword [ebp + 8]
push edx
call fcn.0040e4a4
add esp, 8
test eax, eax
jne 0x415b51
mov eax, dword [ebp - 0x84]
push eax
call fcn.0040b7d4
add esp, 4
test eax, eax
je 0x415bb9
mov dword [ebp - 0xcc], 0x89
mov dword [ebp - 0x88], 0xb
mov dword [ebp - 0xd0], 0xb5
mov ecx, dword [0x4217f4]
push ecx
mov edx, dword [0x4217e8]
push edx
mov eax, dword [ebp - 0x88]
push eax
mov ecx, dword [0x421808]
push ecx
call dword [sym.imp.USER32.dll_CallNextHookEx]
mov dword [ebp - 0xc], eax
mov edx, dword [0x421814]
or edx, dword [0x421800]
mov dword [0x4217e0], edx
push fcn.0040e4a4
mov eax, dword [ebp - 0x74]
push eax
call fcn.0040e4a4
add esp, 8
jmp 0x415c01
mov dword [ebp - 0x8c], 0x43
push fcn.0040bf14
mov ecx, dword [0x42180c]
push ecx
mov edx, dword [0x4217e8]
push edx
call fcn.00412234
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [0x4217e8]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [0x4217f4], eax
mov edx, dword [ebp - 4]
imul edx, dword [ebp - 4]
mov dword [ebp - 0x8c], edx
mov eax, dword [0x42181c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 8], eax
push fcn.00418e94
mov ecx, dword [0x4217fc]
push ecx
call fcn.00415df4
add esp, 8
jmp 0x415dbf
mov dword [ebp - 0x98], 0xce
mov dword [ebp - 0x90], 0xa7
mov edx, dword [0x421800]
push edx
call dword [sym.imp.GDI32.dll_CreateBrushIndirect]
test eax, eax
jne 0x415c72
push fcn.0040b7d4
mov eax, dword [0x4217ec]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00412234
add esp, 0xc
test eax, eax
jne 0x415c72
mov dword [ebp - 0x64], 0
jmp 0x415c79
mov dword [ebp - 0x64], 1
mov edx, dword [ebp - 4]
or esi, 0xffffffff
lock xadd dword [edx], esi
dec esi
push fcn.0040b7d4
mov eax, dword [ebp - 0x90]
push eax
call fcn.00415df4
add esp, 8
cmp esi, eax
jne 0x415ca5
mov dword [ebp - 0x68], 1
jmp 0x415cac
mov dword [ebp - 0x68], 0
mov ecx, dword [ebp - 0x64]
cmp ecx, dword [ebp - 0x68]
jne 0x415cbd
mov dword [ebp - 0x6c], 1
jmp 0x415cc4
mov dword [ebp - 0x6c], 0
cmp dword [ebp - 0x6c], 0
je 0x415d50
mov edx, dword [0x4217e8]
push edx
call fcn.0040bf14
add esp, 4
mov ecx, dword [0x4217fc]
or ecx, dword [0x421824]
cmp eax, ecx
jae 0x415cf6
mov dword [ebp - 0x70], 1
jmp 0x415cfd
mov dword [ebp - 0x70], 0
cmp dword [ebp - 0x70], 0
je 0x415d50
mov dword [ebp - 0x94], 0xb7
mov dword [ebp - 0xd4], 0x27
mov dword [ebp - 0xd8], 0xe8
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 0xdc], eax
mov eax, dword [0x4217fc]
push eax
call fcn.0040bf14
add esp, 4
mov ecx, dword [ebp - 8]
sub ecx, dword [0x4217f0]
mov dword [ebp - 0x94], ecx
jmp 0x415d77
mov dword [ebp - 0xe0], 0x22
mov dword [ebp - 0xe4], 0xff
mov edx, dword [str.AJ]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0x74]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [0x4217f8], eax
mov ecx, dword [0x421814]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [0x421814]
push eax
mov ecx, dword [0x4217e4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 8], eax
push fcn.0040bf14
mov edx, dword [0x421800]
push edx
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00412234
add esp, 0xc
mov ecx, dword [str.AJ]
push ecx
call dword [ebp + 0xc]
add esp, 4
mov edx, dword [0x4217e8]
or edx, dword [ebp - 4]
mov dword [0x4217e4], edx
mov eax, dword [ebp - 4]
push eax
call fcn.0040b7d4
add esp, 4
pop esi
mov esp, ebp
pop ebp
ret