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

Disassembly:
push ebp
mov eax, 0x4830
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
call fcn.00402660
sub esp, eax
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
call dbg.__main
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x11
mov dword [esp + 4], 1
mov dword [esp], str.7800makecc2_v0.1_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sym._fwrite
cmp ebx, 1
jle 0x402a7c
mov ebx, dword [esi + ebx*4 - 4]
cmp byte [ebx], 0x2d
je 0x402a7c
lea eax, [esp + 0x2c]
mov dword [esp + 8], 0x400
mov dword [esp + 4], ebx
mov dword [esp], eax
call sym._strncpy
lea eax, [esp + 0x42c]
mov dword [esp + 8], 0x400
mov dword [esp + 4], ebx
mov dword [esp], eax
call sym._strncpy
lea edx, [esp + 0x42c]
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x402848
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea ecx, [edx + 2]
cmove edx, ecx
mov ecx, eax
add cl, al
lea eax, [esp + 0x2c]
sbb edx, 3
mov dword [edx], 0x3243432e
mov byte [edx + 4], 0
mov dword [esp + 4], 0x404051
mov dword [esp], eax
call sym._fopen
test eax, eax
mov edi, eax
je 0x402a9a
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._fseek
mov dword [esp], edi
call sym._ftell
test eax, eax
mov dword [esp + 0x18], eax
je 0x402a86
cmp dword [esp + 0x18], 0x24080
je 0x4029e2
cmp dword [esp + 0x18], 0x24000
je 0x402904
lea eax, [esp + 0x2c]
mov dword [esp], str.__The_ROM__s_is_compatible_with_CC2._n
mov dword [esp + 4], eax
call sym._printf
mov dword [esp], 0
call sym._exit
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4000
mov dword [esp], edi
call sym._fseek
lea eax, [esp + 0x42c]
mov dword [esp + 4], 0x4040c4
xor ebx, ebx
lea esi, [esp + 0x830]
mov dword [esp], eax
call sym._fopen
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x402959
jmp 0x402aae
cmp ebx, 8
je 0x4029ff
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp + 4], 0x4000
mov dword [esp], esi
call sym._fread
test eax, eax
je 0x402a51
mov eax, dword [esp + 0x1c]
mov dword [esp + 8], 1
mov dword [esp + 4], 0x4000
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sym._fwrite
test eax, eax
je 0x402a65
add ebx, 1
cmp ebx, 9
jne 0x402950
mov dword [esp], edi
call sym._fclose
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sym._fclose
lea eax, [esp + 0x42c]
mov dword [esp], str.__Created_ROM__s_for_CC2_compatibility._n
mov dword [esp + 4], eax
call sym._printf
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4080
mov dword [esp], edi
call sym._fseek
jmp 0x40291c
cmp dword [esp + 0x18], 0x24080
je 0x402a34
cmp dword [esp + 0x18], 0x24000
jne 0x402959
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call sym._fseek
jmp 0x402959
mov dword [esp + 8], 0
mov dword [esp + 4], pe_nt_image_headers32
mov dword [esp], edi
call sym._fseek
jmp 0x402959
lea eax, [esp + 0x2c]
mov dword [esp], str.Problem_reading_from__s._n
mov dword [esp + 4], eax
call sym._prerror
lea eax, [esp + 0x42c]
mov dword [esp], str.Problem_writing_to__s._n
mov dword [esp + 4], eax
call sym._prerror
mov eax, dword [esi]
mov dword [esp], eax
call sym._usage
lea eax, [esp + 0x2c]
mov dword [esp], str.The_file_size_of__s_is_0_bytes._n
mov dword [esp + 4], eax
call sym._prerror
lea eax, [esp + 0x2c]
mov dword [esp], str.Couldnt_open__s_for_reading._n
mov dword [esp + 4], eax
call sym._prerror
lea eax, [esp + 0x42c]
mov dword [esp], str.Couldnt_open__s_for_writing._n
mov dword [esp + 4], eax
call sym._prerror
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop