Function at 0x40f7e0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x23c
mov eax, dword [0x4b0070]
xor eax, esp
mov dword [esp + 0x238], eax
push ebx
push esi
push edi
mov edi, ecx
xor esi, esi
mov dword [esp + 0x20], esi
test edi, edi
je 0x40fa5d
cmp word [edi], si
je 0x40fa5d
push 0x20a
lea eax, [esp + 0x34]
push esi
push eax
call fcn.00469580
lea ecx, [esp + 0x3c]
add esp, 0xc
mov eax, ecx
mov edx, 0x105
sub edi, eax
lea eax, [edx + 0x7ffffef9]
test eax, eax
je 0x40f85f
movzx eax, word [edi + ecx]
mov ebx, eax
test ax, ax
je 0x40f858
mov word [ecx], bx
add ecx, 2
sub edx, 1
jne 0x40f836
jmp 0x40f85c
test edx, edx
jne 0x40f85f
sub ecx, 2
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
xor eax, eax
mov ebx, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov word [ecx], ax
lea eax, [esp + 0x30]
push eax
call edi
test eax, eax
jne 0x40f886
lea eax, [esp + 0x30]
push eax
call ebx
test eax, eax
jne 0x40f870
mov edi, dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
lea eax, [esp + 0xc]
push eax
push 0
push 0
push 4
lea eax, [esp + 0x40]
mov dword [esp + 0x1c], esi
push eax
mov ebx, 1
call edi
test eax, eax
jne 0x40f8cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x40f8cf
xor ebx, ebx
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x238]
xor ecx, esp
call fcn.0046780a
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0xc]
xor ecx, ecx
mov edx, 0x14
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00467dc4
add esp, 4
mov dword [esp + 0x1c], eax
lea ecx, [esp + 0xc]
push ecx
push dword [esp + 0x10]
push eax
push 4
lea eax, [esp + 0x40]
push eax
call edi
test eax, eax
je 0x40f930
lea eax, [esp + 0x20]
mov dword [esp + 0x10], esi
push eax
lea eax, [esp + 0x14]
mov dword [esp + 0x18], esi
push eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x28], esi
push eax
push dword [esp + 0x28]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x40f955
push dword [esp + 0x1c]
xor ebx, ebx
call fcn.00467dcd
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x238]
xor ecx, esp
call fcn.0046780a
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40fa3a
push 2
push 0xc
lea ecx, [esp + 0x2c]
mov dword [esp + 0x2c], esi
push ecx
push eax
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], 8
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
je 0x40f930
cmp dword [esp + 0x14], esi
je 0x40fa3a
mov eax, dword [esp + 0x24]
test eax, eax
je 0x40fa3a
xor edi, edi
test eax, eax
je 0x40fa3a
nop word [eax + eax]
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0
push eax
push edi
push dword [esp + 0x18]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40fa2a
mov eax, dword [esp + 0x18]
cmp byte [eax], 1
jne 0x40fa2a
mov eax, dword [eax + 4]
or esi, 1
test al, 2
je 0x40f9fb
or esi, 2
test al, 4
je 0x40f9fb
or esi, 4
test al, 0x10
je 0x40f9fb
or esi, 8
test eax, 0x100
je 0x40f9fb
mov bl, 1
jmp 0x40f9fd
xor bl, bl
mov ecx, esi
mov eax, esi
and ecx, 0xfffffff7
test al, 8
cmove ecx, esi
mov edx, ecx
and edx, 0xfffffffb
test cl, 4
cmove edx, ecx
mov esi, edx
and esi, 0xfffffffd
test dl, 2
cmove esi, edx
and esi, 0xfffffffe
test bl, bl
jne 0x40f930
inc edi
cmp edi, dword [esp + 0x24]
jb 0x40f9b0
mov ebx, 1
push dword [esp + 0x1c]
call fcn.00467dcd
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x238]
xor ecx, esp
call fcn.0046780a
mov esp, ebp
pop ebp
ret
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [esp + 0x244]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0046780a
mov esp, ebp
pop ebp
ret