Function at 0x403317
Capabilities:
Check if file exists
Copy file
Delete file
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov dword [ebp - 0x28], 1
or dword [ebp - 0x24], 0xffffffff
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x2c], eax
cmp dword [ebp + 8], 0
je 0x40333c
cmp dword [ebp + 8], 2
jne 0x4033a5
push 0x40b598
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x403398
push 0
push 0x80
push 2
push 0
push 3
push 0xc0000000
push 0x40b598
call dword [ebp - 0x2c]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0xffffffff
jne 0x403376
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x20
push 0
push 0x40d2ec
call sub.MSVCRT.dll_memset
add esp, 0xc
xor eax, eax
inc eax
jmp 0x403543
cmp dword [ebp + 8], 2
jne 0x4033a5
xor eax, eax
jmp 0x403543
push 0x104
push 0
push 0x40d0e0
call sub.MSVCRT.dll_memset
add esp, 0xc
call fcn.0040184b
push eax
push 0x40d418
push str._s_d.nls
push 0x40d0e0
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0
push 0x40d0e0
push 0x40b598
call dword [sym.imp.KERNEL32.dll_CopyFileA]
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
push 0x40d0e0
call dword [ebp - 0x2c]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0xffffffff
je 0x4034d8
and dword [ebp - 0x38], 0
and dword [ebp - 0x34], 0
and dword [ebp - 0x3c], 0
and dword [ebp - 0x30], 0
push 0
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x34], eax
push 0
push 0
push 0
push 4
push 0
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x30], eax
push 0
push 0
push 0
push 0xf001f
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x4034c0
push 0
mov eax, dword [ebp - 0x38]
push dword [eax + 4]
mov eax, dword [ebp - 0x34]
sub eax, 8
push eax
mov eax, dword [ebp - 0x38]
add eax, 8
push eax
call fcn.00401000
mov eax, dword [ebp - 0x34]
sub eax, 8
push eax
mov eax, dword [ebp - 0x38]
add eax, 8
push eax
call fcn.00402eca
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x3c]
cmp ecx, dword [eax]
je 0x4034a0
and dword [ebp - 0x28], 0
push 0x20
mov eax, dword [ebp - 0x38]
add eax, 8
push eax
lea eax, [ebp - 0x20]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x4034c4
and dword [ebp - 0x28], 0
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4034dc
and dword [ebp - 0x28], 0
cmp dword [ebp - 0x28], 0
jne 0x403516
push 0x40d0e0
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0x40b598
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0x40d1e8
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp + 8], 0
jne 0x403512
push 2
call fcn.00403317
jmp 0x403543
xor eax, eax
jmp 0x403543
cmp dword [ebp + 8], 3
jne 0x403527
push 0x40d0e0
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [ebp + 8], 0
jne 0x403540
push 0x20
lea eax, [ebp - 0x20]
push eax
push 0x40d2ec
call sub.MSVCRT.dll_memcpy
add esp, 0xc
xor eax, eax
inc eax
leave
ret 4