Function at 0x401050
Capabilities:
Encode data using xor
Hash data with crc32
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
mov eax, dword [0x404004]
xor eax, esp
mov dword [esp + 0x30], eax
cmp dword [ebp + 8], 8
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
je 0x401094
push dword [eax]
push str.USAGE:__s__board___ver_hi___ver_lo___ver_patch___in_file___out_file_for_flash___out_file_for_bootloader__n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00401622
mov esp, ebp
pop ebp
ret
mov ecx, dword [eax + 8]
mov esi, 0x403398
mov ebx, dword [eax + 4]
xor edi, edi
mov dword [esp + 0x20], ecx
mov ecx, dword [eax + 0xc]
mov dword [esp + 0x1c], ecx
mov ecx, dword [eax + 0x10]
mov dword [esp + 0x18], ecx
mov ecx, dword [eax + 0x14]
mov dword [esp + 0xc], ecx
mov ecx, dword [eax + 0x18]
mov eax, dword [eax + 0x1c]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], eax
mov eax, dword [esi]
mov ecx, ebx
nop dword [eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4010f0
test dl, dl
je 0x4010ec
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4010f0
add eax, 2
add ecx, 2
test dl, dl
jne 0x4010d0
xor eax, eax
jmp 0x4010f5
sbb eax, eax
or eax, 1
test eax, eax
je 0x401127
add edi, 0xc
add esi, 0xc
cmp edi, 0x78
jb 0x4010c8
push ebx
push str._board__s__not_found_n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00401622
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
push dword [esp + 0x20]
mov dword [0x409b84], eax
mov eax, dword [esi + 8]
mov esi, dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
mov dword [0x409b80], eax
call esi
add esp, 4
mov dword [esp + 0x24], eax
test eax, eax
js 0x401588
cmp eax, 0x63
jg 0x401588
push dword [esp + 0x1c]
call esi
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
js 0x401581
cmp eax, 0x63
jg 0x401581
push dword [esp + 0x18]
call esi
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
js 0x40157a
cmp eax, 0x63
jg 0x40157a
mov edi, dword [esp + 0xc]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
push 0x4032bc
push edi
call esi
mov ebx, eax
add esp, 8
mov dword [esp + 0x10], ebx
test ebx, ebx
jne 0x4011d9
push edi
push str.Unable_to_open__s_for_reading_n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00401622
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0x28]
push 0x4032e4
push edi
call esi
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40121d
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push edi
push str.Unable_to_open__s_for_writing_n
call fcn.00401010
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00401622
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0x2c]
push 0x4032e4
push edi
call esi
add esp, 8
mov dword [esp + 0xc], eax
test eax, eax
je 0x4011f0
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov eax, dword [esp + 0x34]
add esp, 4
add eax, 0xbf17fb43
push eax
call dword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_srand]
mov edi, dword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
add esp, 4
xor esi, esi
nop dword [eax]
call edi
mov byte [esi + 0x409b88], al
inc esi
cmp esi, 0x100
jb 0x401260
mov eax, dword [0x409b84]
mov dword [0x409b88], eax
mov eax, dword [esp + 0x24]
mov byte [0x409b8c], al
mov eax, dword [esp + 0x1c]
mov byte [0x409b8d], al
mov eax, dword [esp + 0x20]
push str.IV:
mov byte [0x409b8e], al
mov byte [0x409b8f], 0
call fcn.00401010
add esp, 4
xor esi, esi
nop dword [eax]
movzx eax, byte [esi + 0x409b90]
push eax
push str._02X
call fcn.00401010
inc esi
add esp, 8
cmp esi, 8
jl 0x4012b0
push 0x40331c
call fcn.00401010
mov eax, dword [0x409b80]
add esp, 4
mov ecx, dword [0x409b94]
movups xmm0, xmmword [eax]
mov eax, dword [0x409b90]
mov dword [0x409c9c], ecx
mov ecx, 0x409b90
movups xmmword [0x409c88], xmm0
mov dword [0x409c98], eax
call fcn.004015b0
or ecx, 0xffffffff
mov dword [esp + 0x18], 0xfc
mov esi, 0x409b88
movzx edx, byte [esi]
mov bl, 8
xor edx, ecx
nop
mov eax, edx
shr eax, 1
mov ecx, eax
xor ecx, 0xedb88320
test dl, 1
cmove ecx, eax
mov edx, ecx
add bl, 0xff
jne 0x401320
inc esi
sub dword [esp + 0x18], 1
jne 0x401317
mov dword [0x409c84], ecx
xor esi, esi
nop dword [eax]
call edi
mov byte [esi + 0x404380], al
inc esi
cmp esi, 0x5800
jb 0x401350
mov ebx, dword [esp + 0x10]
push ebx
push 0x5800
push 1
push 0x404380
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
test eax, eax
je 0x401552
cmp eax, 0x57f4
ja 0x401552
mov ecx, dword [0x404018]
mov esi, 0x404380
mov eax, dword [0x409b84]
mov edi, 0x57fc
mov dword [ecx], eax
mov eax, dword [esp + 0x24]
mov byte [ecx + 4], al
mov eax, dword [esp + 0x1c]
mov byte [ecx + 5], al
mov eax, dword [esp + 0x20]
mov byte [ecx + 6], al
mov byte [ecx + 7], 0
or ecx, 0xffffffff
movzx edx, byte [esi]
mov bl, 8
xor edx, ecx
mov eax, edx
shr eax, 1
mov ecx, eax
xor ecx, 0xedb88320
test dl, 1
cmove ecx, eax
mov edx, ecx
add bl, 0xff
jne 0x4013c8
inc esi
sub edi, 1
jne 0x4013c1
mov ebx, dword [esp + 0x14]
mov eax, dword [0x404018]
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push ebx
push 0x5800
push 1
push 0x404380
mov dword [eax + 8], ecx
call edi
add esp, 0x10
cmp eax, 0x5800
je 0x401440
push dword [esp + 0x28]
push str.Error__Unable_to_write_to__s_n
call fcn.00401010
push dword [esp + 0x18]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
call esi
add esp, 0xc
push ebx
call esi
add esp, 4
push dword [esp + 0xc]
call esi
jmp 0x401592
mov esi, 0x404382
mov ebx, 0xb00
nop word [eax + eax]
movzx eax, byte [esi - 2]
mov ecx, 0x409c98
xor byte [0x409c98], al
movzx eax, byte [esi - 1]
xor byte [0x409c99], al
movzx eax, byte [esi]
xor byte [0x409c9a], al
movzx eax, byte [esi + 1]
xor byte [0x409c9b], al
movzx eax, byte [esi + 2]
xor byte [0x409c9c], al
movzx eax, byte [esi + 3]
xor byte [0x409c9d], al
movzx eax, byte [esi + 4]
xor byte [0x409c9e], al
movzx eax, byte [esi + 5]
xor byte [0x409c9f], al
call fcn.004015b0
mov eax, dword [0x409c98]
lea esi, [esi + 8]
mov ecx, dword [0x409c9c]
mov dword [esi - 0xa], eax
mov dword [esi - 6], ecx
sub ebx, 1
jne 0x401450
mov ebx, dword [esp + 0xc]
push ebx
push 1
push 0x100
push 0x409b88
call edi
add esp, 0x10
cmp eax, 1
jne 0x401527
push ebx
push 0x5800
push eax
push 0x404380
call edi
add esp, 0x10
cmp eax, 0x5800
jne 0x401527
push dword [esp + 0x10]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
call esi
add esp, 4
push dword [esp + 0x14]
call esi
add esp, 4
push ebx
call esi
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00401622
mov esp, ebp
pop ebp
ret
push dword [esp + 0x2c]
push str.Error__Unable_to_write_to__s_n
call fcn.00401010
push dword [esp + 0x18]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
call esi
add esp, 0xc
push dword [esp + 0x14]
call esi
add esp, 4
push ebx
call esi
jmp 0x401592
push eax
push str.Error__App_size___u_bytes__invalid_n
call fcn.00401010
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
push ebx
call esi
add esp, 0xc
push dword [esp + 0x14]
call esi
add esp, 4
push dword [esp + 0xc]
call esi
jmp 0x401592
push str._ver_patch__must_be_00_to_99_n
jmp 0x40158d
push str._ver_lo__must_be_00_to_99_n
jmp 0x40158d
push str._ver_hi__must_be_00_to_99_n
call fcn.00401010
mov ecx, dword [esp + 0x40]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00401622
mov esp, ebp
pop ebp
ret