Function at 0x46dbaf
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 0x46dbe4
mov eax, str.MACHINE_
push eax
lea ecx, [ebp + 0x60]
call fcn.004505eb
cmp esi, ebx
jne 0x46dbfc
push dword [ebp + 0x74]
lea ecx, [ebp + 0x60]
call fcn.004465fa
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.0044641a
cmp dword [ebp + 0x44], ebx
je 0x46dcc9
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.0044645c
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 0x46dc86
lea ecx, [ebp + 0x34]
push ecx
push eax
mov dword [ebp + 0x58], eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x46dca4
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 0x46dcb9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x46dcb1
xor eax, eax
inc eax
mov dword [ebp + 0x68], eax
jmp 0x46df0b
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 0x46df0b
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 0x46dd16
cmp word [eax], bx
je 0x46dd16
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x64], 1
cmp dword [ebp + 0x64], ebx
mov dword [ebp + 0x68], ebx
jle 0x46dd5b
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_BuildExplicitAccessWithNameW]
inc dword [ebp + 0x68]
mov eax, dword [ebp + 0x68]
add dword [ebp + 0x58], 0x20
cmp eax, dword [ebp + 0x64]
jl 0x46dd37
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 0x46df0b
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 0x46df0b
cmp byte [ebp + 0x5f], bl
jle 0x46df0b
cmp dword [ebp + 0x54], ebx
je 0x46ddb2
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp + 0x54], ebx
cmp dword [ebp + 0x44], ebx
je 0x46ded2
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, ebx
mov dword [ebp + 0x4c], eax
jle 0x46ddde
mov cx, word [esi + eax*2 - 2]
cmp cx, 0x5c
je 0x46ddda
cmp cx, 0x2f
jne 0x46ddde
dec eax
mov dword [ebp + 0x4c], eax
lea ecx, [eax + 4]
cmp ecx, 0x212
mov dword [ebp + 0x40], ecx
jl 0x46ddf8
mov dword [ebp + 0x68], 0x80070057
jmp 0x46df0b
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.0044645c
mov eax, dword [ebp + 0x60]
push dword [ebp + 0x4c]
add esi, eax
push eax
lea edi, [esi + 0x250]
push edi
call fcn.00405c0c
mov eax, dword [ebp + 0x3c]
push 0xa
add eax, edi
push 0x4ca28c
push eax
call fcn.00414839
push esi
lea eax, [ebp + 0x64]
push edi
mov word [edi + 0x422], bx
push eax
mov dword [ebp + 0x64], ebx
call fcn.004b3c03
add esp, 0x24
cmp dword [ebp + 0x64], ebx
je 0x46dec8
test byte [esi], 0x10
je 0x46de78
cmp word [esi + 0x2c], 0x2e
jne 0x46de78
mov ax, word [esi + 0x2e]
cmp ax, bx
je 0x46debb
cmp ax, 0x2e
jne 0x46de78
cmp word [esi + 0x30], bx
je 0x46debb
lea eax, [esi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, dword [ebp + 0x40]
cmp eax, 0x211
jge 0x46debb
lea eax, [esi + 0x2c]
push eax
push dword [ebp + 0x60]
lea edi, [esi + 0x674]
push 0x4cb338
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.0046dbaf
add esp, 0x1c
push esi
lea ecx, [ebp + 0x64]
call fcn.00405ce3
test eax, eax
jne 0x46de57
lea ecx, [ebp + 0x64]
call fcn.00402d60
jmp 0x46df0b
lea eax, [ebp + 0x48]
push eax
movzx eax, word [0x4e2c20]
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 0x46df0b
lea eax, [ebp + 0x60]
push eax
push dword [ebp + 0x50]
push dword [ebp + 0x48]
call fcn.0046da80
add esp, 0xc
cmp dword [ebp + 0x48], ebx
pop edi
je 0x46df1a
push dword [ebp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 0x50], ebx
je 0x46df28
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp + 0x54], ebx
pop esi
pop ebx
je 0x46df38
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebp + 0x38]
call fcn.0043fe25
lea ecx, [ebp + 0x60]
call fcn.0043fe25
mov eax, dword [ebp + 0x68]
add ebp, 0x6c
leave
ret