Function at 0x40d970
Capabilities:
Check if file exists
Get file attributes
Read file on windows

Disassembly:
sub esp, 0xc44
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 4]
test eax, eax
jne 0x40d992
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0xc44
ret 8
mov al, byte [esp + 0xc5c]
mov esi, dword [esp + 0xc58]
test al, al
jne 0x40d9c5
push 0x490c9c
push esi
call fcn.0045a950
add esp, 8
cmp eax, esi
jne 0x40d9c5
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0xc44
ret 8
push 0x3a
push esi
call fcn.0045b450
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
add esp, 8
test eax, eax
lea eax, [esp + 0x150]
push esi
push eax
setne byte [esp + 0x1b]
call ebx
lea ecx, [esp + 0x150]
push ecx
mov ecx, ebp
call fcn.0040dff0
mov dl, byte [0x4971a0]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x4d]
mov byte [esp + 0x4c], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov al, byte [esp + 0xc5c]
test al, al
je 0x40da59
lea eax, [esp + 0x254]
lea ecx, [esp + 0x354]
push eax
push ecx
push 0
push 0
push esi
call fcn.0045b295
lea edx, [esp + 0x268]
lea eax, [esp + 0x368]
push edx
push eax
push 0
lea ecx, [esp + 0x6c]
push 0
push ecx
call fcn.0045b204
add esp, 0x28
jmp 0x40daba
mov al, byte [esp + 0x13]
test al, al
je 0x40da95
lea edi, [ebp + 8]
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push edi
push esi
call fcn.0045aaf0
add esp, 0xc
test eax, eax
je 0x40da89
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0xc44
ret 8
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, esi
push eax
jmp 0x40dab3
push 0x490c98
push esi
call fcn.0045a950
add esp, 8
cmp eax, esi
jne 0x40dab2
lea eax, [esi + 2]
lea ecx, [esp + 0x4c]
push eax
push ecx
jmp 0x40dab8
push esi
lea edx, [esp + 0x50]
push edx
call ebx
xor ebx, ebx
push esi
mov dword [esp + 0x48], ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [esp + 0x48], eax
lea eax, [esp + 0x18]
push 1
lea ecx, [esp + 0x154]
push eax
push ecx
call fcn.0040d810
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x26]
mov ecx, dword [esp + 0x2a]
and edx, 0xffff
add esp, 0xc
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x20]
and eax, 0xffff
dec eax
and ecx, 0xffff
push ebx
and edx, 0xffff
push 1
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x2a]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x2c]
push 3
mov dword [esp + 0x3c], edx
push ebx
push ebx
lea edx, [esp + 0x164]
and eax, 0xffff
and ecx, 0xffff
push Ordinal_2
push edx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x48], eax
mov dword [esp + 0x44], ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40db69
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0xc44
ret 8
mov edx, dword [ebp + 4]
push 0xffffffffffffffff
push 8
push ebx
push ebx
push ebx
push ebx
lea eax, [esp + 0x40]
push ebx
lea ecx, [esp + 0x68]
push eax
push ecx
push edx
call fcn.0044e6c0
mov esi, eax
cmp esi, ebx
jne 0x40dbe3
mov eax, dword [ebp + 0x110]
mov dword [esp + 0x14], ebx
inc eax
mov dword [ebp + 0x110], eax
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [esp + 0x45c]
push 0x800
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40dbdd
mov eax, dword [esp + 0x14]
add ebx, eax
test eax, eax
je 0x40dbdd
push eax
mov eax, dword [ebp + 4]
lea edx, [esp + 0x458]
push edx
push eax
call fcn.0044dce0
mov esi, eax
test esi, esi
je 0x40db9c
add dword [ebp + 0x118], ebx
mov ecx, dword [ebp + 4]
push ecx
call fcn.0044e020
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
test esi, esi
pop esi
pop ebp
sete al
pop ebx
add esp, 0xc44
ret 8