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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x45dbb8
push 0x4383b0
mov eax, dword fs:[0]
push eax
sub esp, 0x78
mov eax, dword [0x4611f4]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov ebx, edx
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
xor edi, edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 4], edi
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x50]
push eax
push edi
lea eax, [ebp - 0x54]
push eax
push edi
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
jne 0x40d84d
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x7a
jne 0x40d84b
push dword [ebp - 0x54]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x30], eax
test eax, eax
je 0x40d84b
mov eax, dword [ebp - 0x50]
add eax, eax
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x5c], eax
test eax, eax
je 0x40d84b
lea ecx, [ebp - 0x6c]
push ecx
lea ecx, [ebp - 0x50]
push ecx
push eax
lea eax, [ebp - 0x54]
push eax
push dword [ebp - 0x30]
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0x40d84b
lea eax, [ebp - 0x3c]
push eax
push edi
push edi
push 4
push dword [ebp - 0x4c]
mov ebx, dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
call ebx
test eax, eax
jne 0x40d84d
call esi
cmp eax, 0x7a
jne 0x40d84b
push dword [ebp - 0x3c]
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x40], eax
test eax, eax
je 0x40d84b
lea ecx, [ebp - 0x3c]
push ecx
push dword [ebp - 0x3c]
push eax
push 4
push dword [ebp - 0x4c]
call ebx
test eax, eax
je 0x40d84b
push 1
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x40d84b
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x48]
push eax
push dword [ebp - 0x40]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x40d84b
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], 8
mov eax, dword [ebp - 0x44]
test eax, eax
jne 0x40d752
mov dword [ebp - 0x48], eax
jmp 0x40d76f
cmp dword [ebp - 0x48], 0
je 0x40d76f
push 2
push 0xc
lea ecx, [ebp - 0x28]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
je 0x40d84b
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ebx, dword [ebp - 0x24]
add ebx, 8
add ebx, eax
push ebx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x38], eax
test eax, eax
je 0x40d84b
push 2
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x40d84b
xor ebx, ebx
mov dword [ebp - 0x64], ebx
cmp dword [ebp - 0x48], ebx
je 0x40d81a
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40d81a
xor edi, edi
mov dword [ebp - 0x60], edi
cmp edi, eax
jae 0x40d81a
lea eax, [ebp - 0x34]
push eax
push edi
push dword [ebp - 0x44]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40d84b
mov eax, dword [ebp - 0x34]
test byte [eax + 1], 0x10
jne 0x40d81a
add eax, 8
push eax
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x40d811
mov ecx, dword [ebp - 0x34]
movzx eax, word [ecx + 2]
push eax
push ecx
push 0xffffffffffffffff
push 2
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x40d84b
inc ebx
mov dword [ebp - 0x64], ebx
inc edi
mov dword [ebp - 0x60], edi
mov eax, dword [ebp - 0x28]
jmp 0x40d7c3
push 0x4554a8
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push dword [ebp - 0x30]
mov ebx, dword [ebp - 0x38]
push 0x10000000
test eax, eax
je 0x40d87a
push 3
push 2
push ebx
call eax
test eax, eax
jne 0x40d885
call esi
mov edi, dword [ebp - 0x2c]
mov dword [ebp - 4], 0xfffffffe
call fcn.0040d986
mov eax, edi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00431c68
mov esp, ebp
pop ebp
ret
push 2
push ebx
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
jmp 0x40d847
cmp dword [ebp - 0x48], 0
je 0x40d8c9
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40d8c9
cmp edi, eax
jae 0x40d8c9
lea eax, [ebp - 0x34]
push eax
push edi
push dword [ebp - 0x44]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40d84b
mov ecx, dword [ebp - 0x34]
movzx eax, word [ecx + 2]
push eax
push ecx
push 0xffffffffffffffff
push 2
push ebx
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x40d84b
inc edi
mov dword [ebp - 0x60], edi
mov eax, dword [ebp - 0x28]
jmp 0x40d892
push 0
push ebx
push 1
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x40d84b
push 0x4554d0
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x68], eax
test eax, eax
je 0x40d95c
xor edi, edi
xor ebx, ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x70], ebx
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0x40]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
je 0x40d84b
mov eax, dword [ebp - 0x58]
test eax, 0x400
je 0x40d935
mov edi, 0x500
jmp 0x40d941
test eax, 0x1000
je 0x40d943
mov edi, 0x1000
mov ebx, edi
test di, di
je 0x40d95c
push ebx
push edi
lea eax, [ebp - 0x88]
push eax
call dword [ebp - 0x68]
test eax, eax
je 0x40d84b
lea eax, [ebp - 0x88]
push eax
push 4
push dword [ebp - 0x4c]
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityW]
test eax, eax
je 0x40d84b
mov edi, 1
mov dword [ebp - 0x2c], edi
jmp 0x40d850