Function at 0x418723
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
push esi
mov dword [ebp - 0x14], 0xad
mov dword [ebp - 8], 0xf
mov dword [ebp - 0x10], 0xed
mov dword [ebp - 0xc], 0x4a
mov dword [ebp - 0x30], 0x7b
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
sub ecx, 5
mov dword [ebp - 0x1c], ecx
cmp dword [ebp - 0x1c], 0xbd
ja case.0x418077.1
mov edx, dword [ebp - 0x1c]
movzx eax, byte [edx + 0x418b2c]
jmp dword [eax*4 + 0x418b18]
push fcn.00412234
mov ecx, dword [0x421804]
push ecx
mov edx, dword [0x4217ec]
push edx
call fcn.00417804
add esp, 0xc
mov eax, dword [0x421808]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x421800], eax
jmp 0x41817b
mov dword [ebp - 0x8c], 0x98
mov ecx, dword [ebp - 0x8c]
push ecx
call fcn.00418e94
add esp, 4
jmp 0x41817b
mov edx, dword [0x421824]
push edx
call fcn.00418e94
add esp, 4
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [0x421818]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [ebp - 4], eax
mov edx, dword [0x42180c]
push edx
mov eax, dword [0x4217fc]
push eax
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
mov dword [0x421814], eax
jmp 0x41817b
mov dword [ebp - 0xa4], 0x31
mov ecx, dword [0x4217fc]
or ecx, dword [ebp + 8]
mov dword [0x421800], ecx
mov edx, dword [ebp - 0x88]
push edx
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [ebp - 0xc], eax
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4217f0], eax
jmp 0x41817b
mov dword [ebp - 0x90], 0x4d
mov dword [ebp - 0xa8], 0x98
mov ecx, dword [0x421820]
or ecx, dword [ebp - 0x10]
mov dword [ebp - 0x90], ecx
push fcn.004107c4
mov edx, dword [0x4217f8]
push edx
call fcn.0040e4a4
add esp, 8
mov eax, dword [0x4217fc]
sub eax, dword [0x421820]
mov dword [0x4217e0], eax
mov ecx, dword [0x4217f8]
add ecx, dword [0x4217f4]
cmp dword [0x4217e0], ecx
jbe 0x4181a8
mov dword [ebp - 0x38], 1
jmp 0x4181af
mov dword [ebp - 0x38], 0
cmp dword [ebp - 0x38], 0
je 0x4183bb
push fcn.00415df4
mov edx, dword [0x421820]
push edx
call fcn.0040e4a4
add esp, 8
test eax, eax
je 0x4181ef
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [0x421814]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x4181ef
mov dword [ebp - 0x3c], 1
jmp 0x4181f6
mov dword [ebp - 0x3c], 0
cmp dword [ebp - 0x3c], 0
je 0x4183bb
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [0x421800], eax
push fcn.0040e4a4
mov ecx, dword [0x421808]
push ecx
call fcn.0040e4a4
add esp, 8
test eax, eax
je 0x41823f
mov edx, dword [0x421820]
xor edx, dword [ebp - 8]
je 0x41823f
mov dword [ebp - 0x40], 1
jmp 0x418246
mov dword [ebp - 0x40], 0
cmp dword [ebp - 0x40], 0
je 0x418290
mov eax, dword [0x4217f4]
push eax
mov ecx, dword [0x4217f4]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov esi, eax
mov edx, dword [ebp + 8]
push edx
call fcn.0040b7d4
add esp, 4
cmp esi, eax
jbe 0x41827a
mov dword [ebp - 0x44], 1
jmp 0x418281
mov dword [ebp - 0x44], 0
cmp dword [ebp - 0x44], 0
je 0x418290
mov dword [ebp - 0x48], 1
jmp 0x418297
mov dword [ebp - 0x48], 0
cmp dword [ebp - 0x48], 0
jne 0x4182dd
mov eax, dword [0x4217e8]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov esi, eax
mov ecx, dword [0x4217f8]
push ecx
call fcn.0040b7d4
add esp, 4
cmp esi, eax
jae 0x4182c7
mov dword [ebp - 0x4c], 1
jmp 0x4182ce
mov dword [ebp - 0x4c], 0
cmp dword [ebp - 0x4c], 0
jne 0x4182dd
mov dword [ebp - 0x50], 0
jmp 0x4182e4
mov dword [ebp - 0x50], 1
cmp dword [ebp - 0x50], 0
jne 0x418325
push fcn.00418e94
mov edx, dword [0x4217fc]
push edx
call fcn.004154e4
add esp, 8
test eax, eax
jne 0x418318
mov eax, dword [0x4217f0]
add eax, dword [0x421820]
jne 0x418318
mov dword [ebp - 0x54], 0
jmp 0x41831f
mov dword [ebp - 0x54], 1
cmp dword [ebp - 0x54], 0
je 0x418360
mov dword [ebp - 0xac], 0xc9
mov dword [ebp - 0xb0], 0
mov dword [ebp - 0xb4], 0x4b
mov ecx, dword [0x4217fc]
push ecx
call fcn.0040b7d4
add esp, 4
mov edx, dword [ebp - 0x10]
push edx
call fcn.00418e94
add esp, 4
jmp 0x41838e
mov dword [ebp - 0xb8], 0xca
mov eax, dword [0x4217e8]
push eax
call fcn.0040bf14
add esp, 4
mov ecx, dword [0x4217e4]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [0x42180c], eax
mov eax, dword [0x4217f8]
push eax
mov ecx, dword [0x4217e4]
push ecx
call dword [sym.imp.ole32.dll_CoTreatAsClass]
mov dword [ebp - 4], eax
mov edx, dword [ebp - 0xbc]
add edx, dword [0x4217e0]
mov dword [0x4217e4], edx
jmp 0x41817b
mov eax, dword [0x421800]
xor edx, edx
div dword [0x4217f0]
mov dword [0x421814], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x18], eax
jmp 0x4183de
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 4]
jae 0x41865e
mov esi, dword [0x4217f4]
or esi, dword [0x4217ec]
push fcn.00417804
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.00417804
add esp, 0xc
cmp esi, eax
jne 0x418418
mov dword [ebp - 0x58], 1
jmp 0x41841f
mov dword [ebp - 0x58], 0
mov edx, dword [0x42181c]
imul edx, dword [ebp - 4]
test edx, edx
je 0x418447
mov eax, dword [0x421820]
mov ecx, 1
lock xadd dword [eax], ecx
inc ecx
je 0x418447
mov dword [ebp - 0x5c], 1
jmp 0x41844e
mov dword [ebp - 0x5c], 0
mov edx, dword [ebp - 0x58]
cmp edx, dword [ebp - 0x5c]
jne 0x41845f
mov dword [ebp - 0x60], 1
jmp 0x418466
mov dword [ebp - 0x60], 0
cmp dword [ebp - 0x60], 0
jne 0x4184a6
mov eax, dword [ebp - 0x10]
or esi, 0xffffffff
lock xadd dword [eax], esi
dec esi
mov ecx, dword [ebp - 8]
push ecx
call fcn.0040b7d4
add esp, 4
cmp esi, eax
jbe 0x418490
mov dword [ebp - 0x64], 1
jmp 0x418497
mov dword [ebp - 0x64], 0
cmp dword [ebp - 0x64], 0
jne 0x4184a6
mov dword [ebp - 0x68], 0
jmp 0x4184ad
mov dword [ebp - 0x68], 1
cmp dword [ebp - 0x68], 0
je 0x418539
mov esi, dword [0x421820]
imul esi, dword [0x421800]
mov edx, dword [0x421820]
push edx
mov eax, dword [0x4217fc]
push eax
call dword [sym.imp.GDI32.dll_SelectObject]
cmp esi, eax
jne 0x4184e4
mov dword [ebp - 0x6c], 1
jmp 0x4184eb
mov dword [ebp - 0x6c], 0
cmp dword [ebp - 0x6c], 0
je 0x418539
mov dword [ebp - 0xc0], 0xe0
mov ecx, dword [0x4217e0]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov dword [0x4217f8], eax
mov edx, dword [0x4217e0]
push edx
mov eax, dword [0x4217f8]
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [0x421808], eax
mov ecx, dword [0x4217e4]
xor ecx, dword [0x4217ec]
mov dword [0x421820], ecx
jmp 0x418573
mov dword [ebp - 0xc4], 0xb9
push fcn.00412234
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00417804
add esp, 0xc
mov ecx, dword [ebp - 4]
sub ecx, dword [ebp + 8]
mov dword [ebp - 0x14], ecx
mov eax, dword [0x4217e0]
xor edx, edx
div dword [ebp - 0x88]
mov dword [0x4217e4], eax
mov edx, dword [0x4217f4]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 8], eax
mov eax, dword [0x4217fc]
push eax
mov ecx, dword [str.AJ]
push ecx
call dword [sym.imp.GDI32.dll_SelectObject]
mov dword [0x4217f4], eax
mov edx, dword [0x4217fc]
push edx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov esi, eax
push fcn.0040bf14
mov eax, dword [0x4217e8]
push eax
call fcn.004107c4
add esp, 8
cmp esi, eax
je 0x4185d5
mov ecx, dword [0x421824]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [0x421818], eax
jmp 0x41859b
push fcn.00418e94
mov edx, dword [0x4217f8]
push edx
call fcn.004154e4
add esp, 8
test eax, eax
je 0x41862a
mov eax, dword [ebp - 0x18]
add eax, dword [0x4217e8]
mov dword [ebp - 4], eax
je 0x41862a
mov dword [ebp - 0xc8], 0x2d
mov eax, dword [0x421800]
xor edx, edx
div dword [0x421800]
mov dword [0x421818], eax
push fcn.00418e94
mov ecx, dword [ebp - 4]
push ecx
call fcn.00415df4
add esp, 8
jmp 0x418659
mov dword [ebp - 0x94], 0x8c
mov edx, dword [ebp - 0xcc]
push edx
mov eax, dword [ebp - 0x94]
push eax
mov ecx, dword [0x4217f0]
push ecx
mov edx, dword [str.AJ]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x18], eax
jmp 0x4183d5
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
sub ecx, 0x12
mov dword [ebp - 0x20], ecx
cmp dword [ebp - 0x20], 0xdf
ja case.0x418684.1
mov edx, dword [ebp - 0x20]
movzx eax, byte [edx + 0x418c04]
jmp dword [eax*4 + 0x418bec]
mov dword [ebp - 0xd0], 0xc3
mov ecx, dword [0x4217f4]
push ecx
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [0x421818], eax
mov eax, dword [0x421824]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x421814], eax
mov eax, dword [ebp - 0x30]
xor edx, edx
div dword [0x4217e8]
mov dword [0x4217e8], eax
jmp 0x4187d1
mov dword [ebp - 0xd4], 0xa8
mov dword [ebp - 0xd8], 0x39
mov ecx, dword [0x4217e4]
imul ecx, dword [0x421800]
mov dword [0x421804], ecx
jmp 0x4187d1
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0xc]
mov dword [0x421818], ecx
mov edx, dword [0x421818]
mov dword [0x4217ec], edx
jmp 0x4187d1
mov dword [ebp - 0xdc], 0x97
mov eax, dword [ebp - 0x10]
or eax, dword [0x4217ec]
mov dword [0x421820], eax
mov ecx, dword [0x4217f4]
imul ecx, dword [ebp - 8]
mov dword [0x4217e0], ecx
mov edx, dword [0x4217f8]
push edx
call fcn.0040bf14
add esp, 4
jmp 0x4187d1
mov dword [ebp - 0xe0], 0xfd
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4217e4], eax
mov eax, dword [0x4217f0]
add eax, dword [0x4217e0]
mov dword [ebp - 0xc], eax
jmp 0x4187d1
mov dword [ebp - 0x70], 0xbc
mov dword [ebp - 0x98], 0xd4
mov ecx, dword [ebp - 0x70]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.GDI32.dll_PolylineTo]
mov dword [0x421800], eax
mov ecx, dword [ebp - 0x98]
push ecx
call fcn.0040bf14
add esp, 4
mov edx, dword [ebp - 0x70]
push edx
mov eax, dword [0x421820]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.GDI32.dll_PolylineTo]
mov dword [0x421814], eax
mov eax, dword [0x421808]
xor edx, edx
div dword [ebp - 0xc]
mov dword [0x4217f0], eax
mov edx, dword [ebp - 4]
mov dword [ebp - 0x28], edx
jmp 0x4187f1
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
cmp ecx, dword [0x4217e0]
jae 0x418b08
mov dword [ebp - 0x7c], 0xb1
mov esi, dword [0x421814]
xor esi, dword [ebp - 0x7c]
mov edx, dword [0x4217ec]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp esi, eax
je 0x41882a
mov dword [ebp - 0x74], 1
jmp 0x418831
mov dword [ebp - 0x74], 0
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
call dword [sym.imp.GDI32.dll_SetArcDirection]
test eax, eax
jne 0x41885d
mov edx, dword [ebp - 0x34]
add edx, dword [0x421820]
mov dword [0x421804], edx
jne 0x41885d
mov dword [ebp - 0x78], 0
jmp 0x418864
mov dword [ebp - 0x78], 1
mov eax, dword [ebp - 0x74]
cmp eax, dword [ebp - 0x78]
je 0x41888c
mov dword [ebp - 0xe4], 0x56
push fcn.004154e4
mov ecx, dword [0x421814]
push ecx
call fcn.0040e4a4
add esp, 8
jmp 0x4188a9
mov edx, dword [ebp - 0x7c]
push edx
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov dword [ebp - 0x14], eax
mov eax, dword [0x421808]
sub eax, dword [0x42180c]
mov dword [0x4217f0], eax
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 0x24]
sub edx, 7
mov dword [ebp - 0x24], edx
cmp dword [ebp - 0x24], 0xf1
ja case.0x4188cf.1
mov eax, dword [ebp - 0x24]
movzx ecx, byte [eax + 0x418cfc]
jmp dword [ecx*4 + 0x418ce4]
mov dword [ebp - 0xe8], 0xe5
mov dword [ebp - 0xec], 0xf
mov edx, dword [0x421824]
push edx
call fcn.0040bf14
add esp, 4
jmp 0x41899e
mov dword [ebp - 0xf0], 0x9c
mov dword [ebp - 0xf4], 0x67
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0xa0], eax
jmp 0x41899e
mov dword [ebp - 0xf8], 0xa3
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.00418e94
add esp, 4
jmp 0x41899e
mov dword [ebp - 0xfc], 0x79
mov dword [ebp - 0x100], 0x82
push fcn.00412234
mov edx, dword [0x4217ec]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00417804
add esp, 0xc
jmp 0x41899e
mov ecx, dword [0x421804]
push ecx
call fcn.00418e94
add esp, 4
jmp 0x41899e
mov dword [ebp - 0x9c], 0x84
mov dword [ebp - 0x104], 0x37
mov edx, dword [ebp - 0x9c]
push edx
call fcn.00418e94
add esp, 4
push fcn.00417804
mov eax, dword [ebp - 0xa0]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.00417804
add esp, 0xc
mov esi, eax
mov edx, dword [0x421820]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp esi, eax
jne 0x4189d2
mov dword [ebp - 0x80], 1
jmp 0x4189d9
mov dword [ebp - 0x80], 0
mov eax, dword [str.AJ]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
call dword [sym.imp.OLEAUT32.dll_SafeArrayAllocDescriptor]
test eax, eax
je 0x418a07
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x418a07
mov dword [ebp - 0x84], 1
jmp 0x418a11
mov dword [ebp - 0x84], 0
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebp - 0x84]
jne 0x418a49
mov ecx, dword [ebp - 0x88]
add ecx, dword [0x4217fc]
mov dword [0x4217f4], ecx
mov edx, dword [ebp - 0x108]
push edx
mov eax, dword [0x4217f8]
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov dword [ebp - 8], eax
jmp 0x41899e
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x2c]
sub edx, 0xf
mov dword [ebp - 0x2c], edx
cmp dword [ebp - 0x2c], 0x82
ja case.0x418a6b.1
mov eax, dword [ebp - 0x2c]
movzx ecx, byte [eax + 0x418e08]
jmp dword [ecx*4 + 0x418df0]
mov dword [ebp - 0x10c], 0xc6
mov edx, dword [0x421800]
sub edx, dword [0x4217e0]
mov dword [ebp - 0x30], edx
jmp 0x418b03
mov eax, dword [0x4217ec]
push eax
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [ebp - 8], eax
jmp 0x418b03
mov eax, dword [0x4217e4]
xor edx, edx
div dword [ebp - 0x34]
mov dword [ebp - 0xc], eax
jmp 0x418b03
mov ecx, dword [ebp - 0x110]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [0x42180c], eax
jmp 0x418b03
mov dword [ebp - 0x114], 0x2c
mov edx, dword [ebp - 0x34]
xor edx, dword [0x42181c]
mov dword [0x42180c], edx
jmp 0x418b03
mov dword [ebp - 0x118], 0xbc
mov dword [ebp - 0x11c], 0xcc
push fcn.0040bf14
mov eax, dword [0x421824]
push eax
call fcn.004154e4
add esp, 8
jmp 0x4187e8
mov eax, dword [0x4217ec]
or eax, dword [0x4217f4]
pop esi
mov esp, ebp
pop ebp
ret