Function at 0x403150
Capabilities:
Get session user name
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xe5c
mov eax, dword [0x422948]
mov edx, dword [ebp + 0x10]
xor eax, ebp
push ebx
xor ebx, ebx
mov dword [esp + 0xe5c], eax
mov eax, 0x3ff
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], eax
xor eax, eax
cmp edx, ebx
mov ecx, 0x82
lea edi, [esp + 0x52]
mov word [esp + 0x50], bx
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
rep stosd dword es:[edi], eax
je 0x4031b1
cmp word [edx], bx
jne 0x4031d1
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x54]
push ecx
mov dword [esp + 0x2c], 0x104
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x4031fc
lea edx, [esp + 0x50]
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x24]
push ecx
lea eax, [esp + 0x668]
push eax
lea ecx, [esp + 0x34]
push ecx
lea eax, [esp + 0x270]
push eax
push edx
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
jne 0x403213
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xe58]
xor ecx, ebp
call fcn.004053fe
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x1c]
push ecx
push ebx
lea edx, [esp + 0x20]
push edx
push ebx
push ebx
push 4
mov edi, 1
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoW]
test eax, eax
jne 0x403343
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
lea eax, [esp + 0x10]
push eax
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x264]
mov dword [esp + 0x4c], edx
push ecx
lea edx, [esp + 0x34]
push edx
push edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], edi
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
jne 0x403343
mov eax, dword [esp + 0x10]
push ebx
push eax
push ebx
push ebx
push 4
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoW]
push esi
call edi
cmp eax, ebx
je 0x40333b
cmp eax, 5
jne 0x403343
lea ecx, [esp + 0xc]
push ecx
push 0x20
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x403343
mov edx, dword [esp + 0xc]
push 1
push str.SeTakeOwnershipPrivilege
push edx
call fcn.004030d0
add esp, 0xc
test eax, eax
je 0x403343
push ebx
push ebx
push ebx
lea eax, [esp + 0x26c]
push eax
push 1
push 1
push esi
call edi
test eax, eax
push ebx
push str.SeTakeOwnershipPrivilege
je 0x403317
mov ecx, dword [esp + 0x14]
push ecx
call fcn.004030d0
add esp, 0xc
jmp 0x403343
mov edx, dword [esp + 0x14]
push edx
call fcn.004030d0
add esp, 0xc
test eax, eax
je 0x403343
mov eax, dword [esp + 0x10]
push ebx
push eax
push ebx
push ebx
push 4
push 1
push esi
call edi
test eax, eax
jne 0x403343
mov dword [esp + 0x14], 1
mov eax, dword [esp + 0x10]
cmp eax, ebx
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
je 0x403354
push eax
call esi
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x40335f
push eax
call esi
mov eax, dword [esp + 0xc]
cmp eax, ebx
je 0x40336e
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0xe64]
mov eax, dword [esp + 0x14]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004053fe
mov esp, ebp
pop ebp
ret