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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x425d6b
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x434280]
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 ebx, dword [ebp + 8]
lea edi, [esi + 0x60]
mov dword [ebp - 0x80], 0
cmp byte [edi + 0x48], 0
mov dword [ebp - 0x98], ebx
je 0x4072e7
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne cl
test cl, cl
je 0x4072e7
push edi
mov ecx, ebx
call fcn.00408d20
mov dword [ebp - 4], 0
mov dword [ebp - 0x80], 1
jmp 0x40755a
mov dword [ebp - 0x78], 0
mov dword [ebp - 4], 1
lea eax, [ebp - 0x94]
push eax
lea eax, [ebp - 0x78]
mov dword [ebp - 0x94], 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 0x407358
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x407331
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x35
mov ecx, str.Environment::GetActiveUserSid
call fcn.004093a0
add esp, 4
mov ecx, esi
push ebx
call fcn.00407110
mov dword [ebp - 0x80], 1
jmp 0x407548
mov dword [ebp - 0x88], 0
mov dword [ebp - 0x84], 0
mov byte [ebp - 4], 2
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.Secur32.dll_LsaEnumerateLogonSessions]
test eax, eax
je 0x4073c2
push eax
call dword [sym.imp.ADVAPI32.dll_LsaNtStatusToWinError]
test eax, eax
jle 0x40739b
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x3e
mov ecx, str.Environment::GetActiveUserSid
call fcn.004093a0
add esp, 4
mov ecx, esi
push ebx
call fcn.00407110
mov dword [ebp - 0x80], 1
jmp 0x407533
mov eax, dword [ebp - 0x78]
lea ecx, [ebp - 0x90]
add eax, 0x82
push eax
call fcn.00402a50
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x8c]
mov eax, dword [ebp - 0x78]
add eax, 0x60
push eax
call fcn.00402a50
mov byte [ebp - 4], 4
xor esi, esi
cmp dword [ebp - 0x88], esi
jbe 0x4074c1
mov edi, edi
cmp byte [edi + 0x48], 0
je 0x40741d
lea eax, [edi + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
setne al
test al, al
jne 0x4074c1
mov dword [ebp - 0x7c], 0
mov byte [ebp - 4], 5
lea eax, [ebp - 0x7c]
push eax
mov eax, dword [ebp - 0x84]
lea eax, [eax + esi*8]
push eax
call dword [sym.imp.Secur32.dll_LsaGetLogonSessionData]
test eax, eax
jne 0x4074a2
mov ecx, dword [ebp - 0x7c]
cmp dword [ecx + 0x24], 2
jne 0x4074a2
mov eax, dword [ebp - 0x78]
mov edx, dword [ecx + 0x28]
cmp edx, dword [eax + 4]
jne 0x4074a2
mov ecx, dword [ecx + 0x10]
lea edx, [ebp - 0x90]
call fcn.004080c0
test al, al
je 0x4074a2
mov ecx, dword [ebp - 0x7c]
lea edx, [ebp - 0x8c]
mov ecx, dword [ecx + 0x18]
call fcn.004080c0
test al, al
je 0x4074a2
mov eax, dword [ebp - 0x7c]
push ecx
lea ecx, [ebp - 0x74]
push dword [eax + 0x2c]
call fcn.004085d0
mov byte [ebp - 4], 6
mov ecx, edi
push eax
call fcn.00408760
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x74]
call fcn.00401700
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x7c]
test eax, eax
je 0x4074b4
push eax
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
inc esi
cmp esi, dword [ebp - 0x88]
jb 0x407400
mov ecx, edi
call fcn.004087f0
push eax
push str.Active_user_SID___S
push 0x51
push str.Environment::GetActiveUserSid
call fcn.00409310
add esp, 0x10
mov ecx, ebx
push edi
call fcn.00408d20
mov dword [ebp - 0x80], 1
mov byte [ebp - 4], 3
or esi, 0xffffffff
mov edx, dword [ebp - 0x8c]
mov eax, esi
add edx, 0xfffffff0
lea ecx, [edx + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x407512
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 0x407533
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x407548
push eax
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x78]
test eax, eax
je 0x40755a
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.0040b29c
mov esp, ebp
pop ebp
ret 4