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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push edi
push esi
push ebx
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], 0
mov byte [ebp - 0xd], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0xffffffff
add esp, 0xfffffff4
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040ab0c
add esp, 0x10
test eax, eax
jne 0x40e380
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
call sub.KERNEL32.dll_GetFileAttributesA
add esp, 0xc
cmp eax, 0xffffffff
je 0x40e62a
add esp, 0xfffffff8
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040e810
jmp 0x40e62d
mov edi, dword [ebp + 0xc]
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
mov edx, dword [ebp + 0xc]
lea ecx, [edx + ecx - 2]
mov dword [ebp - 0x24], ecx
lea esi, [esi]
mov eax, dword [ebp - 0x24]
dec dword [ebp - 0x24]
cmp eax, dword [ebp + 0xc]
jbe 0x40e3af
mov ecx, dword [ebp - 0x24]
cmp byte [ecx], 0x2f
jne 0x40e39c
mov ebx, dword [ebp - 0x24]
inc ebx
mov eax, dword [ebp - 0x24]
mov al, byte [eax + 1]
mov byte [ebp - 0xe], al
mov edx, dword [ebp - 0x24]
mov byte [edx + 1], 0
cmp dword [ebp - 0xc], 0
je 0x40e3d1
mov cl, byte [ebp - 0xd]
mov esi, dword [ebp - 0xc]
mov byte [esi], cl
mov dword [ebp - 0xc], ebx
mov al, byte [ebp - 0xe]
mov byte [ebp - 0xd], al
add esp, 0xfffffff4
mov edx, dword [ebp + 8]
push edx
call fcn.0040e104
mov dword [ebp - 4], eax
add esp, 0x10
test eax, eax
jne 0x40e3f5
cmp ebx, dword [ebp + 0xc]
ja 0x40e380
mov dword [ebp + 0xc], ebx
add esp, 0xfffffff8
push 0x2f
mov eax, dword [ebp - 0x24]
add eax, 2
push eax
call fcn.0040afb0
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x40e43c
mov byte [ebx], 0
inc ebx
mov edi, dword [ebp + 8]
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, ecx
not edx
mov edi, ebx
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea ecx, [edx + ecx + 0xff]
jmp 0x40e451
mov edi, dword [ebp + 8]
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xff
mov dword [ebp - 0x14], ecx
cmp dword [ebp - 4], 0
je 0x40e470
add esp, 0xfffffff4
mov edx, dword [ebp - 0x14]
push edx
call sub.msvcrt.dll_malloc
mov dword [ebp - 8], eax
add esp, 0x10
test eax, eax
jne 0x40e49c
cmp dword [ebp - 0xc], 0
je 0x40e47e
mov cl, byte [ebp - 0xe]
mov esi, dword [ebp - 0xc]
mov byte [esi], cl
mov dword [ebp - 0x1c], 0xffffffff
cmp dword [ebp - 4], 0
je 0x40e5fd
mov dword [ebp - 0x1c], 4
jmp 0x40e5e8
add esp, 0xfffffff8
mov eax, dword [ebp + 8]
push eax
mov edx, dword [ebp - 8]
push edx
call sub.msvcrt.dll_strcpy
mov edi, dword [ebp - 8]
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [ebp - 0x14], ecx
add esp, 0x10
cmp dword [ebp - 0xc], 0
je 0x40e4d0
mov dl, byte [ebp - 0xe]
mov ecx, dword [ebp - 0xc]
mov byte [ecx], dl
add esp, 0xfffffff4
mov esi, dword [ebp + 0xc]
push esi
call fcn.0040ab0c
add esp, 0x10
test eax, eax
jne 0x40e5ce
mov dword [ebp - 0x1c], 0xffffffff
jmp 0x40e5e8
mov eax, dword [ebp - 0x24]
mov edi, 0x40e313
mov ecx, 2
mov esi, eax
cld
test al, 0
repe cmpsb byte [esi], byte es:[edi]
je 0x40e5ce
mov edi, 0x40e315
mov ecx, 3
mov esi, eax
cld
test al, 0
repe cmpsb byte [esi], byte es:[edi]
je 0x40e5ce
add esp, 0xfffffffc
push 0
push eax
mov edx, dword [ebp + 0xc]
push edx
call fcn.0040ade0
add esp, 0x10
test eax, eax
je 0x40e5ce
add esp, 0xfffffff8
mov ecx, dword [ebp - 0x24]
push ecx
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x14]
push eax
call sub.msvcrt.dll_strcpy
add esp, 0x10
test ebx, ebx
je 0x40e598
mov edi, dword [ebp - 8]
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
mov edx, dword [ebp - 8]
lea ecx, [edx + ecx - 1]
mov byte [ecx], 0x2f
inc ecx
mov dword [ebp - 0x24], ecx
add esp, 0xfffffff8
push ebx
push ecx
call sub.msvcrt.dll_strcpy
add esp, 0xfffffff8
mov ecx, dword [ebp - 0x24]
push ecx
mov esi, dword [ebp - 8]
push esi
call fcn.0040e318
mov dword [ebp - 0x1c], eax
add esp, 0x20
jmp 0x40e5ac
add esp, 0xfffffff8
push 0
mov eax, dword [ebp - 8]
push eax
call fcn.0040e810
mov dword [ebp - 0x1c], eax
add esp, 0x10
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x14]
mov byte [ecx + edx], 0
cmp dword [ebp - 0x1c], 0
jne 0x40e5c8
mov dword [ebp - 0x18], 1
jmp 0x40e5ce
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x40e5e8
add esp, 0xfffffff4
mov esi, dword [ebp - 4]
push esi
call fcn.0040e2d8
mov dword [ebp - 0x24], eax
add esp, 0x10
test eax, eax
jne 0x40e4f4
cmp dword [ebp - 4], 0
je 0x40e5fd
add esp, 0xfffffff4
mov eax, dword [ebp - 4]
push eax
call fcn.0040e2b4
add esp, 0x10
test ebx, ebx
je 0x40e605
mov byte [ebx - 1], 0x2f
cmp dword [ebp - 8], 0
je 0x40e617
add esp, 0xfffffff4
mov edx, dword [ebp - 8]
push edx
call sub.msvcrt.dll_free
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x40e62a
cmp dword [ebp - 0x18], 0
je 0x40e62a
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0x1c]
lea esp, [ebp - 0x48]
pop ebx
pop esi
pop edi
leave
ret