Function at 0x1006d77d
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 0x1006d7b2
mov eax, str.MACHINE_
push eax
lea ecx, [ebp + 0x60]
call fcn.100501eb
cmp esi, ebx
jne 0x1006d7ca
push dword [ebp + 0x74]
lea ecx, [ebp + 0x60]
call fcn.1004618f
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.10045faf
cmp dword [ebp + 0x44], ebx
je 0x1006d897
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.10045ff1
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 0x1006d854
lea ecx, [ebp + 0x34]
push ecx
push eax
mov dword [ebp + 0x58], eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x1006d872
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 0x1006d887
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x1006d87f
xor eax, eax
inc eax
mov dword [ebp + 0x68], eax
jmp 0x1006dad9
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 0x1006dad9
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 0x1006d8e4
cmp word [eax], bx
je 0x1006d8e4
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x64], 1
cmp dword [ebp + 0x64], ebx
mov dword [ebp + 0x68], ebx
jle 0x1006d929
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 0x1006d905
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 0x1006dad9
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 0x1006dad9
cmp byte [ebp + 0x5f], bl
jle 0x1006dad9
cmp dword [ebp + 0x54], ebx
je 0x1006d980
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp + 0x54], ebx
cmp dword [ebp + 0x44], ebx
je 0x1006daa0
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, ebx
mov dword [ebp + 0x4c], eax
jle 0x1006d9ac
mov cx, word [esi + eax*2 - 2]
cmp cx, 0x5c
je 0x1006d9a8
cmp cx, 0x2f
jne 0x1006d9ac
dec eax
mov dword [ebp + 0x4c], eax
lea ecx, [eax + 4]
cmp ecx, 0x212
mov dword [ebp + 0x40], ecx
jl 0x1006d9c6
mov dword [ebp + 0x68], 0x80070057
jmp 0x1006dad9
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.10045ff1
mov eax, dword [ebp + 0x60]
push dword [ebp + 0x4c]
add esi, eax
push eax
lea edi, [esi + 0x250]
push edi
call fcn.10005b3b
mov eax, dword [ebp + 0x3c]
push 0xa
add eax, edi
push 0x100ca294
push eax
call fcn.100144ff
push esi
lea eax, [ebp + 0x64]
push edi
mov word [edi + 0x422], bx
push eax
mov dword [ebp + 0x64], ebx
call fcn.100b37d1
add esp, 0x24
cmp dword [ebp + 0x64], ebx
je 0x1006da96
test byte [esi], 0x10
je 0x1006da46
cmp word [esi + 0x2c], 0x2e
jne 0x1006da46
mov ax, word [esi + 0x2e]
cmp ax, bx
je 0x1006da89
cmp ax, 0x2e
jne 0x1006da46
cmp word [esi + 0x30], bx
je 0x1006da89
lea eax, [esi + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, dword [ebp + 0x40]
cmp eax, 0x211
jge 0x1006da89
lea eax, [esi + 0x2c]
push eax
push dword [ebp + 0x60]
lea edi, [esi + 0x674]
push 0x100cb348
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.1006d77d
add esp, 0x1c
push esi
lea ecx, [ebp + 0x64]
call fcn.10005c13
test eax, eax
jne 0x1006da25
lea ecx, [ebp + 0x64]
call fcn.10002d8b
jmp 0x1006dad9
lea eax, [ebp + 0x48]
push eax
movzx eax, word [0x100e2c20]
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 0x1006dad9
lea eax, [ebp + 0x60]
push eax
push dword [ebp + 0x50]
push dword [ebp + 0x48]
call fcn.1006d64e
add esp, 0xc
cmp dword [ebp + 0x48], ebx
pop edi
je 0x1006dae8
push dword [ebp + 0x48]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 0x50], ebx
je 0x1006daf6
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp + 0x54], ebx
pop esi
pop ebx
je 0x1006db06
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [ebp + 0x38]
call fcn.1003f96c
lea ecx, [ebp + 0x60]
call fcn.1003f96c
mov eax, dword [ebp + 0x68]
add ebp, 0x6c
leave
ret