Function at 0x10172f80
Capabilities:
Get session user name

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1023de0b
mov eax, dword fs:[0]
push eax
sub esp, 0x65c
mov eax, dword [0x102e91c0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
lea eax, [ebp - 0x668]
push eax
push str.S_1_5_18
call dword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidW]
lea eax, [ebp - 0x664]
mov dword [ebp - 0x62c], 0x101
push eax
lea eax, [ebp - 0x62c]
push eax
lea eax, [ebp - 0x628]
push eax
lea eax, [ebp - 0x62c]
push eax
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x668]
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
test eax, eax
jne 0x101730c4
test edi, edi
je 0x10173026
mov esi, dword [edi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IsSystemProcess:_LookupAccountSid_Error__u_n
push str.ProcessUtils
push 0x1025b044
push 0x32
push edi
jmp 0x101730a1
cmp dword [0x102eec44], 0
je 0x10173077
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x102eec44]
mov ecx, esi
push eax
push str.IsSystemProcess:_LookupAccountSid_Error__u_n
push 0x1025b044
push 0x1025b044
push str.ProcessUtils
push str.OOBEUtils
push 0x32
call dword [0x1024852c]
call esi
add esp, 0x1c
push dword [ebp - 0x668]
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor al, al
jmp 0x1017334f
mov esi, dword [0x102eec48]
test esi, esi
je 0x101730b1
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IsSystemProcess:_LookupAccountSid_Error__u_n
push str.ProcessUtils
push 0x1025b044
push 0x32
push dword [0x102eec48]
mov esi, dword [esi + 0x34]
mov ecx, esi
call dword [0x1024852c]
call esi
add esp, 0x18
push dword [ebp - 0x668]
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor al, al
jmp 0x1017334f
lea eax, [ebp - 0x648]
mov dword [ebp - 0x648], 0x101
push eax
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
jne 0x1017317d
test edi, edi
je 0x1017310b
mov esi, dword [edi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IsSystemProcess:_GetUserName_Error__u_n
push str.ProcessUtils
push 0x1025b044
push 0x32
push edi
jmp 0x101730a1
cmp dword [0x102eec44], 0
je 0x1017315c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [0x102eec44]
mov ecx, esi
push eax
push str.IsSystemProcess:_GetUserName_Error__u_n
push 0x1025b044
push 0x1025b044
push str.ProcessUtils
push str.OOBEUtils
push 0x32
call dword [0x1024852c]
call esi
add esp, 0x1c
push dword [ebp - 0x668]
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor al, al
jmp 0x1017334f
mov esi, dword [0x102eec48]
test esi, esi
je 0x101730b1
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IsSystemProcess:_GetUserName_Error__u_n
jmp 0x1017308f
lea ecx, [ebp - 0x218]
mov dword [ebp - 0x644], 0
mov dword [ebp - 0x634], 0
lea edx, [ecx + 2]
mov dword [ebp - 0x630], 0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x101731a4
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x644]
call fcn.1000aef0
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x420]
mov dword [ebp - 0x660], 0
lea edx, [ecx + 2]
mov dword [ebp - 0x650], 0
mov dword [ebp - 0x64c], 0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x101731f4
sub ecx, edx
lea eax, [ebp - 0x420]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x660]
call fcn.1000aef0
mov byte [ebp - 4], 1
test edi, edi
je 0x1017324c
cmp dword [ebp - 0x630], 8
lea eax, [ebp - 0x644]
mov esi, dword [edi]
cmovae eax, dword [ebp - 0x644]
push eax
push str.IsSystemProcess:_got_user_name_from_SYSTEM_sid___s
push str.ProcessUtils
push 0x1025b044
push 0xa
push edi
jmp 0x101732c8
mov esi, dword [0x102eec44]
test esi, esi
je 0x10173295
cmp dword [ebp - 0x630], 8
lea eax, [ebp - 0x644]
mov ecx, esi
cmovae eax, dword [ebp - 0x644]
push eax
push str.IsSystemProcess:_got_user_name_from_SYSTEM_sid___s
push 0x1025b044
push 0x1025b044
push str.ProcessUtils
push str.OOBEUtils
push 0xa
call dword [0x1024852c]
call esi
add esp, 0x1c
jmp 0x101732d8
mov ecx, dword [0x102eec48]
test ecx, ecx
je 0x101732d8
cmp dword [ebp - 0x630], 8
lea eax, [ebp - 0x644]
mov esi, dword [ecx]
cmovae eax, dword [ebp - 0x644]
push eax
push str.IsSystemProcess:_got_user_name_from_SYSTEM_sid___s
push str.ProcessUtils
push 0x1025b044
push 0xa
push ecx
mov esi, dword [esi + 0x34]
mov ecx, esi
call dword [0x1024852c]
call esi
add esp, 0x18
cmp dword [ebp - 0x64c], 8
lea ecx, [ebp - 0x660]
mov edx, dword [ebp - 0x634]
lea esi, [ebp - 0x644]
cmovae ecx, dword [ebp - 0x660]
cmp dword [ebp - 0x630], 8
cmovae esi, dword [ebp - 0x644]
cmp edx, dword [ebp - 0x650]
jne 0x10173329
test edx, edx
je 0x10173325
sub esi, ecx
mov ax, word [esi + ecx]
cmp ax, word [ecx]
jne 0x10173329
add ecx, 2
sub edx, 1
jne 0x10173314
mov bl, 1
jmp 0x1017332b
xor bl, bl
push dword [ebp - 0x668]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebp - 0x660]
call fcn.1000ae90
lea ecx, [ebp - 0x644]
call fcn.1000ae90
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.101cff65
mov esp, ebp
pop ebp
ret