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

Disassembly:
push ebp
lea ebp, [esp - 0x2268]
mov eax, 0x2268
call fcn.00433460
push 0xffffffffffffffff
push 0x43cce8
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x44b074]
xor eax, ebp
mov dword [ebp + 0x2264], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x2270]
xor edi, edi
mov dword [ebp - 0x18], edi
test byte [0x44e5b0], 1
push 7
mov dword [ebp - 0x1c], eax
pop ebx
jne 0x40a06d
or dword [0x44e5b0], 1
push 0x43e07d
mov dword [0x44e5ac], ebx
mov dword [0x44e5a8], edi
mov word [0x44e598], di
call fcn.0041e9fb
pop ecx
cmp dword [0x44e5a8], edi
jne 0x40a23c
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea ecx, [ebp - 0x14]
push ecx
push eax
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
je 0x40a23c
mov dword [ebp - 0x10], edi
mov dword [ebp + 0x50], ebx
mov dword [ebp + 0x4c], edi
mov word [ebp + 0x3c], di
mov dword [ebp - 4], edi
mov dword [ebp + 0x34], ebx
mov dword [ebp + 0x30], edi
mov word [ebp + 0x20], di
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x10]
push eax
push 5
mov byte [ebp - 4], 1
push dword [ebp - 0x14]
push edi
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
cmp eax, edi
je 0x40a222
mov eax, dword [ebp - 0x10]
cmp eax, edi
je 0x40a222
lea esi, [ebp + 0x38]
call fcn.00409666
push dword [ebp - 0x10]
call sub.WTSAPI32.dll_WTSFreeMemory
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x10]
push eax
push ebx
push dword [ebp - 0x14]
mov dword [ebp - 0x10], edi
push edi
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
cmp eax, edi
je 0x40a222
mov eax, dword [ebp - 0x10]
cmp eax, edi
je 0x40a222
lea esi, [ebp + 0x1c]
call fcn.00409666
push dword [ebp - 0x10]
call sub.WTSAPI32.dll_WTSFreeMemory
mov dword [ebp + 0x18], ebx
mov dword [ebp + 0x14], edi
mov word [ebp + 4], di
mov eax, esi
push eax
lea eax, [ebp - 0x64]
push eax
mov byte [ebp - 4], 2
call fcn.0040a940
lea ecx, [ebp + 0x38]
push ecx
push eax
lea eax, [ebp - 0x48]
push eax
mov byte [ebp - 4], 3
call fcn.00409c74
add esp, 0x14
push 0xffffffffffffffff
lea ecx, [ebp]
push ecx
xor ebx, ebx
mov byte [ebp - 4], 4
call fcn.004095e0
push edi
inc ebx
push ebx
lea esi, [ebp - 0x48]
call fcn.004097e6
push edi
push ebx
lea esi, [ebp - 0x64]
mov byte [ebp - 4], 2
call fcn.004097e6
push 0x2002
lea eax, [ebp + 0x56]
push edi
push eax
mov word [ebp + 0x54], di
call fcn.0041e7c0
push 0x20a
lea eax, [ebp + 0x205a]
push edi
push eax
mov word [ebp + 0x2058], di
call fcn.0041e7c0
mov eax, dword [ebp + 4]
add esp, 0x18
cmp dword [ebp + 0x18], 8
mov dword [ebp - 0x18], 0x1000
mov dword [ebp - 0x24], 0x105
jae 0x40a1c3
lea eax, [ebp + 4]
lea ecx, [ebp - 0x2c]
push ecx
lea ecx, [ebp - 0x24]
push ecx
lea ecx, [ebp + 0x2058]
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp + 0x54]
push ecx
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
cmp eax, edi
je 0x40a20a
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp + 0x54]
push eax
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
mov eax, dword [ebp - 0x20]
mov esi, 0x44e594
call fcn.00409666
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
push ebx
lea esi, [ebp]
call fcn.004097e6
push edi
push ebx
lea esi, [ebp + 0x1c]
call fcn.004097e6
push edi
push ebx
jmp 0x40a230
push edi
push 1
lea esi, [ebp + 0x1c]
call fcn.004097e6
push edi
push 1
or dword [ebp - 4], 0xffffffff
lea esi, [ebp + 0x38]
call fcn.004097e6
mov esi, dword [ebp - 0x1c]
mov eax, 0x44e594
call fcn.00409468
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 + 0x2264]
xor ecx, ebp
call fcn.0041e8c8
add ebp, 0x2268
leave
ret