Function at 0x403170
Capabilities:
Copy file
Delete file
Get file size
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x800c
call fcn.00409be0
push ebx
push ebp
push esi
push edi
call fcn.004061c0
test eax, eax
je 0x4031b0
mov eax, dword [esp + 0x8028]
mov ecx, dword [esp + 0x8024]
mov edx, dword [esp + 0x8020]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x800c
ret
mov eax, dword [esp + 0x8020]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 0
push 3
push 0
push 3
push 0x80000000
push eax
call ebx
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x4031eb
push 2
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x800c
ret
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
jne 0x403221
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x403221
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 5
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x800c
ret
mov edi, esi
xor esi, esi
test esi, esi
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], esi
jg 0x40326b
jl 0x40323b
cmp edi, 0xa00000
jae 0x40326b
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x8028]
mov edx, dword [esp + 0x8024]
mov eax, dword [esp + 0x8020]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x800c
ret
call fcn.00407b60
mov eax, edi
mov edx, esi
mov ecx, 0xf
call fcn.00409c10
push eax
call fcn.00407dd0
push 0
call fcn.00407e20
mov ecx, dword [esp + 0x8030]
mov edx, dword [esp + 0x802c]
add esp, 8
neg ecx
push 0
sbb ecx, ecx
push 0
and ecx, 0xfffffffd
add ecx, 4
push ecx
push 0
push 3
push 0xc0000000
push edx
call ebx
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4032e1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x800c
ret
test esi, esi
jl 0x4033ad
jg 0x4032f3
test edi, edi
jbe 0x4033ad
test esi, esi
mov edi, 0x8000
jg 0x403308
jl 0x403304
cmp dword [esp + 0x14], edi
jae 0x403308
mov edi, dword [esp + 0x14]
push 0
lea eax, [esp + 0x14]
push eax
push edi
lea ecx, [esp + 0x28]
push ecx
push ebp
mov dword [esp + 0x24], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403354
cmp edi, dword [esp + 0x10]
jne 0x40334c
push 0
lea edx, [esp + 0x14]
push edx
push edi
lea eax, [esp + 0x28]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403354
cmp edi, dword [esp + 0x10]
je 0x403383
push 0x26
call dword [sym.imp.KERNEL32.dll_SetLastError]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x8024]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, dword [esp + 0x18]
call fcn.00407e50
mov edx, dword [esp + 0x14]
sub edx, edi
sbb esi, 0
test esi, esi
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], esi
jg 0x4032f3
jl 0x4033ad
mov eax, edx
test eax, eax
ja 0x4032f3
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push ebx
call esi
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00407db0
call fcn.004067d0
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x800c
ret