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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40b3e0
push 0x40a1e0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x11c
push ebx
push esi
push edi
mov esi, 0x94
push esi
xor edi, edi
push edi
lea eax, [ebp - 0xfc]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov dword [ebp - 0xfc], esi
lea eax, [ebp - 0xfc]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x406948
cmp dword [ebp - 0xec], 2
je 0x40659a
push 1
pop eax
jmp 0x406948
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x64], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 4], edi
lea eax, [ebp - 0x11c]
push eax
lea eax, [ebp - 0x38]
push eax
push edi
lea eax, [ebp - 0x2c]
push eax
push edi
push dword [ebp + 0xc]
push edi
mov ebx, dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
call ebx
mov dword [ebp - 0x100], eax
cmp eax, edi
jne 0x40693c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40693c
push dword [ebp - 0x2c]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
mov esi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call esi
mov dword [ebp - 0x68], eax
cmp eax, edi
je 0x40693c
push dword [ebp - 0x38]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
mov dword [ebp - 0x60], eax
cmp eax, edi
je 0x40693c
lea eax, [ebp - 0x11c]
push eax
lea eax, [ebp - 0x38]
push eax
push dword [ebp - 0x60]
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x68]
push dword [ebp + 0xc]
push edi
call ebx
mov dword [ebp - 0x100], eax
cmp eax, edi
je 0x40693c
lea eax, [ebp - 0x5c]
push eax
push edi
push edi
push 4
push dword [ebp + 8]
mov ebx, dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
call ebx
mov dword [ebp - 0x100], eax
cmp eax, edi
jne 0x40693c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40693c
push dword [ebp - 0x5c]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
mov dword [ebp - 0x28], eax
cmp eax, edi
je 0x40693c
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 0x5c]
push dword [ebp - 0x28]
push 4
push dword [ebp + 8]
call ebx
mov dword [ebp - 0x100], eax
cmp eax, edi
je 0x40693c
push 1
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x40693c
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x40693c
mov dword [ebp - 0x58], edi
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x54], 8
cmp dword [ebp - 0x1c], edi
jne 0x406707
mov dword [ebp - 0x3c], edi
cmp dword [ebp - 0x3c], edi
je 0x406725
push 2
push 0xc
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
je 0x40693c
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 0x54]
lea ebx, [eax + ecx + 8]
mov dword [ebp - 0x20], ebx
push ebx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
mov dword [ebp - 0x30], eax
cmp eax, edi
je 0x40693c
push 2
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x40693c
mov dword [ebp - 0x104], edi
cmp dword [ebp - 0x3c], edi
je 0x4067d7
cmp dword [ebp - 0x58], edi
je 0x4067d7
mov dword [ebp - 0x24], edi
mov eax, dword [ebp - 0x58]
cmp dword [ebp - 0x24], eax
jae 0x4067d7
lea eax, [ebp - 0x64]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40693c
mov eax, dword [ebp - 0x64]
test byte [eax + 1], 0x10
jne 0x4067d7
add eax, 8
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x4067d2
mov eax, dword [ebp - 0x64]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x40693c
inc dword [ebp - 0x104]
inc dword [ebp - 0x24]
jmp 0x406774
push str.AddAccessAllowedAceEx
push str.advapi32.dll
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call ebx
push eax
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call esi
mov dword [ebp - 0x40], eax
cmp eax, edi
push dword [ebp - 0x68]
push dword [ebp + 0x10]
je 0x40680a
push 3
push 2
push dword [ebp - 0x30]
call eax
jmp 0x406815
push 2
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x40693c
cmp dword [ebp - 0x3c], edi
je 0x406868
cmp dword [ebp - 0x58], edi
je 0x406868
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x58]
jae 0x406868
lea ecx, [ebp - 0x64]
push ecx
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40693c
mov eax, dword [ebp - 0x64]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x40693c
inc dword [ebp - 0x24]
jmp 0x406827
push edi
push dword [ebp - 0x30]
push 1
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x40693c
push str.SetSecurityDescriptorControl
push str.advapi32.dll
call ebx
push eax
call esi
mov dword [ebp - 0x4c], eax
cmp eax, edi
je 0x40691d
mov dword [ebp - 0x120], edi
mov dword [ebp - 0x12c], edi
mov dword [ebp - 0x124], edi
mov dword [ebp - 0x128], edi
lea eax, [ebp - 0x128]
push eax
lea eax, [ebp - 0x124]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
je 0x40693c
test byte [ebp - 0x123], 4
je 0x4068e0
mov eax, 0x500
jmp 0x4068ee
mov eax, 0x1000
test word [ebp - 0x124], ax
je 0x4068fa
mov dword [ebp - 0x120], eax
mov dword [ebp - 0x12c], eax
cmp word [ebp - 0x120], di
je 0x40691d
push dword [ebp - 0x12c]
push dword [ebp - 0x120]
lea eax, [ebp - 0x118]
push eax
call dword [ebp - 0x4c]
test eax, eax
je 0x40693c
lea eax, [ebp - 0x118]
push eax
push 4
pop eax
push eax
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
test eax, eax
je 0x40693c
mov dword [ebp - 0x34], 1
or dword [ebp - 4], 0xffffffff
call fcn.00406959
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret