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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
nop
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_strlen
add esp, 4
sub eax, 3
mov ecx, dword [ebp + 8]
add ecx, eax
mov eax, 0x70
mov byte [ecx], al
mov eax, 0x406eb0
push eax
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, 0
je 0x40290c
jmp 0x402916
mov eax, 1
jmp 0x402b84
mov eax, 0x406ebf
push eax
mov eax, 0x406eb3
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
cmp eax, 0
je 0x40293e
jmp 0x402948
mov eax, 1
jmp 0x402b84
mov eax, 2
push eax
mov eax, 0
push eax
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fseek
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_ftell
add esp, 4
mov dword [ebp - 0xc], eax
mov eax, 0
push eax
mov eax, 0
push eax
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fseek
add esp, 0xc
mov eax, 0
push eax
mov eax, 0
push eax
mov eax, dword [ebp - 8]
push eax
call sub.msvcrt.dll_fseek
add esp, 0xc
mov eax, dword [ebp - 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov ecx, 8
cdq
idiv ecx
mov eax, dword [ebp - 0x10]
add eax, edx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
push eax
call sub.msvcrt.dll_malloc
add esp, 4
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
cmp eax, 0
jne 0x4029e0
mov eax, 1
jmp 0x402b84
mov eax, dword [ebp - 0x10]
push eax
mov eax, 0
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp - 0xc]
push eax
mov eax, 1
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.msvcrt.dll_fread
add esp, 0x10
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fflush
add esp, 4
mov eax, 0xc00400c
mov dword [ebp - 0x30], eax
mov eax, 0xc
push eax
mov eax, 0
push eax
lea eax, [ebp - 0x2c]
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
mov eax, str.CodeWarrior_PS_X_EXE_File_Patcher_by_imilco__Peter_Armstrong__nFile:__s_n
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, dword [ebp - 0x18]
add eax, 0x10
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax]
mov dword [ebp - 0x28], ecx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x1c]
add ecx, 8
mov edx, dword [ebp - 0x1c]
add edx, 0xc
mov dword [ebp - 0x34], eax
mov eax, dword [ecx]
mov ecx, dword [edx]
add eax, ecx
mov ecx, dword [ebp - 0x34]
mov dword [ecx], eax
mov eax, dword [ebp - 0x1c]
add eax, 0xc
mov ecx, dword [eax]
add ecx, 0x10
mov dword [eax], ecx
mov eax, dword [ebp - 0x28]
and eax, 0x3ffffff
shr eax, 2
add eax, 0x8000000
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x18]
add ecx, eax
mov dword [ebp - 0x20], ecx
mov eax, 0x10
push eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x20]
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov eax, dword [0x406010]
cmp eax, 1
jne 0x402ae2
mov eax, 0x406014
push eax
mov eax, str.Creating_PS_X_EXE_file:__s
push eax
call sub.msvcrt.dll_printf
add esp, 8
mov eax, 0x406f27
push eax
mov eax, 0x406014
push eax
call sub.msvcrt.dll_fopen
add esp, 8
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
cmp eax, 0
je 0x402b0a
jmp 0x402b14
mov eax, 1
jmp 0x402b84
mov eax, dword [ebp - 0xc]
add eax, 0x10
mov ecx, dword [ebp - 0x38]
push ecx
push eax
mov eax, 1
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.msvcrt.dll_fwrite
add esp, 0x10
mov eax, dword [ebp - 0x38]
push eax
call sub.msvcrt.dll_fflush
add esp, 4
mov eax, dword [ebp - 0x38]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [ebp - 4]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [ebp - 8]
push eax
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [ebp - 0x18]
push eax
call sub.msvcrt.dll_free
add esp, 4
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call sub.msvcrt.dll_fflush
add esp, 4
mov eax, 0
leave
ret