Function at 0x40f770
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40f7aa
call fcn.004044f0
mov ecx, dword [eax]
mov edx, dword [ecx + 0x38]
push esi
push str.Not_checking_perms_on_non_existant_file__s
push eax
call edx
add esp, 0xc
mov al, 1
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 4]
push eax
push 0xa
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x40f9ab
mov eax, dword [ebp - 4]
test eax, eax
je 0x40f9ab
lea ecx, [ebp - 0xc]
push ecx
push 2
push eax
call dword [sym.imp.ADVAPI32.dll_DuplicateToken]
test eax, eax
jne 0x40f817
call fcn.004044f0
mov edi, eax
mov esi, dword [edi]
add esi, 0x38
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esi]
push eax
push str.Could_not_dup_token__GLE:__d_
push edi
call edx
mov eax, dword [ebp - 4]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 8]
push ecx
push 0
push 0
push 7
push esi
mov dword [ebp - 8], 0
call dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
test eax, eax
jne 0x40f87d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x40f87d
call fcn.004044f0
mov ebx, eax
mov edi, dword [ebx]
add edi, 0x38
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [edi]
push eax
push esi
push str.log_file__s_could_not_get_secdesc_size__GLE:__d_
push ebx
call edx
mov eax, dword [ebp - 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x10
push eax
call esi
mov ecx, dword [ebp - 4]
push ecx
call esi
mov al, 1
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 8]
mov eax, ebx
call fcn.0041b450
mov edi, esp
push ebx
xor ebx, ebx
push ebx
push edi
call sub.MSVCR80.dll_memset
mov eax, dword [ebp - 8]
add esp, 0xc
lea edx, [ebp - 8]
push edx
push eax
push edi
push 7
push esi
call dword [sym.imp.ADVAPI32.dll_GetFileSecurityW]
test eax, eax
jne 0x40f8eb
call fcn.004044f0
mov ebx, eax
mov edi, dword [ebx]
add edi, 0x38
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [edi]
push eax
push esi
push str.log_file__s_could_not_get_secdesc__GLE:__d_
push ebx
call ecx
mov edx, dword [ebp - 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x10
push edx
call esi
mov eax, dword [ebp - 4]
push eax
call esi
xor al, al
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x24], eax
mov eax, 0x40000000
push ecx
lea edx, [ebp - 0x14]
push edx
mov dword [ebp - 0x14], 2
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x20], eax
call dword [sym.imp.ADVAPI32.dll_MapGenericMask]
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x18]
push ecx
lea edx, [ebp - 0x1c]
push edx
mov edx, dword [ebp - 0x14]
lea eax, [ebp - 0x40]
push eax
mov eax, dword [ebp - 0xc]
lea ecx, [ebp - 0x2c]
push ecx
push edx
push eax
push edi
mov dword [ebp - 0x1c], 0x14
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.ADVAPI32.dll_AccessCheck]
test eax, eax
jne 0x40f96e
call fcn.004044f0
mov ebx, eax
mov edi, dword [ebx]
add edi, 0x38
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [edi]
push eax
push esi
push str.Access_check_failed_for_log_file__s__GLE:__d_
push ebx
call ecx
add esp, 0x10
mov edx, dword [ebp - 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [ebp - 4]
push eax
call edi
call fcn.004044f0
mov edx, dword [ebp - 0x10]
mov ecx, dword [eax]
push esi
push edx
push str.Checked_file_access___d__to__s
push eax
mov eax, dword [ecx + 0x38]
call eax
add esp, 0x10
cmp dword [ebp - 0x10], 0
setne al
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.004044f0
mov edi, eax
mov esi, dword [edi]
add esi, 0x38
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esi]
push eax
push str.Could_not_open_process_token__GLE:__d_
push edi
call ecx
add esp, 0xc
mov al, 1
lea esp, [ebp - 0x4c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret