Function at 0x403970
Capabilities:
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
sub esp, 0x30c
lea eax, [esp + 0x10c]
lea ecx, [esp + 0x20c]
lea edx, [esp + 0xc]
push ebx
push ebp
push esi
push edi
push eax
push ecx
lea eax, [esp + 0x18]
push edx
push eax
push 0x413be8
call dword [sym.imp.MSVCRT.dll__splitpath]
mov esi, dword [esp + 0x338]
mov ebx, dword [esp + 0x334]
push esi
push ebx
call fcn.00403950
add esp, 0x1c
test al, al
je 0x4039cd
push 0x4139d0
lea ecx, [esp + 0x20]
push esi
lea edx, [esp + 0x18]
push ecx
push edx
jmp 0x4039e1
push str..bin
lea eax, [esp + 0x20]
push str.main
lea ecx, [esp + 0x18]
push eax
push ecx
mov esi, dword [sym.imp.MSVCRT.dll__makepath]
push 0x413ae0
call esi
mov eax, ebx
add esp, 0x14
and eax, 0x100
mov dword [esp + 0x18], eax
je 0x403a4c
push 0x4139d8
call fcn.004050f0
add esp, 4
test eax, eax
je 0x403a1c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30c
ret
push 6
push 0x4139d8
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea edx, [esp + 0x11c]
lea eax, [esp + 0x21c]
push edx
push eax
push 0x4139d8
push 0
push 0x413ae0
call esi
add esp, 0x14
jmp 0x403a53
mov byte [0x4139d8], 0
test bl, 0x40
jne 0x403bc8
call fcn.00403f00
mov edi, eax
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
call fcn.00404840
mov esi, eax
add esi, 0x10000
sub ebx, esi
mov ebp, ebx
push ebp
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov ebx, eax
push 0
push 0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, esi
je 0x403ac4
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.SetFilePointer_for_input.
call fcn.00404510
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30c
ret
lea ecx, [esp + 0x14]
push 0
push ecx
push ebp
push ebx
push edi
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x403b0a
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.ReadFile_for_input.
call fcn.00404510
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30c
ret
mov ecx, dword [esp + 0x18]
mov eax, 0x80
test ecx, ecx
je 0x403b1c
mov eax, 6
push 0
push eax
push 2
push 0
push 1
push 0x40000000
push 0x413ae0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x403b66
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Cannot_open_output_file.
call fcn.00404510
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30c
ret
lea edx, [esp + 0x14]
push 0
push edx
push ebp
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x403ba9
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call edi
push str.WriteFile_for_output_file.
call fcn.00404510
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30c
ret
push str.Copy_succeeded.
call fcn.00404510
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 8
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call edi
pop edi
pop esi
pop ebp
mov eax, 0x413ae0
pop ebx
add esp, 0x30c
ret