Function at 0x1005b49
Capabilities:
Get user security identifier

Disassembly:
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 0x1005b8c
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 0x1005b98
mov dword [ebp - 4], 8
jmp 0x1005cf4
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x1005bbc
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 0x1005bca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x1005cf4
push dword [ebp - 0x14]
mov ecx, dword [ebp - 0x24]
call fcn.01005784
cmp eax, edi
mov dword [ebp - 0xc], eax
je 0x1005cc2
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 0x1005c18
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x7a
je 0x1005c18
call ebx
jmp 0x1005cc8
push dword [ebp - 0x1c]
call esi
mov ebx, eax
test ebx, ebx
pop ecx
mov dword [ebp - 0x10], ebx
jne 0x1005c33
mov dword [ebp - 4], 8
jmp 0x1005ccb
mov eax, dword [ebp - 0x18]
add eax, eax
push eax
call esi
test eax, eax
pop ecx
mov dword [ebp - 0x20], eax
je 0x1005c27
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 0x1005cc2
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 0x1005c27
push 2
push edi
push ebx
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x1005cc2
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 0x1005cc2
push dword [ebp - 0x10]
push edi
push 2
push ebx
call esi
test eax, eax
je 0x1005cc2
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 0x1005ccb
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 0x1005cde
push dword [ebp - 0xc]
call esi
pop ecx
cmp dword [ebp - 0x10], edi
je 0x1005ce9
push dword [ebp - 0x10]
call esi
pop ecx
cmp dword [ebp - 0x20], edi
je 0x1005cf4
push dword [ebp - 0x20]
call esi
pop ecx
xor esi, esi
cmp dword [ebp - 0x14], esi
je 0x1005d04
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], esi
je 0x1005d1c
cmp dword [ebp - 8], esi
je 0x1005d1c
push dword [ebp - 8]
mov ecx, dword [ebp - 0x24]
call fcn.01005736
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