Function at 0x46ba45
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 0x46ba7a
mov eax, str.MACHINE_
push eax
lea ecx, [ebp + 0x60]
call fcn.0044e827
cmp esi, ebx
jne 0x46ba92
push dword [ebp + 0x74]
lea ecx, [ebp + 0x60]
call fcn.00444fd8
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.00444df8
cmp dword [ebp + 0x44], ebx
je 0x46bb5f
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.00444e3a
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 0x46bb1c
lea ecx, [ebp + 0x34]
push ecx
push eax
mov dword [ebp + 0x58], eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x46bb3a
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 0x46bb4f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x46bb47
xor eax, eax
inc eax
mov dword [ebp + 0x68], eax
jmp 0x46bda1
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 0x46bda1
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 0x46bbac
cmp word [eax], bx
je 0x46bbac
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x64], 1
cmp dword [ebp + 0x64], ebx
mov dword [ebp + 0x68], ebx
jle 0x46bbf1
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 0x46bbcd
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 0x46bda1
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 0x46bda1
cmp byte [ebp + 0x5f], bl
jle 0x46bda1
cmp dword [ebp + 0x54], ebx
je 0x46bc48
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp + 0x54], ebx
cmp dword [ebp + 0x44], ebx
je 0x46bd68
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, ebx
mov dword [ebp + 0x4c], eax
jle 0x46bc74
mov cx, word [esi + eax*2 - 2]
cmp cx, 0x5c
je 0x46bc70
cmp cx, 0x2f
jne 0x46bc74
dec eax
mov dword [ebp + 0x4c], eax
lea ecx, [eax + 4]
cmp ecx, 0x212
mov dword [ebp + 0x40], ecx
jl 0x46bc8e
mov dword [ebp + 0x68], 0x80070057
jmp 0x46bda1
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.00444e3a
mov eax, dword [ebp + 0x60]
push dword [ebp + 0x4c]
add esi, eax
push eax
lea edi, [esi + 0x250]
push edi
call fcn.00405b5e
mov eax, dword [ebp + 0x3c]
push 0xa
add eax, edi
push 0x4c51d4
push eax
call fcn.004145c5
push esi
lea eax, [ebp + 0x64]
push edi
mov word [edi + 0x422], bx
push eax
mov dword [ebp + 0x64], ebx
call fcn.004adf6b
add esp, 0x24
cmp dword [ebp + 0x64], ebx
je 0x46bd5e
test byte [esi], 0x10
je 0x46bd0e
cmp word [esi + 0x2c], 0x2e
jne 0x46bd0e
mov ax, word [esi + 0x2e]
cmp ax, bx
je 0x46bd51
cmp ax, 0x2e
jne 0x46bd0e
cmp word [esi + 0x30], bx
je 0x46bd51
lea eax, [esi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, dword [ebp + 0x40]
cmp eax, 0x211
jge 0x46bd51
lea eax, [esi + 0x2c]
push eax
push dword [ebp + 0x60]
lea edi, [esi + 0x674]
push 0x4c542c
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.0046ba45
add esp, 0x1c
push esi
lea ecx, [ebp + 0x64]
call fcn.00405c76
test eax, eax
jne 0x46bced
lea ecx, [ebp + 0x64]
call fcn.00402cfa
jmp 0x46bda1
lea eax, [ebp + 0x48]
push eax
movzx eax, word [0x4dcc20]
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 0x46bda1
lea eax, [ebp + 0x60]
push eax
push dword [ebp + 0x50]
push dword [ebp + 0x48]
call fcn.0046b916
add esp, 0xc
cmp dword [ebp + 0x48], ebx
pop edi
je 0x46bdb0
push dword [ebp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 0x50], ebx
je 0x46bdbe
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp + 0x54], ebx
pop esi
pop ebx
je 0x46bdce
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebp + 0x38]
call fcn.0043e825
lea ecx, [ebp + 0x60]
call fcn.0043e825
mov eax, dword [ebp + 0x68]
add ebp, 0x6c
leave
ret