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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40b3d8
push 0x40a1c0
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 0x406873
cmp dword [ebp - 0xec], 2
je 0x4064c5
push 1
pop eax
jmp 0x406873
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 0x406867
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406867
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 0x406867
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 0x406867
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 0x406867
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 0x406867
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406867
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 0x406867
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 0x406867
push 1
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x406867
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 0x406867
mov dword [ebp - 0x58], edi
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x54], 8
cmp dword [ebp - 0x1c], edi
jne 0x406632
mov dword [ebp - 0x3c], edi
cmp dword [ebp - 0x3c], edi
je 0x406650
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 0x406867
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 0x406867
push 2
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x406867
mov dword [ebp - 0x104], edi
cmp dword [ebp - 0x3c], edi
je 0x406702
cmp dword [ebp - 0x58], edi
je 0x406702
mov dword [ebp - 0x24], edi
mov eax, dword [ebp - 0x58]
cmp dword [ebp - 0x24], eax
jae 0x406702
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 0x406867
mov eax, dword [ebp - 0x64]
test byte [eax + 1], 0x10
jne 0x406702
add eax, 8
push eax
push dword [ebp - 0x68]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x4066fd
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 0x406867
inc dword [ebp - 0x104]
inc dword [ebp - 0x24]
jmp 0x40669f
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 0x406735
push 3
push 2
push dword [ebp - 0x30]
call eax
jmp 0x406740
push 2
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x406867
cmp dword [ebp - 0x3c], edi
je 0x406793
cmp dword [ebp - 0x58], edi
je 0x406793
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x58]
jae 0x406793
lea ecx, [ebp - 0x64]
push ecx
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x406867
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 0x406867
inc dword [ebp - 0x24]
jmp 0x406752
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 0x406867
push str.SetSecurityDescriptorControl
push str.advapi32.dll
call ebx
push eax
call esi
mov dword [ebp - 0x4c], eax
cmp eax, edi
je 0x406848
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 0x406867
test byte [ebp - 0x123], 4
je 0x40680b
mov eax, 0x500
jmp 0x406819
mov eax, 0x1000
test word [ebp - 0x124], ax
je 0x406825
mov dword [ebp - 0x120], eax
mov dword [ebp - 0x12c], eax
cmp word [ebp - 0x120], di
je 0x406848
push dword [ebp - 0x12c]
push dword [ebp - 0x120]
lea eax, [ebp - 0x118]
push eax
call dword [ebp - 0x4c]
test eax, eax
je 0x406867
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 0x406867
mov dword [ebp - 0x34], 1
or dword [ebp - 4], 0xffffffff
call fcn.00406884
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret