Function at 0x40400a
Capabilities:
Get session information
Get session user name
Get token membership

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41f330
push 0x4180b4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
mov eax, 0x2248
call fcn.00417750
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x34], ebx
mov byte [ebp - 0x30], bl
mov byte [ebp - 0x2f], bl
mov byte [ebp - 0x2e], bl
mov byte [ebp - 0x2d], bl
mov byte [ebp - 0x2c], bl
mov byte [ebp - 0x2b], 5
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x4c], 0x104
mov dword [ebp - 0x50], 0x100
cmp dword [esi + 0x4b51], 0xffffffff
jne 0x40429f
push 0x200
push ebx
mov edi, 0x42bd20
push edi
call fcn.00410230
add esp, 0xc
mov dword [esi + 0x4b51], ebx
call fcn.00404ead
cmp eax, 2
je 0x4040b0
call fcn.00404ead
cmp eax, 3
je 0x4040b0
call fcn.00404ead
cmp eax, 5
jne 0x4040f3
mov dword [ebp - 0x34], 0x100
lea eax, [ebp - 0x34]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
jne 0x4040f3
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x40]
push eax
push 5
push 0xffffffffffffffff
push ebx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
test eax, eax
je 0x4040f3
push dword [ebp - 0x34]
push dword [ebp - 0x40]
push edi
call fcn.004106c0
add esp, 0xc
push dword [ebp - 0x40]
call sub.WTSAPI32.dll_WTSFreeMemory
call fcn.00404ead
cmp eax, 1
jne 0x4041a2
call fcn.00403fe7
cmp eax, ebx
je 0x40429f
mov dword [ebp - 4], ebx
push eax
push ebx
push 0x400
call dword [sym.imp.KERNEL32.DLL_OpenProcess]
mov dword [ebp - 0x3c], eax
cmp eax, ebx
je 0x404199
lea ecx, [ebp - 0x24]
push ecx
push 8
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
cmp eax, ebx
je 0x404199
lea eax, [ebp - 0x20]
push eax
push ebx
push ebx
push 1
push dword [ebp - 0x24]
mov edi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
call edi
cmp dword [ebp - 0x20], ebx
jbe 0x404199
mov eax, 0x2000
cmp dword [ebp - 0x20], eax
jbe 0x40415b
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x20]
lea eax, [ebp - 0x225c]
push eax
push 1
push dword [ebp - 0x24]
call edi
cmp eax, ebx
je 0x404199
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x25c]
push eax
lea eax, [ebp - 0x50]
push eax
push 0x42bd20
push dword [ebp - 0x225c]
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
or dword [ebp - 4], 0xffffffff
call fcn.00404239
lea eax, [ebp - 0x44]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x220
push 0x20
push 2
lea eax, [ebp - 0x30]
push eax
mov edi, dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
call edi
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x40429f
lea eax, [ebp - 0x48]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x223
push 0x20
push 2
lea eax, [ebp - 0x30]
push eax
call edi
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x40429f
lea eax, [ebp - 0x38]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x222
push 0x20
push 2
lea eax, [ebp - 0x30]
push eax
call edi
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x40429f
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x44]
push ebx
mov edi, dword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
call edi
test eax, eax
je 0x404256
mov dword [esi + 0x4b51], 0x28
jmp 0x40428a
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x38]
push ebx
call edi
test eax, eax
je 0x404270
mov dword [esi + 0x4b51], 0xa
jmp 0x40428a
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x38]
push ebx
call edi
neg eax
sbb eax, eax
and eax, 0xa
add eax, 0x14
mov dword [esi + 0x4b51], eax
push dword [ebp - 0x44]
mov edi, dword [sym.imp.ADVAPI32.dll_FreeSid]
call edi
push dword [ebp - 0x48]
call edi
push dword [ebp - 0x38]
call edi
mov eax, dword [esi + 0x4b51]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret 4