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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100fc081
mov eax, dword fs:[0]
push eax
push ecx
sub esp, 0x78
push ebx
push esi
push edi
mov eax, dword [0x10172eb8]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x50], ecx
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x50]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x100170de
call fcn.10016a40
mov dword [ebp - 0x54], eax
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 4]
cmp eax, dword [ebp - 0x54]
jne 0x100170dc
mov ecx, dword [ebp - 0x14]
cmp dword [ecx], 0
je 0x100170dc
push 0xd7
push 0x101117bc
lea ecx, [ebp - 0x1c]
call fcn.1000dcf0
mov dword [ebp - 0x58], eax
mov edx, dword [ebp - 0x58]
mov dword [ebp - 0x5c], edx
mov byte [ebp - 4], 1
push str.CImpersonateUser::ImpersonateUser___User_already_impersonated_in_this_thread_n
mov eax, dword [ebp - 0x5c]
push eax
call fcn.10017b70
add esp, 8
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x1c]
call fcn.1000dd20
mov eax, 1
jmp 0x100172cb
jmp 0x10017146
push 0xdf
push 0x10111828
lea ecx, [ebp - 0x24]
call fcn.1000dcf0
mov dword [ebp - 0x60], eax
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x64], ecx
mov byte [ebp - 4], 2
push str.CImpersonateUser::ImpersonateLogonUser___NULL_data_in_TLS_n
mov edx, dword [ebp - 0x64]
push edx
call fcn.10017b70
add esp, 8
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x24]
call fcn.1000dd20
mov ecx, dword [ebp - 0x50]
call fcn.10016de0
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x10017146
mov dword [ebp - 0x28], 0x1f
push 0x1014f068
lea ecx, [ebp - 0x28]
push ecx
call fcn.100cb4c0
mov edx, dword [ebp - 0x14]
cmp dword [edx], 0
je 0x10017156
mov ecx, dword [ebp - 0x50]
call fcn.10017420
push 0xee
push 0x10111880
lea ecx, [ebp - 0x30]
call fcn.1000dcf0
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x70], eax
mov byte [ebp - 4], 3
push str.CImpersonateUser::ImpersonateLogonUser___User_not_impersonated_n
mov ecx, dword [ebp - 0x70]
push ecx
call fcn.10017b70
add esp, 8
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x30]
call fcn.1000dd20
mov ecx, dword [ebp - 0x50]
call fcn.10017650
mov dword [ebp - 0x74], eax
cmp dword [ebp - 0x74], 0
jne 0x100171fb
push 0xf3
push 0x101118e0
lea ecx, [ebp - 0x38]
call fcn.1000dcf0
mov dword [ebp - 0x78], eax
mov edx, dword [ebp - 0x78]
mov dword [ebp - 0x7c], edx
mov byte [ebp - 4], 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CImpersonateUser::ImpersonateLogonUser___Failed_to_get_user_token____d_n
mov eax, dword [ebp - 0x7c]
push eax
call fcn.10017b70
add esp, 0xc
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x38]
call fcn.1000dd20
mov dword [ebp - 0x3c], 0x1f
push 0x1014f068
lea ecx, [ebp - 0x3c]
push ecx
call fcn.100cb4c0
mov edx, dword [ebp - 0x50]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x10017217
mov ecx, dword [ebp - 0x14]
mov dword [ecx], 1
jmp 0x1001722c
mov dword [ebp - 0x40], 0x1f
push 0x1014f068
lea edx, [ebp - 0x40]
push edx
call fcn.100cb4c0
call fcn.10016a40
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov dword [eax + 4], ecx
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x50]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x100172b8
mov dword [ebp - 4], 0xffffffff
jmp 0x100172c6
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret