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

Disassembly:
push ebp
mov eax, 0x202c
mov ebp, esp
push edi
push esi
push ebx
call fcn.00402d00
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
cmp edx, 2
jle 0x4015d7
mov ecx, dword [eax + 8]
cmp edx, 3
mov edi, dword [eax + 4]
mov dword [ebp - 0x2020], 0
mov dword [ebp - 0x2024], ecx
je 0x40143b
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_atoi
mov dword [ebp - 0x2020], eax
mov dword [esp], edi
call sub.msvcrt.dll_strlen
cmp byte [edi + eax - 4], 0x2e
mov ebx, eax
je 0x401610
xor esi, esi
mov eax, dword [ebp - 0x2024]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, dword [ebp - 0x2024]
cmp byte [eax + edx - 4], 0x2e
mov ebx, eax
je 0x401657
xor eax, eax
mov ecx, eax
or ecx, esi
je 0x4014c0
mov edx, esi
test dl, dl
je 0x4014f8
test eax, eax
je 0x4014f8
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x23
mov dword [esp + 4], 1
mov dword [esp], str.Both_filenames_cannot_end_in_.jed__n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
add esp, 0x202c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x30
mov dword [esp + 4], 1
mov dword [esp], str.At_least_one_of_the_filenames_must_end_in_.jed__n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, 1
add esp, 0x202c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x40411c
mov dword [esp], edi
call sub.msvcrt.dll_fopen
test eax, eax
mov ebx, eax
je 0x4016b0
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov dword [esp], ebx
call sub.msvcrt.dll_ftell
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
mov dword [0x405020], eax
call sub.msvcrt.dll_fseek
mov eax, dword [0x405020]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov edx, eax
mov dword [0x405010], eax
je 0x401841
mov eax, dword [0x405020]
mov dword [esp], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
call sub.msvcrt.dll_fread
mov edx, dword [0x405020]
cmp eax, edx
je 0x4016d6
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], edx
mov dword [esp + 4], str.Error_reading__d_bytes_from_the_source__n
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [0x405010]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
add esp, 0x202c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x93
mov dword [esp + 4], 1
mov dword [esp], str.Usage:_n__jedutil__source.jed___target.bin___fuses_____convert_JED_to_binary_form_n__jedutil__source.bin___target.jed_____convert_binary_to_JED_form_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
add esp, 0x202c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [edi + eax - 3]
mov dword [esp], eax
call sub.msvcrt.dll_tolower
cmp eax, 0x6a
jne 0x401450
movzx eax, byte [edi + ebx - 2]
mov dword [esp], eax
call sub.msvcrt.dll_tolower
cmp eax, 0x65
jne 0x401450
movzx eax, byte [edi + ebx - 1]
mov dword [esp], eax
call sub.msvcrt.dll_tolower
cmp eax, 0x64
sete al
movzx esi, al
jmp 0x401452
movzx eax, byte [eax + edx - 3]
mov dword [esp], eax
call sub.msvcrt.dll_tolower
cmp eax, 0x6a
jne 0x401473
mov ecx, dword [ebp - 0x2024]
movzx eax, byte [ebx + ecx - 2]
mov dword [esp], eax
call sub.msvcrt.dll_tolower
cmp eax, 0x65
jne 0x401473
mov edx, dword [ebp - 0x2024]
movzx eax, byte [ebx + edx - 1]
mov dword [esp], eax
call sub.msvcrt.dll_tolower
cmp eax, 0x64
sete al
movzx eax, al
jmp 0x401475
mov dword [esp + 8], edi
mov dword [esp + 4], str.Unable_to_open_source_file__s__n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, 1
jmp 0x4014ed
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov ecx, esi
test cl, cl
je 0x401854
mov eax, dword [ebp - 0x2024]
lea ebx, [ebp - 0x2010]
mov dword [esp + 4], edi
mov dword [esp], str.Converting__s_to_binary_form__s_n
mov dword [esp + 8], eax
call sub.msvcrt.dll_printf
mov eax, dword [0x405020]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [0x405010]
mov dword [esp], eax
call fcn.00402240
cmp eax, 2
je 0x40196c
cmp eax, 3
je 0x40193a
sub eax, 1
je 0x40199e
mov eax, dword [ebp - 0x2020]
test eax, eax
je 0x401753
mov edx, dword [ebp - 0x2020]
mov dword [ebp - 0x2010], edx
mov dword [esp], str.Source_file_read_successfully
call sub.msvcrt.dll_puts
mov eax, dword [ebp - 0x2010]
mov dword [esp], str.__Total_fuses___d_n
mov dword [esp + 4], eax
call sub.msvcrt.dll_printf
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.00401a20
mov dword [0x405040], eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov edx, eax
mov dword [0x405030], eax
je 0x4019eb
mov eax, dword [0x405040]
mov dword [esp + 4], edx
mov dword [esp], ebx
mov dword [esp + 8], eax
call fcn.00401a20
mov dword [0x405040], eax
mov dword [esp + 4], 0x4042e8
mov eax, dword [ebp - 0x2024]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
test eax, eax
mov ebx, eax
je 0x401a01
mov dword [esp + 0xc], eax
mov eax, dword [0x405040]
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov eax, dword [0x405030]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov edx, dword [0x405040]
cmp eax, edx
je 0x4019d0
mov dword [esp + 8], edx
mov dword [esp + 4], str.Error_writing__d_bytes_to_the_target__n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov eax, 1
jmp 0x4014ed
mov eax, dword [0x405020]
mov dword [esp + 4], str.Unable_to_allocate__d_bytes_for_the_source__n
mov dword [esp + 8], eax
jmp 0x40181f
mov ecx, dword [ebp - 0x2024]
lea ebx, [ebp - 0x2010]
mov dword [esp + 4], edi
mov dword [esp], str.Converting__s_to_JED_form__s_n
mov dword [esp + 8], ecx
call sub.msvcrt.dll_printf
mov eax, dword [0x405020]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [0x405010]
mov dword [esp], eax
call fcn.00401a90
sub eax, 1
je 0x401908
mov dword [esp], str.Source_file_read_successfully
call sub.msvcrt.dll_puts
mov eax, dword [ebp - 0x2010]
mov dword [esp], str.__Total_fuses___d_n
mov dword [esp + 4], eax
call sub.msvcrt.dll_printf
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call fcn.00401b30
mov dword [0x405040], eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov edx, eax
mov dword [0x405030], eax
je 0x4019eb
mov eax, dword [0x405040]
mov dword [esp + 4], edx
mov dword [esp], ebx
mov dword [esp + 8], eax
call fcn.00401b30
mov dword [0x405040], eax
jmp 0x4017c3
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x27
mov dword [esp + 4], 1
mov dword [esp], str.Fatal_error:_Invalid_binary_JEDEC_file_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, 1
jmp 0x4014ed
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x22
mov dword [esp + 4], 1
mov dword [esp], str.Fatal_error:_Bad_fusemap_checksum_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, 1
jmp 0x4014ed
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x27
mov dword [esp + 4], 1
mov dword [esp], str.Fatal_error:_Bad_transmission_checksum_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, 1
jmp 0x4014ed
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x1f
mov dword [esp + 4], 1
mov dword [esp], str.Fatal_error:_Invalid_.JED_file_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov eax, 1
jmp 0x4014ed
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov dword [esp], str.Target_file_written_succesfully
call sub.msvcrt.dll_puts
xor eax, eax
jmp 0x4014ed
mov eax, dword [0x405040]
mov dword [esp + 4], str.Unable_to_allocate__d_bytes_for_the_target_buffer__n
mov dword [esp + 8], eax
jmp 0x4016bc
mov edx, dword [ebp - 0x2024]
mov dword [esp + 4], str.Unable_to_open_target_file__s__n
mov dword [esp + 8], edx
jmp 0x4016bc