Function at 0x1001d540
Capabilities:
Get session information
Get session user name

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100374c0
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
push ebx
push esi
push edi
mov eax, dword [0x1004f100]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 8]
xor ebx, ebx
push eax
push str.LogoffUser_UserName:_s_...
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x28], ebx
call fcn.1001af90
mov ecx, eax
call fcn.1001b3f0
add esp, 8
lea ecx, [ebp - 0x1c]
mov dword [ebp - 4], ebx
xor eax, eax
push ecx
push 0x28
mov dword [ebp - 0x68], ebx
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x1001d5e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.1001af90
push esi
push str.Logoff_User_open_cur_proces_failed:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 8
push 0x10049464
lea edx, [ebp - 0x30]
push edx
mov dword [ebp - 0x30], esi
call fcn.10028c35
lea eax, [ebp - 0x64]
push eax
push str.SeShutdownPrivilege
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
mov edx, dword [ebp - 0x1c]
push ebx
push ebx
push ebx
lea ecx, [ebp - 0x68]
push ecx
push ebx
push edx
mov dword [ebp - 0x68], 1
mov dword [ebp - 0x5c], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
cmp eax, ebx
jne 0x1001d64b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x1001d64b
call fcn.1001af90
push ebx
push str.Logoff_User_adjust_token_privileges_failed:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 8
push 0x10049464
lea eax, [ebp - 0x34]
push eax
mov dword [ebp - 0x34], ebx
call fcn.10028c35
push 0x10045d38
call sub.WTSAPI32.dll_WTSOpenServerW
mov dword [ebp - 0x18], eax
cmp eax, ebx
jne 0x1001d68a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.1001af90
push esi
push str.Logoff_User_open_server_failed:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 8
push 0x10049464
lea ecx, [ebp - 0x38]
push ecx
mov dword [ebp - 0x38], esi
call fcn.10028c35
lea edx, [ebp - 0x2c]
push edx
lea ecx, [ebp - 0x24]
push ecx
push 1
push ebx
push eax
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x24], ebx
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
test eax, eax
jne 0x1001d6d3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.1001af90
push esi
push str.Logoff_User_enum_sessions_failed:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 8
push 0x10049464
lea edx, [ebp - 0x3c]
push edx
mov dword [ebp - 0x3c], esi
call fcn.10028c35
xor edi, edi
cmp edi, dword [ebp - 0x2c]
jae 0x1001d76e
mov ecx, dword [ebp - 0x24]
lea eax, [edi + edi*2]
mov edx, dword [ecx + eax*4 + 4]
mov esi, dword [ecx + eax*4]
lea eax, [ecx + eax*4]
mov eax, dword [eax + 8]
lea ecx, [ebp - 0x40]
push ecx
mov dword [ebp - 0x54], edx
lea edx, [ebp - 0x20]
push edx
push 5
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x18]
push esi
push eax
mov dword [ebp - 0x40], 0x104
mov dword [ebp - 0x20], ebx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
jne 0x1001d73f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov dword [ebp - 0x14], ebx
call fcn.1001af90
push esi
push ebx
push str.Logoff_User_enum_session_info_error:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 0xc
inc edi
xor ebx, ebx
jmp 0x1001d6d5
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x20]
push ecx
push edx
call fcn.10026f4b
add esp, 8
test eax, eax
jne 0x1001d759
mov dword [ebp - 0x28], esi
lea ebx, [eax + 1]
mov eax, dword [ebp - 0x20]
push eax
call sub.WTSAPI32.dll_WTSFreeMemory
test ebx, ebx
jne 0x1001d76c
inc edi
jmp 0x1001d6d5
xor ebx, ebx
mov ecx, dword [ebp - 0x24]
push ecx
call sub.WTSAPI32.dll_WTSFreeMemory
mov esi, dword [ebp - 0x28]
call fcn.1001af90
cmp esi, ebx
jne 0x1001d7ab
mov esi, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
push esi
push edx
push str.Logoff_User_enum_sessions_not_found_Username:_s_failed:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 0xc
push 0x10049464
lea eax, [ebp - 0x44]
push eax
mov dword [ebp - 0x44], esi
call fcn.10028c35
mov ecx, dword [ebp + 8]
push esi
push ecx
push str.Logoff_User__UserName:_s_Session:_d
mov ecx, eax
call fcn.1001b3f0
movzx edx, byte [ebp + 0xc]
mov eax, dword [ebp - 0x18]
add esp, 0xc
push edx
push esi
push eax
call sub.WTSAPI32.dll_WTSLogoffSession
test eax, eax
jne 0x1001d800
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.1001af90
push esi
push str.Logoff_User_call_logoff_failed:_08x
mov ecx, eax
call fcn.1001b4f0
add esp, 8
push 0x10049464
lea ecx, [ebp - 0x48]
push ecx
mov dword [ebp - 0x48], esi
call fcn.10028c35
xor esi, esi
mov dword [ebp - 4], 0xffffffff
jmp 0x1001d837
mov eax, dword [ebp - 0x18]
cmp eax, ebx
je 0x1001d845
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
cmp eax, ebx
je 0x1001d856
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x1c], ebx
movzx eax, byte [ebp + 0xc]
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp + 8]
push eax
push esi
push ecx
push edx
push str.Logoff_User__UserName:_s_Session:_d__Rlt:_08x_bWait:_d
call fcn.1001af90
mov ecx, eax
call fcn.1001b3f0
add esp, 0x14
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret