Function at 0x40f1f0
Capabilities:
Get logon sessions
Get session information

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43ffd1
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x455440]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x94], esi
mov ebx, dword [ebp + 8]
lea edi, [esi + 0x60]
mov dword [ebp - 0x7c], 0
cmp byte [edi + 0x48], 0
mov dword [ebp - 0x9c], ebx
je 0x40f26d
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne cl
test cl, cl
je 0x40f26d
push edi
mov ecx, ebx
call fcn.00410a80
mov dword [ebp - 4], 0
mov dword [ebp - 0x7c], 1
jmp 0x40f54e
mov dword [ebp - 0x78], 0
mov dword [ebp - 4], 1
lea eax, [ebp - 0x98]
push eax
lea eax, [ebp - 0x78]
mov dword [ebp - 0x98], 0
push eax
push 0x18
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
push eax
push 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
jne 0x40f2de
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x40f2b7
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x35
mov ecx, str.Environment::GetActiveUserSid
call fcn.00411130
add esp, 4
mov ecx, esi
push ebx
call fcn.0040f090
mov dword [ebp - 0x7c], 1
jmp 0x40f53c
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x80], 0
mov byte [ebp - 4], 2
lea eax, [ebp - 0x80]
push eax
lea eax, [ebp - 0x8c]
push eax
call dword [sym.imp.Secur32.dll_LsaEnumerateLogonSessions]
test eax, eax
je 0x40f342
push eax
call dword [sym.imp.ADVAPI32.dll_LsaNtStatusToWinError]
test eax, eax
jle 0x40f31b
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x3e
mov ecx, str.Environment::GetActiveUserSid
call fcn.00411130
add esp, 4
mov ecx, esi
push ebx
call fcn.0040f090
mov dword [ebp - 0x7c], 1
jmp 0x40f52a
mov eax, dword [ebp - 0x78]
lea ecx, [ebp - 0x90]
add eax, 0x82
push eax
call fcn.00405110
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x88]
mov eax, dword [ebp - 0x78]
add eax, 0x60
push eax
call fcn.00405110
mov byte [ebp - 4], 4
xor esi, esi
cmp dword [ebp - 0x8c], esi
jbe 0x40f450
mov edi, edi
cmp byte [edi + 0x48], 0
je 0x40f39d
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne al
test al, al
jne 0x40f450
mov dword [ebp - 0x84], 0
mov byte [ebp - 4], 5
lea eax, [ebp - 0x84]
push eax
mov eax, dword [ebp - 0x80]
lea eax, [eax + esi*8]
push eax
call dword [sym.imp.Secur32.dll_LsaGetLogonSessionData]
test eax, eax
jne 0x40f42e
mov ecx, dword [ebp - 0x84]
cmp dword [ecx + 0x24], 2
jne 0x40f42e
mov eax, dword [ebp - 0x78]
mov edx, dword [ecx + 0x28]
cmp edx, dword [eax + 4]
jne 0x40f42e
mov ecx, dword [ecx + 0x10]
lea edx, [ebp - 0x90]
call fcn.00410060
test al, al
je 0x40f42e
mov ecx, dword [ebp - 0x84]
lea edx, [ebp - 0x88]
mov ecx, dword [ecx + 0x18]
call fcn.00410060
test al, al
je 0x40f42e
mov eax, dword [ebp - 0x84]
push ecx
lea ecx, [ebp - 0x74]
push dword [eax + 0x2c]
call fcn.00410330
mov byte [ebp - 4], 6
mov ecx, edi
push eax
call fcn.004104c0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x74]
call fcn.00401950
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x40f443
push eax
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
inc esi
cmp esi, dword [ebp - 0x8c]
jb 0x40f380
cmp byte [edi + 0x48], 0
je 0x40f4bc
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne al
test al, al
je 0x40f4bc
mov ecx, edi
call fcn.00410550
push eax
push str.Active_user_SID___S
push 0x53
push str.Environment::GetActiveUserSid
call fcn.004110a0
add esp, 0x10
mov ecx, ebx
push edi
call fcn.00410a80
mov dword [ebp - 0x7c], 1
mov byte [ebp - 4], 3
or esi, 0xffffffff
mov edx, dword [ebp - 0x88]
mov eax, esi
add edx, 0xfffffff0
lea ecx, [edx + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x40f4ba
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40f509
push str.cant_get_valid_user
push 0x58
push str.Environment::GetActiveUserSid
call fcn.004110a0
mov ecx, dword [ebp - 0x94]
add esp, 0xc
push ebx
call fcn.0040f090
mov dword [ebp - 0x7c], 1
mov byte [ebp - 4], 3
or esi, 0xffffffff
mov edx, dword [ebp - 0x88]
mov eax, esi
add edx, 0xfffffff0
lea ecx, [edx + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x40f509
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x90]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x40f52a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x80]
test eax, eax
je 0x40f53c
push eax
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x78]
test eax, eax
je 0x40f54e
push eax
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00422df2
mov esp, ebp
pop ebp
ret 4