Function at 0x408feb
Capabilities:
Get session user name

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x25c
mov eax, dword [0x5afee0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x60]
push ebx
xor ebx, ebx
push esi
push edi
mov dword [ebp - 0x228], edx
mov dword [ebp - 0x238], eax
cmp eax, ebx
jne 0x409052
mov byte [ebp - 0x211], bl
push ebx
push 1
lea ecx, [ebp + 8]
call fcn.004053e5
push ebx
push 1
lea ecx, [ebp + 0x24]
call fcn.004053e5
push ebx
push 1
lea ecx, [ebp + 0x40]
call fcn.004053e5
mov ecx, dword [ebp - 4]
mov al, byte [ebp - 0x211]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0052f7d0
leave
ret
mov byte [ebp - 0x211], bl
mov dword [ebp - 0x218], ebx
mov ecx, 0x20019
mov dword [ebp - 0x22c], ebx
mov dword [ebp - 0x230], ebx
mov dword [ebp - 0x220], ebx
mov dword [ebp - 0x224], ebx
mov dword [ebp - 0x21c], ebx
cmp byte [ebp + 0x5c], bl
je 0x40908b
mov ecx, 0x20119
cmp dword [ebp + 0x20], 8
mov eax, dword [ebp + 0xc]
jae 0x409097
lea eax, [ebp + 0xc]
lea esi, [ebp - 0x218]
push esi
push ecx
push ebx
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
xor esi, esi
inc esi
test eax, eax
jne 0x409285
mov edi, dword [sym.imp.ADVAPI32.dll_GetSecurityInfo]
lea eax, [ebp - 0x230]
push eax
push ebx
push ebx
push ebx
lea eax, [ebp - 0x220]
push eax
push esi
push 4
push dword [ebp - 0x218]
call edi
test eax, eax
jne 0x409285
push ebx
push ebx
push ebx
push dword [ebp - 0x238]
push esi
push 4
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
test eax, eax
jne 0x409285
lea eax, [ebp - 0x22c]
push eax
push ebx
lea eax, [ebp - 0x21c]
push eax
push ebx
push ebx
push 4
push 4
push dword [ebp - 0x218]
call edi
test eax, eax
jne 0x409285
push 8
pop ecx
push 2
lea edi, [ebp - 0x258]
rep stosd dword es:[edi], eax
pop edi
push 0x206
mov word [ebp - 0x210], ax
lea eax, [ebp - 0x20e]
push ebx
push eax
mov dword [ebp - 0x258], 0xf003f
mov dword [ebp - 0x254], edi
mov dword [ebp - 0x250], 3
mov dword [ebp - 0x244], esi
call fcn.00537010
add esp, 0xc
lea eax, [ebp - 0x234]
push eax
lea eax, [ebp - 0x210]
push eax
push edi
mov dword [ebp - 0x234], 0x104
call sub.Secur32.dll_GetUserNameExW
test al, al
jbe 0x4091ab
cmp word [ebp - 0x210], bx
je 0x4091ab
lea eax, [ebp - 0x210]
mov dword [ebp - 0x240], esi
mov dword [ebp - 0x23c], eax
jmp 0x4091bb
mov dword [ebp - 0x240], edi
mov dword [ebp - 0x23c], str.Authenticated_Users
lea eax, [ebp - 0x224]
push eax
push dword [ebp - 0x21c]
lea eax, [ebp - 0x258]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
jne 0x409285
push ebx
push dword [ebp - 0x224]
push ebx
push ebx
push 4
push 4
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
test eax, eax
jne 0x40926c
cmp dword [ebp + 0x64], ebx
jne 0x40921a
push dword [ebp + 0x5c]
lea eax, [ebp + 0x24]
push eax
push dword [ebp - 0x228]
lea ecx, [ebp + 0x40]
lea eax, [ebp + 8]
call fcn.00408e35
jmp 0x40925d
cmp dword [ebp + 0x64], esi
jne 0x409240
push dword [ebp + 0x5c]
lea esi, [ebp + 0x24]
push dword [ebp - 0x228]
lea eax, [ebp + 8]
call fcn.00408f7d
neg al
sbb al, al
pop ecx
xor esi, esi
inc al
pop ecx
inc esi
jmp 0x409266
cmp dword [ebp + 0x64], edi
jne 0x40926c
push dword [ebp + 0x5c]
lea eax, [ebp + 0x24]
push eax
push dword [ebp - 0x228]
lea ecx, [ebp + 0x40]
lea eax, [ebp + 8]
call fcn.00408ed9
add esp, 0xc
neg eax
sbb al, al
inc al
mov byte [ebp - 0x211], al
push ebx
push dword [ebp - 0x21c]
push ebx
push ebx
push 4
push 4
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
cmp dword [ebp - 0x220], ebx
je 0x4092a5
push ebx
push ebx
push ebx
push dword [ebp - 0x220]
push esi
push 4
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x22c], ebx
je 0x4092bb
push dword [ebp - 0x22c]
call esi
cmp dword [ebp - 0x230], ebx
je 0x4092cb
push dword [ebp - 0x230]
call esi
cmp dword [ebp - 0x224], ebx
je 0x4092db
push dword [ebp - 0x224]
call esi
cmp dword [ebp - 0x21c], ebx
je 0x4092eb
push dword [ebp - 0x21c]
call esi
cmp dword [ebp - 0x220], ebx
je 0x4092fb
push dword [ebp - 0x220]
call esi
cmp dword [ebp - 0x218], ebx
je 0x40930f
push dword [ebp - 0x218]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov al, byte [ebp - 0x211]
mov byte [ebp - 0x211], al
jmp 0x40901c