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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x4780f8
push 0x421420
mov eax, dword fs:[0]
push eax
sub esp, 0x64
push ebx
push esi
push edi
mov eax, dword [0x47edd4]
xor dword [ebp - 8], eax
xor eax, ebp
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
xor esi, esi
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x4c], esi
mov dword [ebp - 4], esi
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x30]
push ecx
push esi
lea edx, [ebp - 0x34]
push edx
push esi
mov eax, dword [ebp + 0xc]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
cmp eax, esi
jne 0x40506b
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x7a
je 0x404c19
call ebx
push eax
push str.LookupAccountName___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov ecx, dword [ebp - 0x34]
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call edi
mov esi, eax
mov dword [ebp - 0x38], esi
test esi, esi
jne 0x404c4c
call ebx
push eax
push str.HeapAlloc___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov edx, dword [ebp - 0x30]
lea eax, [edx + edx]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [ebp - 0x44], eax
test eax, eax
je 0x404c37
lea ecx, [ebp - 0x50]
push ecx
lea edx, [ebp - 0x30]
push edx
push eax
lea eax, [ebp - 0x34]
push eax
push esi
mov ecx, dword [ebp + 0xc]
push ecx
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0x404c04
lea edx, [ebp - 0x20]
push edx
push 0
push 0
push 4
mov eax, dword [ebp + 8]
push eax
mov esi, dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
call esi
test eax, eax
jne 0x40506b
call ebx
cmp eax, 0x7a
je 0x404cbd
call ebx
push eax
push str.GetFileSecurity___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov ecx, dword [ebp - 0x20]
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov ebx, eax
mov dword [ebp - 0x3c], ebx
test ebx, ebx
jne 0x404cee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HeapAlloc___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
lea edx, [ebp - 0x20]
push edx
mov eax, dword [ebp - 0x20]
push eax
push ebx
push 4
mov ecx, dword [ebp + 8]
push ecx
call esi
xor esi, esi
cmp eax, esi
jne 0x404d1e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetFileSecurity___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
push 1
lea edx, [ebp - 0x74]
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x404d47
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeSecurityDescriptor___failed.Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
lea eax, [ebp - 0x54]
push eax
lea ecx, [ebp - 0x28]
push ecx
lea edx, [ebp - 0x24]
push edx
push ebx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x404d77
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorDacl___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x5c], 8
mov eax, dword [ebp - 0x28]
cmp eax, esi
jne 0x404ddf
mov dword [ebp - 0x24], esi
mov ebx, dword [ebp - 0x38]
push ebx
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov edx, dword [ebp - 0x5c]
lea esi, [eax + edx + 8]
push esi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov edi, eax
mov dword [ebp - 0x48], edi
test edi, edi
je 0x404cd5
push 2
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
jne 0x404e10
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeAcl___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
cmp dword [ebp - 0x24], esi
je 0x404d8e
push 2
push 0xc
lea ecx, [ebp - 0x60]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
jne 0x404d8e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAclInformation___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
xor esi, esi
mov dword [ebp - 0x40], esi
cmp dword [ebp - 0x24], esi
je 0x404eb4
cmp dword [ebp - 0x60], esi
je 0x404eb4
mov dword [ebp - 0x2c], esi
cmp esi, dword [ebp - 0x60]
jae 0x404eb7
lea eax, [ebp - 0x1c]
push eax
push esi
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
jne 0x404e5f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAce___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov eax, dword [ebp - 0x1c]
test byte [eax + 1], 0x10
jne 0x404eb7
add eax, 8
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x404eac
mov eax, dword [ebp - 0x1c]
movzx edx, word [eax + 2]
push edx
push eax
push 0xffffffffffffffff
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
jne 0x404ea8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAce___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
add dword [ebp - 0x40], 1
add esi, 1
jmp 0x404e27
mov esi, dword [ebp - 0x2c]
push str.AddAccessAllowedAceEx
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebx
test eax, eax
je 0x404efb
mov ecx, dword [ebp + 0x10]
push ecx
push 3
push 2
push edi
call eax
test eax, eax
jne 0x404f25
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAceEx___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov edx, dword [ebp + 0x10]
push edx
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x404f25
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAce___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
cmp dword [ebp - 0x24], 0
je 0x404f71
cmp dword [ebp - 0x60], 0
je 0x404f71
cmp esi, dword [ebp - 0x60]
jae 0x404f71
lea eax, [ebp - 0x1c]
push eax
push esi
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x404e46
mov eax, dword [ebp - 0x1c]
movzx edx, word [eax + 2]
push edx
push eax
push 0xffffffffffffffff
push 2
push edi
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x404e8f
add esi, 1
mov dword [ebp - 0x2c], esi
jmp 0x404f31
push 0
push edi
push 1
lea eax, [ebp - 0x74]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x404f9d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorDacl___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
push str.SetSecurityDescriptorControl
push str.advapi32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
xor esi, esi
cmp ebx, esi
je 0x405036
xor edi, edi
mov dword [ebp + 0xc], esi
mov dword [ebp + 0x10], esi
lea ecx, [ebp + 0x10]
push ecx
lea edx, [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x3c]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
jne 0x404ff0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorControl___failed.Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov eax, dword [ebp + 0xc]
test eax, 0x400
je 0x405001
mov esi, 0x500
jmp 0x40500d
test eax, 0x1000
je 0x40500f
mov esi, 0x1000
mov edi, esi
test si, si
je 0x405036
push edi
push esi
lea ecx, [ebp - 0x74]
push ecx
call ebx
test eax, eax
jne 0x405036
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorControl___failed.Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
lea edx, [ebp - 0x74]
push edx
mov eax, 4
push eax
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityW]
test eax, eax
jne 0x405064
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetFileSecurity___failed._Error__d_n
call fcn.0042136a
add esp, 8
jmp 0x40506b
mov dword [ebp - 0x4c], 1
mov dword [ebp - 4], 0xfffffffe
call fcn.0040508e
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc