Function at 0x401390
Capabilities:
Compare security identifiers
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x429b78
push 0x412c20
mov eax, dword fs:[0]
push eax
sub esp, 0x6c
push ebx
push esi
push edi
mov eax, dword [0x42d2ec]
xor dword [ebp - 8], eax
xor eax, ebp
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov ebx, ecx
xor edi, edi
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x50], edi
mov dword [ebp - 4], edi
lea eax, [ebp - 0x54]
push eax
lea ecx, [ebp - 0x3c]
push ecx
push edi
lea edx, [ebp - 0x40]
push edx
push edi
push ebx
push edi
mov esi, dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
call esi
cmp eax, edi
jne 0x401709
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x401709
mov eax, dword [ebp - 0x40]
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 - 0x20], eax
test eax, eax
je 0x401707
mov ecx, dword [ebp - 0x3c]
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x44], eax
test eax, eax
je 0x401707
lea edx, [ebp - 0x54]
push edx
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
lea edx, [ebp - 0x40]
push edx
mov eax, dword [ebp - 0x20]
push eax
push ebx
push 0
call esi
test eax, eax
je 0x401707
lea ecx, [ebp - 0x2c]
push ecx
push 0
push 0
push 4
mov ebx, dword [ebp + 8]
push ebx
mov esi, dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
call esi
test eax, eax
jne 0x401707
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x401707
mov edx, dword [ebp - 0x2c]
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x28], eax
test eax, eax
je 0x401707
lea eax, [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x2c]
push ecx
mov edx, dword [ebp - 0x28]
push edx
push 4
push ebx
call esi
test eax, eax
je 0x401707
push 1
lea eax, [ebp - 0x7c]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x401707
lea ecx, [ebp - 0x5c]
push ecx
lea edx, [ebp - 0x34]
push edx
lea eax, [ebp - 0x30]
push eax
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x401707
xor ebx, ebx
mov dword [ebp - 0x68], ebx
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x64], 8
mov eax, dword [ebp - 0x34]
cmp eax, ebx
jne 0x40151f
mov dword [ebp - 0x30], ebx
jmp 0x40153d
cmp dword [ebp - 0x30], ebx
je 0x40153d
push 2
push 0xc
lea edx, [ebp - 0x68]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
je 0x401707
xor ebx, ebx
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 0x64]
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 0x401707
push 2
push esi
mov edx, eax
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x401707
xor esi, esi
mov dword [ebp - 0x48], esi
cmp dword [ebp - 0x30], esi
je 0x4015f1
cmp dword [ebp - 0x68], esi
je 0x4015f1
mov dword [ebp - 0x38], esi
mov ebx, dword [sym.imp.ADVAPI32.dll_EqualSid]
mov edi, dword [sym.imp.ADVAPI32.dll_AddAce]
cmp esi, dword [ebp - 0x68]
jae 0x4015fa
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 0x401707
mov eax, dword [ebp - 0x24]
test byte [eax + 1], 0x10
jne 0x4015fa
add eax, 8
push eax
mov edx, dword [ebp - 0x20]
push edx
call ebx
test eax, eax
jne 0x4015e9
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 edi
test eax, eax
je 0x401707
add dword [ebp - 0x48], 1
add esi, 1
mov dword [ebp - 0x38], esi
jmp 0x401597
mov edi, dword [sym.imp.ADVAPI32.dll_AddAce]
mov esi, dword [ebp - 0x38]
mov eax, dword [ebp - 0x20]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push 2
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x401707
cmp dword [ebp - 0x30], 0
je 0x401661
cmp dword [ebp - 0x68], 0
je 0x401661
cmp esi, dword [ebp - 0x68]
jae 0x401661
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 0x401707
mov eax, dword [ebp - 0x24]
movzx edx, word [eax + 2]
push edx
push eax
push 0xffffffffffffffff
push 2
mov eax, dword [ebp - 0x1c]
push eax
call edi
test eax, eax
je 0x401707
add esi, 1
mov dword [ebp - 0x38], esi
jmp 0x401622
push 0
mov ecx, dword [ebp - 0x1c]
push ecx
push 1
lea edx, [ebp - 0x7c]
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x401707
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 0x4016e8
xor edi, edi
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x58], esi
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0x4c]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
je 0x401707
mov eax, dword [ebp - 0x4c]
test eax, 0x400
je 0x4016c9
mov esi, 0x500
jmp 0x4016d5
test eax, 0x1000
je 0x4016d7
mov esi, 0x1000
mov edi, esi
test si, si
je 0x4016e8
push edi
push esi
lea eax, [ebp - 0x7c]
push eax
call ebx
test eax, eax
je 0x401707
lea ecx, [ebp - 0x7c]
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 0x401707
mov dword [ebp - 0x50], 1
xor edi, edi
mov dword [ebp - 4], 0xfffffffe
call fcn.0040172c
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret