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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43c501
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x450440]
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 0x40c95d
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne cl
test cl, cl
je 0x40c95d
push edi
mov ecx, ebx
call fcn.0040e2a0
mov dword [ebp - 4], 0
mov dword [ebp - 0x7c], 1
jmp 0x40cc3e
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 0x40c9ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x40c9a7
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x35
mov ecx, str.Environment::GetActiveUserSid
call fcn.0040e950
add esp, 4
mov ecx, esi
push ebx
call fcn.0040c780
mov dword [ebp - 0x7c], 1
jmp 0x40cc2c
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 0x40ca32
push eax
call dword [sym.imp.ADVAPI32.dll_LsaNtStatusToWinError]
test eax, eax
jle 0x40ca0b
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x3e
mov ecx, str.Environment::GetActiveUserSid
call fcn.0040e950
add esp, 4
mov ecx, esi
push ebx
call fcn.0040c780
mov dword [ebp - 0x7c], 1
jmp 0x40cc1a
mov eax, dword [ebp - 0x78]
lea ecx, [ebp - 0x90]
add eax, 0x82
push eax
call fcn.00404e30
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x88]
mov eax, dword [ebp - 0x78]
add eax, 0x60
push eax
call fcn.00404e30
mov byte [ebp - 4], 4
xor esi, esi
cmp dword [ebp - 0x8c], esi
jbe 0x40cb40
mov edi, edi
cmp byte [edi + 0x48], 0
je 0x40ca8d
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne al
test al, al
jne 0x40cb40
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 0x40cb1e
mov ecx, dword [ebp - 0x84]
cmp dword [ecx + 0x24], 2
jne 0x40cb1e
mov eax, dword [ebp - 0x78]
mov edx, dword [ecx + 0x28]
cmp edx, dword [eax + 4]
jne 0x40cb1e
mov ecx, dword [ecx + 0x10]
lea edx, [ebp - 0x90]
call fcn.0040d800
test al, al
je 0x40cb1e
mov ecx, dword [ebp - 0x84]
lea edx, [ebp - 0x88]
mov ecx, dword [ecx + 0x18]
call fcn.0040d800
test al, al
je 0x40cb1e
mov eax, dword [ebp - 0x84]
push ecx
lea ecx, [ebp - 0x74]
push dword [eax + 0x2c]
call fcn.0040db50
mov byte [ebp - 4], 6
mov ecx, edi
push eax
call fcn.0040dce0
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x74]
call fcn.00401970
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x40cb33
push eax
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
inc esi
cmp esi, dword [ebp - 0x8c]
jb 0x40ca70
cmp byte [edi + 0x48], 0
je 0x40cbac
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne al
test al, al
je 0x40cbac
mov ecx, edi
call fcn.0040dd70
push eax
push str.Active_user_SID___S
push 0x53
push str.Environment::GetActiveUserSid
call fcn.0040e8c0
add esp, 0x10
mov ecx, ebx
push edi
call fcn.0040e2a0
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 0x40cbaa
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40cbf9
push str.cant_get_valid_user
push 0x58
push str.Environment::GetActiveUserSid
call fcn.0040e8c0
mov ecx, dword [ebp - 0x94]
add esp, 0xc
push ebx
call fcn.0040c780
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 0x40cbf9
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 0x40cc1a
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 0x40cc2c
push eax
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x78]
test eax, eax
je 0x40cc3e
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.0041f9e6
mov esp, ebp
pop ebp
ret 4