Function at 0x4020d3
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
push esi
mov dword [ebp - 8], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], edi
call fcn.0049f486
pop ecx
test eax, eax
jne 0x4022d4
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x402102
mov dword [eax], edi
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x40210b
mov dword [ebx], edi
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x402114
mov dword [eax], edi
push 0x50aeb0
push esi
call fcn.004a0ea0
pop ecx
neg eax
pop ecx
sbb edi, edi
push 0x5096f0
and edi, 0xffffb1e0
push esi
add edi, 0x4e20
call fcn.0049e595
pop ecx
push eax
call fcn.004ee718
pop ecx
pop ecx
test eax, eax
jne 0x402155
push esi
call fcn.00403fe1
pop ecx
mov dword [ebp - 0xc], eax
jmp 0x402159
and dword [ebp - 0xc], 0
push 0
push edi
push 0
push SQLGetDiagRec
push 3
push 0
push 7
push connect
push esi
call fcn.004286d2
mov edi, eax
add esp, 0x24
cmp edi, 0xffffffff
jne 0x4021be
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4022d4
cmp eax, 3
je 0x4022d4
cmp eax, 0xf
je 0x4022d4
cmp eax, 0x35
je 0x4022d4
push eax
push str._GetLastError_
push esi
push str.:6:CalculateArchiveCheckSum___s___FAILED:_CreateFileTimeOut___FAILED:__s_ld
call fcn.00425c08
jmp 0x4022d1
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x14], eax
cmp eax, 0xffffffff
jne 0x4021e6
push str._GetLastError_
push esi
push str.:7:CalculateArchiveCheckSum___s___EAP:_GetFileSize___FAILED:__s
call fcn.00425c08
add esp, 0xc
and dword [ebp - 0x14], 0
push 0
push 0
push dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 4]
push eax
push 4
lea eax, [ebp - 8]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4022a3
cmp dword [ebp - 4], 4
jb 0x4022a3
push 0
lea eax, [ebp - 4]
push eax
push 4
lea eax, [ebp - 0x10]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40227e
cmp dword [ebp - 4], 4
jb 0x40227e
push 1
push dword [ebp - 8]
push edi
call fcn.004022db
add esp, 0xc
mov esi, eax
push 0x59b
push str.E:UserskerryDocumentsVisual_Studio_2022ProjectsPAULA__TEMP_COPY_Archive.c
push str.CalculateArchiveCheckSum
push edi
call fcn.00426fac
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x402264
mov dword [eax], esi
test ebx, ebx
je 0x40226d
mov eax, dword [ebp - 0x10]
mov dword [ebx], eax
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x402279
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
xor eax, eax
inc eax
jmp 0x4022d6
push 0x58c
push str.E:UserskerryDocumentsVisual_Studio_2022ProjectsPAULA__TEMP_COPY_Archive.c
push str.CalculateArchiveCheckSum
push edi
call fcn.00426fac
push str._GetLastError_
push dword [ebp - 4]
push esi
push str.:7:CalculateArchiveCheckSum___s___FAILED:_ReadFile___FAILED_to_read_the_Archive_CheckSum:_Only_read__ld_bytes:__s
jmp 0x4022cc
push 0x583
push str.E:UserskerryDocumentsVisual_Studio_2022ProjectsPAULA__TEMP_COPY_Archive.c
push str.CalculateArchiveCheckSum
push edi
call fcn.00426fac
cmp dword [ebp - 0x14], 0
jbe 0x4022d4
push str._GetLastError_
push dword [ebp - 4]
push esi
push str.:7:CalculateArchiveCheckSum___s___FAILED:_ReadFile___FAILED_to_read_the_archive_size:_Only_read__ld_bytes:__s
call fcn.004255b9
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret