Function at 0x4099c0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov eax, dword [0x5ac004]
xor eax, esp
mov dword [esp + 0x28], eax
movzx eax, word [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
mov edi, dword [ebp + 8]
sub eax, 9
je 0x409e19
sub eax, 1
je 0x409c9c
sub eax, 1
jne 0x409efb
mov dword [esp + 0xc], eax
lea eax, [esp + 0xc]
push eax
push edi
call sym.ProcessHacker.exe_PhParseCommandLinePart
test eax, eax
je 0x409efb
lea ecx, ds:[eax - 8]
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
dec eax
jne 0x409a28
call fcn.004b3960
mov edx, dword [edi]
mov ecx, dword [esp + 0xc]
shr edx, 1
cmp ecx, edx
jae 0x409a52
mov eax, dword [edi + 4]
lea eax, [eax + ecx*2]
lea ebx, [ebx]
cmp word [eax], 0x20
jne 0x409a4e
inc ecx
add eax, 2
cmp ecx, edx
jb 0x409a40
mov dword [esp + 0xc], ecx
lea eax, [esp + 0xc]
push eax
push edi
call sym.ProcessHacker.exe_PhParseCommandLinePart
mov edi, eax
test edi, edi
je 0x409efb
push edi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov eax, dword [edi]
push dword [0x5b1d70]
mov ecx, dword [edi + 4]
mov dword [esp + 0x10], eax
add eax, 0xa
push eax
mov dword [esp + 0x18], ecx
call sym.ProcessHacker.exe_PhCreateObject
mov ebx, eax
xor edx, edx
mov eax, dword [esp + 0xc]
lea ecx, [ebx + 8]
mov dword [ebx + 4], ecx
mov dword [ebx], eax
mov word [ecx + eax], dx
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x409ab3
push eax
push ecx
push dword [ebx + 4]
call fcn.00521a30
add esp, 0xc
push dword [ebx + 4]
call fcn.005224fb
add esp, 4
mov dword [esp + 0x10], 0x16
lea eax, [esp + 0x10]
mov dword [esp + 0x14], str._PROCESSID:
push 0
push eax
push edi
call sym.ProcessHacker.exe_PhFindStringInStringRef
jmp 0x409ae0
cmp eax, 0xffffffff
je 0x409efb
mov ecx, dword [edi]
push dword [0x5b1d70]
shr ecx, 1
sub ecx, eax
lea ebx, [ecx*2 - 0x16]
mov ecx, dword [edi + 4]
add ecx, 0x16
lea eax, [ecx + eax*2]
mov dword [esp + 0x14], eax
lea eax, [ebx + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor eax, eax
lea ecx, [edi + 8]
mov dword [edi], ebx
mov dword [edi + 4], ecx
mov word [ecx + ebx], ax
mov eax, dword [esp + 0x10]
test eax, eax
je 0x409b37
push ebx
push eax
push dword [edi + 4]
call fcn.00521a30
add esp, 0xc
push edi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov edi, eax
lea eax, [esp + 0x24]
push eax
push edi
call sym.ProcessHacker.exe_PhStringToGuid
test eax, eax
js 0x409efb
lfence
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
mov dword [esi], ecx
mov dword [esi + 4], eax
mov eax, dword [esp + 0x2c]
mov dword [esi + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0
push dword [edi + 4]
push str.CLSID_
call sym.ProcessHacker.exe_PhConcatStrings2
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
push 0
push eax
push 0xfffffffffffffff9
push 0x20019
lea eax, [esp + 0x28]
push eax
call sym.ProcessHacker.exe_PhOpenKey
test eax, eax
js 0x409c31
push 0
push dword [esp + 0x1c]
call sym.ProcessHacker.exe_PhQueryRegistryString
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
push 0
push 0x5ae1b8
push dword [esp + 0x20]
mov dword [esi + 0x10], eax
lea eax, [esp + 0x28]
push 0x20019
push eax
call sym.ProcessHacker.exe_PhOpenKey
test eax, eax
js 0x409c11
push 0
push dword [esp + 0x20]
call sym.ProcessHacker.exe_PhQueryRegistryString
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
push eax
mov dword [esi + 0x14], eax
call sym.ProcessHacker.exe_PhExpandEnvironmentStrings
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
nop
test eax, eax
je 0x409c07
mov dword [esi + 0x14], eax
push dword [esp + 0x1c]
call dword [sym.imp.ntdll.dll_NtClose]
push dword [esp + 0x18]
call dword [sym.imp.ntdll.dll_NtClose]
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc
lfence
push dword [edi + 4]
push str.AppID_
call sym.ProcessHacker.exe_PhConcatStrings2
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
push 0
push eax
push 0xfffffffffffffff9
push 0x20019
lea eax, [esp + 0x28]
push eax
call sym.ProcessHacker.exe_PhOpenKey
nop
test eax, eax
js 0x409e03
push 0
push dword [esp + 0x1c]
call sym.ProcessHacker.exe_PhQueryRegistryString
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
push dword [esp + 0x18]
mov dword [esi + 0x10], eax
call dword [sym.imp.ntdll.dll_NtClose]
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc
lea eax, [esp + 0xc]
mov dword [esp + 0xc], 0
push eax
push edi
call sym.ProcessHacker.exe_PhParseCommandLinePart
test eax, eax
je 0x409efb
lea ecx, [eax - 8]
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
dec eax
jne 0x409cca
call fcn.004b3960
mov edx, dword [edi]
mov ecx, dword [esp + 0xc]
shr edx, 1
cmp ecx, edx
jae 0x409cf2
mov eax, dword [edi + 4]
lea eax, [eax + ecx*2]
lea esp, [esp]
cmp word [eax], 0x20
jne 0x409cee
inc ecx
add eax, 2
cmp ecx, edx
jb 0x409ce0
mov dword [esp + 0xc], ecx
lea eax, [esp + 0xc]
push eax
push edi
call sym.ProcessHacker.exe_PhParseCommandLinePart
mov edi, eax
test edi, edi
je 0x409efb
push edi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
lea eax, ds:[esp + 0x1c]
push eax
lea eax, [esp + 0x14]
push eax
push 0x2c
push edi
call sym.ProcessHacker.exe_PhSplitStringRefAtLastChar
test al, al
je 0x409efb
mov ebx, dword [esp + 0x10]
test ebx, ebx
jne 0x409d3e
call sym.ProcessHacker.exe_PhReferenceEmptyString
mov edi, eax
jmp 0x409d72
push dword [0x5b1d70]
lea eax, [ebx + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor ecx, ecx
lea eax, [edi + 8]
mov dword [edi + 4], eax
mov dword [edi], ebx
mov word [eax + ebx], cx
mov eax, dword [esp + 0x14]
test eax, eax
je 0x409d72
push ebx
push eax
push dword [edi + 4]
call fcn.00521a30
add esp, 0xc
push edi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x10], eax
test ebx, ebx
jne 0x409d8d
call sym.ProcessHacker.exe_PhReferenceEmptyString
mov edi, eax
jmp 0x409dc1
push dword [0x5b1d70]
lea eax, [ebx + 0xa]
push eax
call sym.ProcessHacker.exe_PhCreateObject
mov edi, eax
xor ecx, ecx
lea eax, [edi + 8]
mov dword [edi + 4], eax
mov dword [edi], ebx
mov word [eax + ebx], cx
mov eax, dword [esp + 0x20]
test eax, eax
je 0x409dc1
push ebx
push eax
push dword [edi + 4]
call fcn.00521a30
add esp, 0xc
push edi
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov ebx, dword [esp + 0x10]
mov edi, eax
push dword [ebx + 4]
call dword [sym.imp.ntdll.dll_RtlDetermineDosPathNameType_U]
cmp eax, 5
jne 0x409dfe
push dword [ebx + 4]
push 0x54a674
call sym.ProcessHacker.exe_PhGetSystemDirectory
push eax
call sym.ProcessHacker.exe_PhAutoDereferenceObject
mov eax, dword [eax + 4]
push eax
push 3
call fcn.00401500
add esp, 0x10
mov ebx, eax
mov dword [esi], ebx
mov dword [esi + 4], edi
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc
push esi
push 0x409960
push 1
push 1
push 0x5ae1c0
push edi
mov dword [esi], 0
call sym.ProcessHacker.exe_PhParseCommandLine
mov edi, dword [esi]
test edi, edi
je 0x409efb
push dword [0x5b3864]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov eax, dword [esi]
cmp eax, 0x40
jae 0x409e6f
mov dword [esi + eax*4 + 4], edi
mov al, 1
inc dword [esi]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esi + 0x10c]
test ecx, ecx
jne 0x409e9e
push 0x100
push 4
push dword [0x5b1dac]
mov dword [esi + 0x108], 0x40
call dword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov dword [esi + 0x10c], eax
mov ecx, eax
mov eax, dword [esi + 0x104]
mov edx, dword [esi + 0x108]
cmp eax, edx
jne 0x409edc
lea eax, [edx + edx]
mov dword [esi + 0x108], eax
shl eax, 2
push eax
push ecx
push 4
push dword [0x5b1dac]
call dword [sym.imp.ntdll.dll_RtlReAllocateHeap]
mov dword [esi + 0x10c], eax
mov eax, dword [esi + 0x104]
mov ecx, dword [esi + 0x10c]
mov dword [ecx + eax*4], edi
mov al, 1
inc dword [esi + 0x104]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esp + 0x34]
xor al, al
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0051e068
mov esp, ebp
pop ebp
ret 0xc