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

Disassembly:
push ebp
lea ebp, [esp - 0x6c]
sub esp, 0x84
mov al, byte [ebp + 0x78]
xor ecx, ecx
mov cl, al
and al, 0xbf
push ebx
mov byte [ebp + 0x5f], al
mov eax, dword [ebp + 0x7c]
push esi
xor ebx, ebx
and ecx, 0x40
mov esi, ecx
cmp esi, ebx
mov dword [ebp + 0x58], eax
mov eax, dword [ebp + 0x74]
mov dword [ebp + 0x44], esi
jne 0x46a55d
mov eax, str.MACHINE_
push eax
lea ecx, [ebp + 0x60]
call fcn.0044df7a
cmp esi, ebx
jne 0x46a575
push dword [ebp + 0x74]
lea ecx, [ebp + 0x60]
call fcn.00444a7c
push edi
push 7
pop ecx
xor eax, eax
mov dword [ebp - 0x18], ebx
neg esi
lea edi, [ebp - 0x14]
rep stosd dword es:[edi], eax
push 8
sbb esi, esi
pop ecx
lea edi, [ebp + 8]
rep stosd dword es:[edi], eax
and esi, 0xfffffffd
lea ecx, [ebp + 0x38]
mov dword [ebp + 0x54], ebx
mov dword [ebp + 0x30], ebx
mov dword [ebp + 0x50], ebx
mov dword [ebp + 0x48], ebx
add esi, 4
call fcn.0044489c
cmp dword [ebp + 0x44], ebx
je 0x46a642
mov eax, 0x80000
push 0x181450
lea ecx, [ebp + 0x38]
mov dword [ebp + 0x34], 0xa28
mov dword [ebp + 0x4c], eax
mov dword [ebp + 0x3c], eax
call fcn.004448de
mov ecx, dword [ebp + 0x34]
mov eax, dword [ebp + 0x38]
lea edi, [eax + ecx*2]
mov ecx, dword [ebp + 0x4c]
add ecx, edi
mov dword [ebp + 0x64], ecx
mov ecx, dword [ebp + 0x7c]
cmp word [ecx], bx
mov dword [ebp + 0x40], ebx
jne 0x46a5ff
lea ecx, [ebp + 0x34]
push ecx
push eax
mov dword [ebp + 0x58], eax
call dword [sym.imp.advapi32.dll_GetUserNameW]
test eax, eax
je 0x46a61d
lea eax, [ebp + 0x40]
push eax
lea eax, [ebp + 0x3c]
push eax
push dword [ebp + 0x64]
lea eax, [ebp + 0x4c]
push eax
push edi
push dword [ebp + 0x58]
push ebx
call dword [sym.imp.advapi32.dll_LookupAccountNameW]
test eax, eax
jne 0x46a632
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, ebx
jne 0x46a62a
xor eax, eax
inc eax
mov dword [ebp + 0x68], eax
jmp 0x46a884
push ebx
push ebx
push ebx
push edi
push 1
push esi
push dword [ebp + 0x60]
call dword [sym.imp.advapi32.dll_SetNamedSecurityInfoW]
lea eax, [ebp + 0x54]
push eax
push ebx
lea eax, [ebp + 0x30]
push eax
push ebx
push ebx
push 4
push esi
push dword [ebp + 0x60]
call dword [sym.imp.advapi32.dll_GetNamedSecurityInfoW]
cmp eax, ebx
mov dword [ebp + 0x68], eax
jne 0x46a884
mov eax, dword [ebp + 0x58]
cmp eax, ebx
mov dword [ebp + 0x28], str.Administrators
mov dword [ebp + 0x2c], str.Everyone
mov dword [ebp + 0x64], 2
je 0x46a68f
cmp word [eax], bx
je 0x46a68f
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x64], 1
cmp dword [ebp + 0x64], ebx
mov dword [ebp + 0x68], ebx
jle 0x46a6d4
mov edi, dword [ebp + 0x44]
neg edi
sbb edi, edi
and edi, 0x10ffc0
lea eax, [ebp - 0x18]
add edi, 0xf003f
mov dword [ebp + 0x58], eax
mov eax, dword [ebp + 0x68]
push 3
push 2
push edi
push dword [ebp + eax*4 + 0x28]
push dword [ebp + 0x58]
call dword [sym.imp.advapi32.dll_BuildExplicitAccessWithNameA]
inc dword [ebp + 0x68]
mov eax, dword [ebp + 0x68]
add dword [ebp + 0x58], 0x20
cmp eax, dword [ebp + 0x64]
jl 0x46a6b0
lea eax, [ebp + 0x50]
push eax
push dword [ebp + 0x30]
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 0x64]
call dword [sym.imp.advapi32.dll_SetEntriesInAclW]
cmp eax, ebx
mov dword [ebp + 0x68], eax
jne 0x46a884
push ebx
push dword [ebp + 0x50]
push ebx
push ebx
push 4
push esi
mov esi, dword [ebp + 0x60]
push esi
call dword [sym.imp.advapi32.dll_SetNamedSecurityInfoW]
cmp eax, ebx
mov dword [ebp + 0x68], eax
jne 0x46a884
cmp byte [ebp + 0x5f], bl
jle 0x46a884
cmp dword [ebp + 0x54], ebx
je 0x46a72b
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.DLL_LocalFree]
mov dword [ebp + 0x54], ebx
cmp dword [ebp + 0x44], ebx
je 0x46a84b
push esi
call dword [sym.imp.KERNEL32.DLL_lstrlenW]
cmp eax, ebx
mov dword [ebp + 0x4c], eax
jle 0x46a757
mov cx, word [esi + eax*2 - 2]
cmp cx, 0x5c
je 0x46a753
cmp cx, 0x2f
jne 0x46a757
dec eax
mov dword [ebp + 0x4c], eax
lea ecx, [eax + 4]
cmp ecx, 0x212
mov dword [ebp + 0x40], ecx
jl 0x46a771
mov dword [ebp + 0x68], 0x80070057
jmp 0x46a884
lea esi, [eax + eax]
mov dword [ebp + 0x3c], esi
add esi, 7
and esi, 0xfffffffc
lea eax, [esi + 0xaa8]
push eax
lea ecx, [ebp + 0x60]
call fcn.004448de
mov eax, dword [ebp + 0x60]
push dword [ebp + 0x4c]
add esi, eax
push eax
lea edi, [esi + 0x250]
push edi
call fcn.00405988
mov eax, dword [ebp + 0x3c]
push 0xa
add eax, edi
push 0x4c313c
push eax
call fcn.004143a0
push esi
lea eax, [ebp + 0x64]
push edi
mov word [edi + 0x422], bx
push eax
mov dword [ebp + 0x64], ebx
call fcn.004ac6b1
add esp, 0x24
cmp dword [ebp + 0x64], ebx
je 0x46a841
test byte [esi], 0x10
je 0x46a7f1
cmp word [esi + 0x2c], 0x2e
jne 0x46a7f1
mov ax, word [esi + 0x2e]
cmp ax, bx
je 0x46a834
cmp ax, 0x2e
jne 0x46a7f1
cmp word [esi + 0x30], bx
je 0x46a834
lea eax, [esi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.DLL_lstrlenW]
add eax, dword [ebp + 0x40]
cmp eax, 0x211
jge 0x46a834
lea eax, [esi + 0x2c]
push eax
push dword [ebp + 0x60]
lea edi, [esi + 0x674]
push 0x4c3394
push edi
call dword [sym.imp.user32.dll_wsprintfW]
push dword [ebp + 0x7c]
mov word [esi + 0xa96], bx
push dword [ebp + 0x78]
push edi
call fcn.0046a528
add esp, 0x1c
push esi
lea ecx, [ebp + 0x64]
call fcn.00405aa0
test eax, eax
jne 0x46a7d0
lea ecx, [ebp + 0x64]
call fcn.00402cea
jmp 0x46a884
lea eax, [ebp + 0x48]
push eax
movzx eax, word [0x4dac14]
or eax, 0xf003f
push eax
push ebx
push dword [ebp + 0x74]
push 0x80000002
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
cmp eax, ebx
mov dword [ebp + 0x68], eax
jne 0x46a884
lea eax, [ebp + 0x60]
push eax
push dword [ebp + 0x50]
push dword [ebp + 0x48]
call fcn.0046a3f9
add esp, 0xc
cmp dword [ebp + 0x48], ebx
pop edi
je 0x46a893
push dword [ebp + 0x48]
call dword [sym.imp.advapi32.dll_RegCloseKey]
cmp dword [ebp + 0x50], ebx
je 0x46a8a1
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.DLL_LocalFree]
cmp dword [ebp + 0x54], ebx
pop esi
pop ebx
je 0x46a8b1
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.DLL_LocalFree]
lea ecx, [ebp + 0x38]
call fcn.0043e48d
lea ecx, [ebp + 0x60]
call fcn.0043e48d
mov eax, dword [ebp + 0x68]
add ebp, 0x6c
leave
ret