Function at 0x417832
Capabilities:
Get logon sessions
Get session information
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc58
mov eax, dword [0x455070]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor esi, esi
mov dword [ebp - 0xc4c], 0x104
mov edi, 0x208
mov dword [ebp - 0xc54], esi
push edi
lea eax, [ebp - 0x20c]
mov dword [ebp - 0xc44], esi
push esi
push eax
mov dword [ebp - 0xc38], esi
mov ebx, esi
mov dword [ebp - 0xc58], esi
call fcn.0041e8d0
push edi
lea eax, [ebp - 0x414]
push esi
push eax
call fcn.0041e8d0
add esp, 0x18
mov dword [ebp - 0xc48], esi
lea eax, [ebp - 0xc58]
mov dword [ebp - 0xc40], esi
mov dword [ebp - 0xc3c], esi
push eax
lea eax, [ebp - 0xc38]
push eax
push 0x18
push 0xffffffffffffffff
push esi
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
jne 0x4178f5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetLoggedUserSid__:_WTSQuerySessionInformation___err___d_n
lea eax, [ebp - 0xc34]
push 0x410
push eax
call fcn.00417132
add esp, 0x10
lea eax, [ebp - 0xc34]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
xor eax, eax
jmp 0x417abf
mov edi, dword [ebp - 0xc38]
test edi, edi
je 0x4179d3
mov eax, dword [edi + 4]
mov ebx, 0x104
mov dword [ebp - 0xc44], eax
lea eax, [edi + 0x82]
push eax
lea eax, [ebp - 0x20c]
push ebx
push eax
call fcn.00417132
lea eax, [edi + 0x60]
push eax
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.00417132
lea ecx, [ebp - 0x20c]
add esp, 0x18
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x417942
sub ecx, edx
lea ebx, [ebp - 0x414]
sar ecx, 1
mov dword [ebp - 0xc4c], ecx
lea ecx, [ebx + 2]
mov ax, word [ebx]
add ebx, 2
cmp ax, si
jne 0x417960
mov edi, dword [ebp - 0xc44]
lea eax, [ebp - 0x414]
push edi
push eax
lea eax, [ebp - 0x20c]
sub ebx, ecx
push eax
push str.GetLoggedUserSid__:_szUserName___s__szDomain___s__dwSessionId___d_n
lea eax, [ebp - 0xc34]
sar ebx, 1
push 0x410
push eax
call fcn.00417132
add esp, 0x18
lea eax, [ebp - 0xc34]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
test edi, edi
je 0x4179cd
lea eax, [ebp - 0xc40]
push eax
lea eax, [ebp - 0xc48]
push eax
call dword [sym.imp.Secur32.dll_LsaEnumerateLogonSessions]
test eax, eax
je 0x4179cd
push eax
call dword [sym.imp.ADVAPI32.dll_LsaNtStatusToWinError]
mov edi, dword [ebp - 0xc38]
mov ecx, esi
mov dword [ebp - 0xc50], esi
cmp dword [ebp - 0xc48], ecx
jbe 0x417a93
mov edi, dword [ebp - 0xc4c]
test esi, esi
jne 0x417a7f
lea eax, [ebp - 0xc3c]
push eax
mov eax, dword [ebp - 0xc40]
lea eax, [eax + ecx*8]
push eax
call dword [sym.imp.Secur32.dll_LsaGetLogonSessionData]
test eax, eax
jne 0x417a62
mov eax, dword [ebp - 0xc3c]
test eax, eax
je 0x417a62
mov ecx, dword [ebp - 0xc44]
cmp dword [eax + 0x28], ecx
jne 0x417a62
push edi
lea ecx, [ebp - 0x20c]
push ecx
push dword [eax + 0x10]
call fcn.00429aec
add esp, 0xc
test eax, eax
jne 0x417a62
push ebx
lea eax, [ebp - 0x414]
push eax
mov eax, dword [ebp - 0xc3c]
push dword [eax + 0x18]
call fcn.00429aec
add esp, 0xc
test eax, eax
jne 0x417a62
mov eax, dword [ebp - 0xc3c]
mov esi, dword [eax + 0x2c]
mov ecx, dword [ebp - 0xc50]
inc ecx
mov dword [ebp - 0xc50], ecx
cmp ecx, dword [ebp - 0xc48]
jb 0x4179ed
test esi, esi
je 0x417a8d
lea eax, [ebp - 0xc54]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
mov edi, dword [ebp - 0xc38]
cmp dword [ebp - 0xc40], 0
je 0x417aae
push dword [ebp - 0xc40]
call dword [sym.imp.Secur32.dll_LsaFreeReturnBuffer]
mov edi, dword [ebp - 0xc38]
test edi, edi
je 0x417ab9
push edi
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov eax, dword [ebp - 0xc54]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00419a78
mov esp, ebp
pop ebp
ret