Function at 0x401410
Capabilities:
Compare security identifiers

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x460068
push 0x4434e0
mov eax, dword fs:[0]
push eax
sub esp, 0x64
push ebx
push esi
push edi
mov eax, dword [0x4652b0]
xor dword [ebp - 8], eax
xor eax, ebp
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 4], ebx
mov esi, dword [ebp + 0x14]
push esi
call dword [sym.imp.ADVAPI32.dll_GetSidLengthRequired]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x1c], eax
cmp eax, ebx
jne 0x401497
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HeapAlloc___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
push esi
mov ecx, dword [ebp + 0x10]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSid]
test eax, eax
jne 0x4014c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeSid___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
lea edi, [ebp + 0x18]
mov dword [ebp - 0x38], edi
xor esi, esi
mov ebx, dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov dword [ebp - 0x4c], esi
movzx edx, byte [ebp + 0x14]
cmp esi, edx
jae 0x4014ee
add edi, 4
mov dword [ebp - 0x38], edi
push esi
mov eax, dword [ebp - 0x1c]
push eax
call ebx
mov ecx, dword [edi - 4]
mov dword [eax], ecx
inc esi
jmp 0x4014ce
mov dword [ebp - 0x38], 0
lea edx, [ebp - 0x28]
push edx
push 0
mov eax, dword [ebp - 0x24]
push eax
mov edi, 4
push edi
mov ecx, dword [ebp + 8]
push ecx
mov esi, dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
call esi
test eax, eax
jne 0x4018aa
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x7a
je 0x40153b
call ebx
push eax
push str.GetFileSecurity___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
mov edx, dword [ebp - 0x28]
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x24], eax
test eax, eax
jne 0x40156a
call ebx
push eax
push str.HeapAlloc___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [ebp - 0x28]
push edx
push eax
push edi
mov eax, dword [ebp + 8]
push eax
call esi
xor esi, esi
cmp eax, esi
je 0x401526
push 1
lea ecx, [ebp - 0x74]
push ecx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x4015a5
call ebx
push eax
push str.InitializeSecurityDescriptor___failed.Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
lea edx, [ebp - 0x54]
push edx
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x4015d4
call ebx
push eax
push str.GetSecurityDescriptorDacl___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x5c], 8
mov eax, dword [ebp - 0x30]
cmp eax, esi
jne 0x40163c
mov dword [ebp - 0x2c], esi
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 0x5c]
lea esi, [eax + ecx + 8]
push esi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 0x44], edi
test edi, edi
je 0x401555
push 2
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
jne 0x401669
call ebx
push eax
push str.InitializeAcl___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
cmp dword [ebp - 0x2c], esi
je 0x4015eb
push 2
push 0xc
lea ecx, [ebp - 0x60]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
jne 0x4015eb
call ebx
push eax
push str.GetAclInformation___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
xor esi, esi
mov dword [ebp - 0x3c], esi
cmp dword [ebp - 0x2c], esi
je 0x4016fa
cmp dword [ebp - 0x60], esi
je 0x4016fa
mov dword [ebp - 0x34], esi
cmp esi, dword [ebp - 0x60]
jae 0x4016fd
lea edx, [ebp - 0x20]
push edx
push esi
mov eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
jne 0x4016ac
call ebx
push eax
push str.GetAce___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
mov eax, dword [ebp - 0x20]
test byte [eax + 1], 0x10
jne 0x4016fd
add eax, 8
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x4016f7
mov eax, dword [ebp - 0x20]
movzx edx, word [eax + 2]
push edx
push eax
push 0xffffffffffffffff
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
jne 0x4016f4
call ebx
push eax
push str.AddAce___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
inc dword [ebp - 0x3c]
inc esi
jmp 0x40167c
mov esi, dword [ebp - 0x34]
push str.AddAccessAllowedAceEx
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x401740
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp + 0xc]
push edx
push 3
push 2
push edi
call eax
test eax, eax
jne 0x40176a
call ebx
push eax
push str.AddAccessAllowedAceEx___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x40176a
call ebx
push eax
push str.AddAccessAllowedAce___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
cmp dword [ebp - 0x2c], 0
je 0x4017b4
cmp dword [ebp - 0x60], 0
je 0x4017b4
cmp esi, dword [ebp - 0x60]
jae 0x4017b4
lea edx, [ebp - 0x20]
push edx
push esi
mov eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x401697
mov eax, dword [ebp - 0x20]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x4016df
inc esi
mov dword [ebp - 0x34], esi
jmp 0x401776
push 0
push edi
push 1
lea edx, [ebp - 0x74]
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x4017dc
call ebx
push eax
push str.SetSecurityDescriptorDacl___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
push str.SetSecurityDescriptorControl
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
xor esi, esi
cmp ebx, esi
je 0x401875
xor edi, edi
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x50], esi
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x40]
push ecx
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
jne 0x40182f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorControl___failed.Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
mov eax, dword [ebp - 0x40]
test eax, 0x400
je 0x401840
mov esi, 0x500
jmp 0x40184c
test eax, 0x1000
je 0x40184e
mov esi, 0x1000
mov edi, esi
test si, si
je 0x401875
push edi
push esi
lea eax, [ebp - 0x74]
push eax
call ebx
test eax, eax
jne 0x401875
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorControl___failed.Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
lea ecx, [ebp - 0x74]
push ecx
mov eax, 4
push eax
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
test eax, eax
jne 0x4018a3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetFileSecurity___failed._Error__d_n
call fcn.0043e726
add esp, 8
jmp 0x4018aa
mov dword [ebp - 0x48], 1
mov dword [ebp - 4], 0xfffffffe
call fcn.004018cb
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret