Function at 0x100648b
Capabilities:
Get user security identifier

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
mov esi, dword [sym.imp.msvcrt.dll_malloc]
push edi
xor edi, edi
push 0xc
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x20], edi
call esi
mov ebx, eax
cmp ebx, edi
pop ecx
mov dword [ebp - 8], ebx
je 0x10064d0
xor eax, eax
mov edi, ebx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x14
stosd dword es:[edi], eax
call esi
xor edi, edi
cmp eax, edi
pop ecx
mov dword [ebx + 4], eax
jne 0x10064dc
mov dword [ebp - 4], 8
jmp 0x1006638
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x1006500
lea eax, [ebp - 0x14]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x100650e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x1006638
push dword [ebp - 0x14]
mov ecx, dword [ebp - 0x24]
call fcn.01006033
cmp eax, edi
mov dword [ebp - 0xc], eax
je 0x1006606
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x18]
push eax
push edi
lea eax, [ebp - 0x1c]
push eax
push edi
push dword [ebp + 8]
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], edi
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
call edi
test eax, eax
jne 0x100655c
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x7a
je 0x100655c
call ebx
jmp 0x100660c
push dword [ebp - 0x1c]
call esi
mov ebx, eax
test ebx, ebx
pop ecx
mov dword [ebp - 0x10], ebx
jne 0x1006577
mov dword [ebp - 4], 8
jmp 0x100660f
mov eax, dword [ebp - 0x18]
add eax, eax
push eax
call esi
test eax, eax
pop ecx
mov dword [ebp - 0x20], eax
je 0x100656b
lea ecx, [ebp - 0x28]
push ecx
lea ecx, [ebp - 0x18]
push ecx
push eax
lea eax, [ebp - 0x1c]
push eax
push ebx
push dword [ebp + 8]
push 0
call edi
test eax, eax
je 0x1006606
mov edi, dword [sym.imp.ADVAPI32.dll_GetLengthSid]
push ebx
call edi
push dword [ebp - 0xc]
mov ebx, eax
call edi
lea edi, [ebx + eax + 0x18]
push edi
call esi
mov ebx, eax
test ebx, ebx
pop ecx
je 0x100656b
push 2
push edi
push ebx
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x1006606
push dword [ebp - 0xc]
mov esi, dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
mov edi, 0xd0000000
push edi
push 2
push ebx
call esi
test eax, eax
je 0x1006606
push dword [ebp - 0x10]
push edi
push 2
push ebx
call esi
test eax, eax
je 0x1006606
mov eax, dword [ebp - 8]
push 0
push ebx
push 1
push dword [eax + 4]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x100660f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
mov esi, dword [sym.imp.msvcrt.dll_free]
xor edi, edi
cmp dword [ebp - 0xc], edi
je 0x1006622
push dword [ebp - 0xc]
call esi
pop ecx
cmp dword [ebp - 0x10], edi
je 0x100662d
push dword [ebp - 0x10]
call esi
pop ecx
cmp dword [ebp - 0x20], edi
je 0x1006638
push dword [ebp - 0x20]
call esi
pop ecx
xor esi, esi
cmp dword [ebp - 0x14], esi
je 0x1006648
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], esi
je 0x1006660
cmp dword [ebp - 8], esi
je 0x1006660
push dword [ebp - 8]
mov ecx, dword [ebp - 0x24]
call fcn.01005fde
mov dword [ebp - 8], esi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret 4