Function at 0x402240
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x404040
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x10], esp
push esi
call fcn.00401db0
mov eax, dword [ebp + 8]
mov edi, dword [0x405bf8]
mov ebx, dword [0x405bfc]
push eax
call fcn.00401db0
mov eax, dword [0x405bfc]
mov ecx, dword [0x405bf8]
add esp, 8
cmp eax, ebx
mov dword [ebp + 0xc], ecx
jb 0x402333
push 0
push 0x80
push 3
push 0
push 0
push closesocket
push esi
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
mov esi, eax
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
lea edx, [ebp - 0x14]
mov edi, eax
push 0
push edx
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 8]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp + 0xc]
push 0
mov esi, eax
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea edx, [ebp - 0x18]
push 0
push edx
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret

Function at 0x402350
Capabilities:
Copy file
Delete file
Set file attributes
Write file on windows

Disassembly:
sub esp, 0x184
mov eax, dword [0x4057ec]
mov cx, word [0x4057f0]
mov dl, byte [0x4057f2]
push edi
mov dword [esp + 4], eax
mov word [esp + 8], cx
mov ecx, 0x1e
xor eax, eax
lea edi, [esp + 0xb]
mov byte [esp + 0xa], dl
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
mov eax, dword [esp + 0x18c]
lea ecx, [esp + 0x84]
push eax
push 0x4057dc
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea edx, [esp + 0x84]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [0x405b8c]
pop edi
test eax, eax
jne 0x4023bf
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
lea ecx, [esp + 0x80]
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
je 0x402410
push esi
lea edx, [esp + 0x84]
push 0x4057d8
push edx
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
push 0
push 0x50
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
push esi
push 6
lea eax, [esp + 0x20]
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x28
pop esi
mov al, byte [esp + 0x18c]
test al, al
je 0x402435
lea ecx, [esp + 0x80]
push 0x80
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
add esp, 0x184
ret
lea edx, [esp + 0x80]
push 6
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
add esp, 0x184
ret