Function at 0x1004cb90
Capabilities:
Check if file exists
Get file attributes
Get file size
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x20]
mov dword [eax], 0
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
je 0x1004cbd4
mov edx, dword [ebp - 4]
and edx, 1
je 0x1004cbd4
mov eax, dword [ebp - 4]
and eax, 0x26
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 0
push 0
push 3
push 0
push 1
push 0xc0000000
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp - 0x20]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x20]
cmp dword [edx + 4], 0xffffffff
jne 0x1004ccd8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0x20
je 0x1004cc47
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.BavAs:_CreateFile__s__Failed__08X___phase_1.
push 4
push 0x52
push 0x1008ac74
call dword [sym.imp.log.dll_WriteLog]
add esp, 0x18
mov eax, dword [ebp - 0x14]
sub eax, 5
neg eax
sbb eax, eax
and eax, 0x1ff8fffd
add eax, 0x80070005
jmp 0x1004cdbc
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 0x20]
call fcn.1004cf20
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jge 0x1004cc64
mov eax, dword [ebp - 0x18]
jmp 0x1004cdbc
push 0
push 0
push 3
push 0
push 1
push 0xc0000000
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp - 0x20]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x20]
cmp dword [edx + 4], 0xffffffff
jne 0x1004ccd8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.BavAs:_CreateFile__s__Failed__08X___phase_2.
push 4
push 0x5b
push 0x1008acec
call dword [sym.imp.log.dll_WriteLog]
add esp, 0x18
cmp dword [ebp - 0x1c], 0x20
je 0x1004ccc9
cmp dword [ebp - 0x1c], 5
je 0x1004ccc9
mov dword [ebp - 0x24], 0xa0000002
jmp 0x1004ccd0
mov dword [ebp - 0x24], 0x80070005
mov eax, dword [ebp - 0x24]
jmp 0x1004cdbc
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x1004ccf3
cmp dword [ebp - 0xc], 0
jle 0x1004cd14
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x20]
mov dword [ecx + 4], 0xffffffff
mov eax, 0xa0000006
jmp 0x1004cdbc
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x10]
mov dword [edx + 0x10], eax
push 0
push 0
push 0
push 4
push 0
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov ecx, dword [ebp - 0x20]
mov dword [ecx + 8], eax
mov edx, dword [ebp - 0x20]
cmp dword [edx + 8], 0
jne 0x1004cd61
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x20]
mov dword [edx + 4], 0xffffffff
mov eax, 0xa0000006
jmp 0x1004cdbc
push 0
push 0
push 0
push 2
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edx, dword [ebp - 0x20]
mov dword [edx + 0xc], eax
mov eax, dword [ebp - 0x20]
cmp dword [eax + 0xc], 0
jne 0x1004cdba
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx + 8]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x20]
mov dword [eax + 8], 0
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x20]
mov dword [eax + 4], 0xffffffff
mov eax, 0xa0000006
jmp 0x1004cdbc
xor eax, eax
mov esp, ebp
pop ebp
ret 4