Function at 0x407640
Capabilities:
Compare security identifiers

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41c940
push 0x40f3fc
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x54
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 4], edi
mov byte [ebp - 0x30], 0
mov byte [ebp - 0x2f], 0
mov byte [ebp - 0x2e], 0
mov byte [ebp - 0x2d], 0
mov byte [ebp - 0x2c], 0
mov byte [ebp - 0x2b], 5
lea eax, [ebp - 0x20]
push eax
push edi
push edi
push edi
push edi
push edi
push edi
push 0x220
push 0x20
push 2
lea ecx, [ebp - 0x30]
push ecx
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x40785c
lea edx, [ebp - 0x34]
push edx
push edi
push edi
push 4
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
call ebx
push eax
mov esi, dword [sym.imp.ADVAPI32.dll_GetKernelObjectSecurity]
call esi
test eax, eax
jne 0x4076fd
mov eax, dword [ebp - 0x34]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x40785c
lea ecx, [ebp - 0x34]
push ecx
mov edx, dword [ebp - 0x34]
push edx
push eax
push 4
call ebx
push eax
call esi
test eax, eax
je 0x40785c
lea ecx, [ebp - 0x38]
push ecx
lea edx, [ebp - 0x3c]
push edx
lea eax, [ebp - 0x40]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x40785c
mov eax, dword [ebp - 0x3c]
test eax, eax
jne 0x407729
mov dword [ebp - 0x40], 0
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov esi, eax
add esi, 0x10
mov dword [ebp - 0x44], esi
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x40774e
mov eax, dword [ebp - 0x3c]
movzx ecx, word [eax + 2]
add esi, ecx
mov dword [ebp - 0x44], esi
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
mov dword [ebp - 0x28], edi
test edi, edi
je 0x40785c
push 2
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x40785c
mov dword [ebp - 0x48], 0x100440
mov edx, dword [ebp - 0x20]
push edx
push 0x100440
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x4077b4
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call fcn.0040f346
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x407823
xor esi, esi
mov dword [ebp - 0x4c], esi
mov ebx, dword [sym.imp.ADVAPI32.dll_AddAce]
mov eax, dword [ebp - 0x3c]
movzx ecx, word [eax + 4]
cmp esi, ecx
jae 0x40781d
lea edx, [ebp - 0x50]
push edx
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40785c
mov eax, dword [ebp - 0x50]
cmp byte [eax], 0
jne 0x407806
mov ecx, dword [ebp - 0x20]
push ecx
add eax, 8
push eax
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
mov eax, dword [ebp - 0x50]
je 0x407806
mov edx, dword [ebp - 0x48]
cmp dword [eax + 4], edx
je 0x407817
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push edi
call ebx
test eax, eax
je 0x40785c
inc esi
mov dword [ebp - 0x4c], esi
jmp 0x4077c6
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push 1
lea edx, [ebp - 0x64]
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
push 0
push edi
push 1
lea eax, [ebp - 0x64]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x40785c
lea ecx, [ebp - 0x64]
push ecx
push 4
call ebx
push eax
call dword [sym.imp.ADVAPI32.dll_SetKernelObjectSecurity]
test eax, eax
je 0x40785c
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], 0xffffffff
call fcn.0040787f
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret