Function at 0x40d910
Capabilities:
Get session information
Get session user name
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x421ebc
mov eax, dword fs:[0]
push eax
mov eax, 0x22b4
call fcn.0041d190
mov eax, dword [0x4360c0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [0x43a550]
mov dword [ebp - 0x22c0], 0
test al, 1
jne 0x40d986
or eax, 1
mov dword [0x43a550], eax
xor eax, eax
push 0x4223c0
mov dword [0x43a54c], 7
mov dword [0x43a548], 0
mov word [0x43a538], ax
call fcn.00413923
add esp, 4
cmp dword [0x43a548], 0
jne 0x40dc61
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea ecx, [ebp - 0x22a8]
push ecx
push eax
mov dword [ebp - 0x22a8], 0
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
je 0x40dc61
xor eax, eax
mov dword [ebp - 0x22a4], 0
mov dword [ebp - 0x22b0], 0
mov dword [ebp - 0x2244], 7
mov dword [ebp - 0x2248], 0
mov word [ebp - 0x2258], ax
mov dword [ebp - 4], eax
mov dword [ebp - 0x222c], 7
mov dword [ebp - 0x2230], eax
mov word [ebp - 0x2240], ax
lea eax, [ebp - 0x22b0]
push eax
lea eax, [ebp - 0x22a4]
push eax
push 5
mov byte [ebp - 4], 1
push dword [ebp - 0x22a8]
push 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x40dc09
mov eax, dword [ebp - 0x22a4]
test eax, eax
je 0x40dc09
push eax
lea ecx, [ebp - 0x2258]
call fcn.0040e5f0
push dword [ebp - 0x22a4]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
lea eax, [ebp - 0x22b0]
push eax
lea eax, [ebp - 0x22a4]
push eax
push 7
push dword [ebp - 0x22a8]
mov dword [ebp - 0x22a4], 0
push 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x40dbea
mov eax, dword [ebp - 0x22a4]
test eax, eax
je 0x40dbea
push eax
lea ecx, [ebp - 0x2240]
call fcn.0040e5f0
push dword [ebp - 0x22a4]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
xor eax, eax
mov dword [ebp - 0x225c], 7
mov dword [ebp - 0x2260], 0
mov word [ebp - 0x2270], ax
push ecx
lea edx, [ebp - 0x2240]
lea ecx, [ebp - 0x22a0]
mov byte [ebp - 4], 2
call fcn.0040ee10
lea ecx, [ebp - 0x2258]
push ecx
mov edx, eax
lea ecx, [ebp - 0x2288]
mov byte [ebp - 4], 3
call fcn.0040eed0
add esp, 8
lea ecx, [ebp - 0x2270]
push eax
call fcn.0040e580
lea ecx, [ebp - 0x2288]
call fcn.0040e5c0
lea ecx, [ebp - 0x22a0]
mov byte [ebp - 4], 2
call fcn.0040e5c0
xor eax, eax
push 0x2002
push eax
mov word [ebp - 0x2228], ax
lea eax, [ebp - 0x2226]
push eax
call fcn.00414e20
xor eax, eax
push 0x20a
push eax
mov word [ebp - 0x220], ax
lea eax, [ebp - 0x21e]
push eax
call fcn.00414e20
add esp, 0x18
cmp dword [ebp - 0x225c], 8
lea ecx, [ebp - 0x22bc]
push ecx
lea ecx, [ebp - 0x22b8]
push ecx
lea ecx, [ebp - 0x220]
push ecx
lea ecx, [ebp - 0x22b4]
push ecx
lea ecx, [ebp - 0x2228]
lea eax, [ebp - 0x2270]
cmovae eax, dword [ebp - 0x2270]
push ecx
push eax
push 0
mov dword [ebp - 0x22b4], 0x1000
mov dword [ebp - 0x22b8], 0x105
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0x40dbdf
lea eax, [ebp - 0x22ac]
push eax
lea eax, [ebp - 0x2228]
push eax
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
push dword [ebp - 0x22ac]
mov ecx, 0x43a538
call fcn.0040e5f0
push dword [ebp - 0x22ac]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebp - 0x2270]
call fcn.0040e5c0
lea ecx, [ebp - 0x2240]
call fcn.0040e5c0
lea ecx, [ebp - 0x2258]
mov dword [ebp - 4], 0xffffffff
call fcn.0040e5c0
jmp 0x40dc61
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x222c], 8
jb 0x40dc26
push dword [ebp - 0x2240]
call fcn.00413962
add esp, 4
xor eax, eax
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x2244], 8
mov dword [ebp - 0x222c], 7
mov dword [ebp - 0x2230], 0
mov word [ebp - 0x2240], ax
jb 0x40dc61
push dword [ebp - 0x2258]
call fcn.00413962
add esp, 4
xor eax, eax
push 0xffffffffffffffff
push eax
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], 0
push 0x43a538
mov ecx, esi
mov word [esi], ax
call fcn.0040e6a0
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00413156
mov esp, ebp
pop ebp
ret