Function at 0x405b40
Capabilities:
Compare security identifiers

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x4726c0
push 0x44a340
mov eax, dword fs:[0]
push eax
sub esp, 0x64
push ebx
push esi
push edi
mov eax, dword [0x478424]
xor dword [ebp - 8], eax
xor eax, ebp
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
cmp byte [0x47f7cc], 0
jne 0x405b8d
xor al, al
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor edi, edi
push edi
mov ebx, dword [ebp + 8]
push ebx
call fcn.00447490
add esp, 8
cmp eax, edi
jne 0x405b79
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 4], edi
push str.CreateWellKnownSid
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
cmp esi, edi
je 0x405eef
mov dword [ebp - 0x44], 0x44
push 0x44
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call edi
mov dword [ebp - 0x20], eax
test eax, eax
je 0x405eef
lea ecx, [ebp - 0x44]
push ecx
push eax
push 0
push 1
call esi
test eax, eax
je 0x405eef
mov dword [ebp - 0x2c], 0
lea edx, [ebp - 0x2c]
push edx
push 0
push 0
push 4
push ebx
mov esi, dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
call esi
test eax, eax
jne 0x405eef
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x405eef
mov eax, dword [ebp - 0x2c]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x28], eax
test eax, eax
je 0x405eef
lea ecx, [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x2c]
push edx
push eax
push 4
push ebx
call esi
test eax, eax
je 0x405eef
push 1
lea ecx, [ebp - 0x74]
push ecx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x405eef
xor eax, eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x48], eax
lea edx, [ebp - 0x48]
push edx
lea eax, [ebp - 0x34]
push eax
lea ecx, [ebp - 0x30]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x405eef
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x405eef
xor ebx, ebx
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x5c], 8
cmp dword [ebp - 0x30], ebx
je 0x405cdf
push 2
push 0xc
lea ecx, [ebp - 0x60]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
je 0x405eef
mov edx, dword [ebp - 0x20]
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 edi
mov dword [ebp - 0x1c], eax
cmp eax, ebx
je 0x405eef
push 2
push esi
mov edx, eax
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x405eef
mov dword [ebp - 0x38], ebx
cmp dword [ebp - 0x30], ebx
je 0x405d97
cmp dword [ebp - 0x60], ebx
je 0x405d97
xor esi, esi
mov bl, 0x10
mov edi, dword [sym.imp.ADVAPI32.dll_EqualSid]
mov dword [ebp - 0x4c], esi
cmp esi, dword [ebp - 0x60]
jae 0x405d97
lea eax, [ebp - 0x24]
push eax
push esi
mov ecx, dword [ebp - 0x34]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x405eef
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x405eef
test byte [eax + 1], bl
jne 0x405d97
add eax, 8
push eax
mov edx, dword [ebp - 0x20]
push edx
call edi
test eax, eax
jne 0x405d92
mov eax, dword [ebp - 0x24]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x405eef
add dword [ebp - 0x38], 1
add esi, 1
jmp 0x405d32
push str.AddAccessAllowedAceEx
push str.advapi32.dll
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
push eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call ebx
test eax, eax
je 0x405dcc
mov ecx, dword [ebp - 0x20]
push ecx
mov ecx, 0x10000000
push ecx
push 3
push 2
mov edx, dword [ebp - 0x1c]
push edx
call eax
jmp 0x405de2
mov eax, dword [ebp - 0x20]
push eax
mov eax, 0x10000000
push eax
push 2
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x405eef
cmp dword [ebp - 0x30], 0
je 0x405e43
cmp dword [ebp - 0x60], 0
je 0x405e43
xor esi, esi
mov dword [ebp - 0x50], esi
cmp esi, dword [ebp - 0x60]
jae 0x405e43
lea edx, [ebp - 0x24]
push edx
push esi
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x405eef
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x405eef
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x405eef
add esi, 1
jmp 0x405df8
push 0
mov eax, dword [ebp - 0x1c]
push eax
push 1
lea ecx, [ebp - 0x74]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x405eef
push str.SetSecurityDescriptorControl
push str.advapi32.dll
call edi
push eax
call ebx
mov ebx, eax
xor esi, esi
cmp ebx, esi
je 0x405ec2
xor edi, edi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x54], esi
lea edx, [ebp - 0x54]
push edx
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
je 0x405eef
mov eax, dword [ebp - 0x3c]
test eax, 0x400
je 0x405ea3
mov esi, 0x500
jmp 0x405eaf
test eax, 0x1000
je 0x405eb1
mov esi, 0x1000
mov edi, esi
test si, si
je 0x405ec2
push edi
push esi
lea edx, [ebp - 0x74]
push edx
call ebx
test eax, eax
je 0x405eef
lea eax, [ebp - 0x74]
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSecurityDescriptor]
test eax, eax
je 0x405eef
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
je 0x405eef
mov dword [ebp - 0x40], 1
mov dword [ebp - 4], 0xfffffffe
call fcn.00405f16
xor eax, eax
cmp dword [ebp - 0x40], 1
sete al
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret