Function at 0x521560
Capabilities:
Get session information

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5a3f8e
mov eax, dword fs:[0]
push eax
sub esp, 0x10c
mov eax, dword [0x6340c4]
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 esi, ecx
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x64], esi
mov dword [ebp - 0x5c], 0
mov dword [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], 0
lea eax, [ebp - 0x44]
mov dword [ebp - 4], 0
push eax
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x5c], 1
push eax
push 0
lea eax, [ebp - 0x60]
mov dword [ebp - 0x44], 0
push eax
push 0
mov dword [ebp - 0x60], 1
mov dword [ebp - 0x4c], 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsExW]
test eax, eax
jne 0x52161c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push 0
push eax
push str.WTSEnumerateSessionsEx
push 0x45
push 0x1f1
push str.C:drone_srcGUIWindowsGuiUtils.cpp
push str.GuiUtils::GetWTSSessionsIDs
call fcn.00573980
add esp, 0x20
jmp 0x5217ee
lea ecx, [ebp - 0x50]
mov dword [ebp - 0x50], 0
call fcn.00521820
test eax, eax
jne 0x521652
push str.Error_retrieving_current_SessionID.
push 0x45
push 0x1f9
push str.C:drone_srcGUIWindowsGuiUtils.cpp
push str.GuiUtils::GetWTSSessionsIDs
call fcn.00573940
add esp, 0x14
jmp 0x5217ee
xor ebx, ebx
mov dword [ebp - 0x58], 0
cmp dword [ebp - 0x44], ebx
jbe 0x5217ee
xor ecx, ecx
mov dword [ebp - 0x54], ecx
nop dword [eax]
lea eax, [ebp - 0x58]
mov dword [ebp - 0x48], 0
push eax
lea eax, [ebp - 0x48]
push eax
mov eax, dword [ebp - 0x4c]
push 4
push dword [ecx + eax + 8]
push 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
jne 0x5216c0
push eax
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WTSQuerySessionInformation
push 0x57
push 0x20c
push str.C:drone_srcGUIWindowsGuiUtils.cpp
push str.GuiUtils::GetWTSSessionsIDs
call fcn.00573980
add esp, 0x20
jmp 0x5217db
mov eax, dword [ebp - 0x48]
mov edi, dword [eax]
cmp dword [ebp - 0x50], edi
je 0x5217d0
push ecx
lea ecx, [ebp - 0x118]
call fcn.00449fd0
push edi
lea ecx, [ebp - 0x108]
mov dword [ebp - 4], 1
call fcn.0044a140
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x118]
call fcn.00449f10
mov edx, eax
mov byte [ebp - 4], 2
cmp dword [edx + 0x14], 8
jb 0x52170a
mov edx, dword [edx]
mov ecx, edx
mov dword [ebp - 0x18], 0
xor eax, eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x521723
sub ecx, edi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x28]
call fcn.004459d0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x28]
mov eax, dword [esi + 4]
cmp eax, dword [esi + 8]
je 0x52176b
push 0x18
push ecx
push eax
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
call fcn.004c7170
add esp, 0xc
add dword [esi + 4], 0x18
jmp 0x52178f
push ecx
push eax
mov ecx, esi
call fcn.0046e010
mov eax, dword [ebp - 0x14]
cmp eax, 8
jb 0x52178f
lea eax, [eax*2 + 2]
push eax
push dword [ebp - 0x28]
call fcn.00446620
add esp, 8
xor eax, eax
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x14], 7
cmp eax, 8
jb 0x5217be
lea eax, [eax*2 + 2]
push eax
push dword [ebp - 0x40]
call fcn.00446620
add esp, 8
lea ecx, [ebp - 0x118]
mov byte [ebp - 4], 0
call fcn.00449500
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x5217db
push eax
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov ecx, dword [ebp - 0x54]
inc ebx
add ecx, 0x20
mov dword [ebp - 0x54], ecx
cmp ebx, dword [ebp - 0x44]
jb 0x521670
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x521801
push dword [ebp - 0x44]
push eax
push 2
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemoryExW]
mov eax, esi
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.004c59c5
mov esp, ebp
pop ebp
ret