Function at 0x406c20
Capabilities:
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x55f5e8
push 0x507e60
mov eax, dword fs:[0]
push eax
sub esp, 0x74
mov eax, dword [0x575c78]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x6c], ebx
mov esi, dword [ebp + 0xc]
xor edi, edi
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x4c], edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x3c], edi
mov dword [ebp - 4], edi
lea eax, [ebp - 0x68]
push eax
lea ecx, [ebp - 0x54]
push ecx
push edi
lea edx, [ebp - 0x4c]
push edx
push edi
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
cmp eax, edi
jne 0x406fce
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406fce
mov eax, dword [ebp - 0x4c]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call edi
mov dword [ebp - 0x40], eax
test eax, eax
je 0x406fcc
mov ecx, dword [ebp - 0x54]
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x50], eax
test eax, eax
je 0x406fcc
lea edx, [ebp - 0x68]
push edx
lea eax, [ebp - 0x54]
push eax
mov ecx, dword [ebp - 0x50]
push ecx
lea edx, [ebp - 0x4c]
push edx
mov eax, dword [ebp - 0x40]
push eax
push esi
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
test eax, eax
je 0x406fcc
lea ecx, [ebp - 0x48]
push ecx
push 0
push 0
push 4
push ebx
mov esi, dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
call esi
test eax, eax
jne 0x406fcc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406fcc
mov edx, dword [ebp - 0x48]
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x34], eax
test eax, eax
je 0x406fcc
lea eax, [ebp - 0x48]
push eax
mov ecx, dword [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x34]
push edx
push 4
push ebx
call esi
test eax, eax
je 0x406fcc
push 1
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x406fcc
lea ecx, [ebp - 0x70]
push ecx
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x38]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x406fcc
xor ecx, ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x24], 8
mov eax, dword [ebp - 0x44]
cmp eax, ecx
jne 0x406db8
mov dword [ebp - 0x38], ecx
jmp 0x406dd4
cmp dword [ebp - 0x38], ecx
je 0x406dd4
push 2
push 0xc
lea edx, [ebp - 0x28]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
je 0x406fcc
mov ebx, dword [ebp - 0x40]
push ebx
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 0x24]
lea esi, [eax + ecx + 8]
push esi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x406fcc
push 2
push esi
mov edx, eax
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x406fcc
mov dword [ebp - 0x58], 0
cmp dword [ebp - 0x38], 0
je 0x406e88
cmp dword [ebp - 0x28], 0
je 0x406e88
xor esi, esi
mov dword [ebp - 0x3c], esi
mov edi, dword [sym.imp.ADVAPI32.dll_EqualSid]
mov edi, edi
cmp esi, dword [ebp - 0x28]
jae 0x406e8b
lea eax, [ebp - 0x30]
push eax
push esi
mov ecx, dword [ebp - 0x44]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x406fcc
mov eax, dword [ebp - 0x30]
test byte [eax + 1], 0x10
jne 0x406e8b
add eax, 8
push eax
push ebx
call edi
test eax, eax
jne 0x406e82
mov eax, dword [ebp - 0x30]
movzx edx, word [eax + 2]
push edx
push eax
push 0xffffffffffffffff
push 2
mov eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x406fcc
inc dword [ebp - 0x58]
inc esi
mov dword [ebp - 0x3c], esi
jmp 0x406e30
mov esi, dword [ebp - 0x3c]
push str.AddAccessAllowedAceEx
push str.advapi32.dll
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebx
test eax, eax
je 0x406eb9
mov ecx, dword [ebp + 0x10]
push ecx
push 3
push 2
mov edx, dword [ebp - 0x2c]
push edx
call eax
jmp 0x406ec9
mov eax, dword [ebp + 0x10]
push eax
push 2
mov ecx, dword [ebp - 0x2c]
push ecx
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x406fcc
cmp dword [ebp - 0x38], 0
je 0x406f21
cmp dword [ebp - 0x28], 0
je 0x406f21
lea ecx, [ecx]
cmp esi, dword [ebp - 0x28]
jae 0x406f21
lea edx, [ebp - 0x30]
push edx
push esi
mov eax, dword [ebp - 0x44]
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x406fcc
mov eax, dword [ebp - 0x30]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
mov edx, dword [ebp - 0x2c]
push edx
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x406fcc
inc esi
mov dword [ebp - 0x3c], esi
jmp 0x406ee0
push 0
mov eax, dword [ebp - 0x2c]
push eax
push 1
lea ecx, [ebp - 0x84]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x406fcc
push str.SetSecurityDescriptorControl
push str.advapi32.dll
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
xor esi, esi
cmp ebx, esi
je 0x406faa
xor edi, edi
mov dword [ebp - 0x5c], esi
mov dword [ebp - 0x60], esi
lea edx, [ebp - 0x60]
push edx
lea eax, [ebp - 0x5c]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
je 0x406fcc
mov eax, dword [ebp - 0x5c]
test eax, 0x400
je 0x406f88
mov esi, 0x500
jmp 0x406f94
test eax, 0x1000
je 0x406f96
mov esi, 0x1000
mov edi, esi
test si, si
je 0x406faa
push edi
push esi
lea edx, [ebp - 0x84]
push edx
call ebx
test eax, eax
je 0x406fcc
lea eax, [ebp - 0x84]
push eax
mov eax, 4
push eax
mov ecx, dword [ebp - 0x6c]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
test eax, eax
je 0x406fcc
mov dword [ebp - 0x64], 1
xor edi, edi
mov dword [ebp - 4], 0xfffffffe
call fcn.00406ffb
mov eax, dword [ebp - 0x64]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00506356
mov esp, ebp
pop ebp
ret