Function at 0x46b8d7
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 0x46b90c
mov eax, str.MACHINE_
push eax
lea ecx, [ebp + 0x60]
call fcn.0044e66d
cmp esi, ebx
jne 0x46b924
push dword [ebp + 0x74]
lea ecx, [ebp + 0x60]
call fcn.00444e9e
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.00444cbe
cmp dword [ebp + 0x44], ebx
je 0x46b9f1
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.00444d00
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 0x46b9ae
lea ecx, [ebp + 0x34]
push ecx
push eax
mov dword [ebp + 0x58], eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x46b9cc
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 0x46b9e1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x46b9d9
xor eax, eax
inc eax
mov dword [ebp + 0x68], eax
jmp 0x46bc33
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 0x46bc33
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 0x46ba3e
cmp word [eax], bx
je 0x46ba3e
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x64], 1
cmp dword [ebp + 0x64], ebx
mov dword [ebp + 0x68], ebx
jle 0x46ba83
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 0x46ba5f
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 0x46bc33
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 0x46bc33
cmp byte [ebp + 0x5f], bl
jle 0x46bc33
cmp dword [ebp + 0x54], ebx
je 0x46bada
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp + 0x54], ebx
cmp dword [ebp + 0x44], ebx
je 0x46bbfa
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, ebx
mov dword [ebp + 0x4c], eax
jle 0x46bb06
mov cx, word [esi + eax*2 - 2]
cmp cx, 0x5c
je 0x46bb02
cmp cx, 0x2f
jne 0x46bb06
dec eax
mov dword [ebp + 0x4c], eax
lea ecx, [eax + 4]
cmp ecx, 0x212
mov dword [ebp + 0x40], ecx
jl 0x46bb20
mov dword [ebp + 0x68], 0x80070057
jmp 0x46bc33
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.00444d00
mov eax, dword [ebp + 0x60]
push dword [ebp + 0x4c]
add esi, eax
push eax
lea edi, [esi + 0x250]
push edi
call fcn.00405b32
mov eax, dword [ebp + 0x3c]
push 0xa
add eax, edi
push 0x4c41b4
push eax
call fcn.00414409
push esi
lea eax, [ebp + 0x64]
push edi
mov word [edi + 0x422], bx
push eax
mov dword [ebp + 0x64], ebx
call fcn.004ad1e9
add esp, 0x24
cmp dword [ebp + 0x64], ebx
je 0x46bbf0
test byte [esi], 0x10
je 0x46bba0
cmp word [esi + 0x2c], 0x2e
jne 0x46bba0
mov ax, word [esi + 0x2e]
cmp ax, bx
je 0x46bbe3
cmp ax, 0x2e
jne 0x46bba0
cmp word [esi + 0x30], bx
je 0x46bbe3
lea eax, [esi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, dword [ebp + 0x40]
cmp eax, 0x211
jge 0x46bbe3
lea eax, [esi + 0x2c]
push eax
push dword [ebp + 0x60]
lea edi, [esi + 0x674]
push 0x4c4414
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.0046b8d7
add esp, 0x1c
push esi
lea ecx, [ebp + 0x64]
call fcn.00405c60
test eax, eax
jne 0x46bb7f
lea ecx, [ebp + 0x64]
call fcn.00402ce5
jmp 0x46bc33
lea eax, [ebp + 0x48]
push eax
movzx eax, word [0x4dbc28]
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 0x46bc33
lea eax, [ebp + 0x60]
push eax
push dword [ebp + 0x50]
push dword [ebp + 0x48]
call fcn.0046b7a8
add esp, 0xc
cmp dword [ebp + 0x48], ebx
pop edi
je 0x46bc42
push dword [ebp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 0x50], ebx
je 0x46bc50
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp + 0x54], ebx
pop esi
pop ebx
je 0x46bc60
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebp + 0x38]
call fcn.0043e679
lea ecx, [ebp + 0x60]
call fcn.0043e679
mov eax, dword [ebp + 0x68]
add ebp, 0x6c
leave
ret