Function at 0x401e70
Capabilities:
Terminate process
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
push edi
push 0x40652c
push dword [ebp + 0x10]
mov edi, edx
mov esi, ecx
mov dword [ebp - 4], edi
mov dword [ebp - 0x20], esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 8
mov dword [ebp - 8], eax
test eax, eax
jne 0x401ebc
push str.fopen_dump__failed_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov eax, dword [ebp + 8]
mov ebx, eax
mov ecx, dword [ebp + 0xc]
add ecx, eax
mov dword [ebp - 0x1c], ecx
cmp eax, ecx
jae 0x401fce
mov edx, dword [ebp - 4]
mov ecx, edx
mov edi, dword [ebp + 0x14]
shr ecx, 0x18
mov dword [ebp - 0xc], ecx
mov ecx, edx
shr ecx, 0x10
mov dword [ebp - 0x10], ecx
mov ecx, edx
shr ecx, 8
mov dword [ebp - 0x14], ecx
nop
mov ecx, eax
mov byte [ebp - 0x29], dl
mov eax, dword [ebp - 0xc]
sub ecx, ebx
add ecx, dword [ebp + 0xc]
mov edx, 6
mov byte [ebp - 0x2c], al
cmp ecx, edi
mov eax, dword [ebp - 0x10]
mov byte [ebp - 0x2b], al
cmova ecx, edi
mov eax, dword [ebp - 0x14]
mov byte [ebp - 0x2a], al
mov eax, ecx
shr eax, 0x18
mov byte [ebp - 0x28], al
mov eax, ecx
shr eax, 0x10
mov byte [ebp - 0x27], al
mov eax, ecx
shr eax, 8
mov byte [ebp - 0x26], al
mov eax, ebx
shr eax, 0x18
mov byte [ebp - 0x24], al
mov eax, ebx
shr eax, 0x10
mov byte [ebp - 0x23], al
mov eax, ebx
shr eax, 8
mov byte [ebp - 0x22], al
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x18], ecx
mov byte [ebp - 0x25], cl
mov ecx, esi
push 0xc
push eax
mov byte [ebp - 0x21], bl
call fcn.00401550
add esp, 8
mov ecx, esi
call fcn.00401680
mov ecx, esi
call fcn.00401790
mov ecx, esi
call fcn.00401af0
cmp eax, 0x93
jne 0x40204a
mov ecx, dword [esi]
mov edi, dword [ebp - 0x18]
movzx esi, byte [ecx + 2]
movzx eax, byte [ecx + 3]
shl esi, 8
or esi, eax
cmp edi, esi
jb 0x402029
push dword [ebp - 8]
lea eax, [ecx + 4]
push esi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, esi
jne 0x402008
add ebx, esi
cmp edi, esi
jne 0x401fcb
mov eax, dword [ebp + 8]
mov esi, dword [ebp - 0x20]
mov edx, dword [ebp - 4]
mov edi, dword [ebp + 0x14]
cmp ebx, dword [ebp - 0x1c]
jb 0x401ef0
mov edi, dword [ebp - 4]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov ecx, dword [ebp + 8]
mov eax, ebx
sub eax, ecx
push eax
push dword [ebp + 0xc]
push ecx
push edi
push str.dump_flash:_0x_08x0x_x__target:_0x_x__read:_0x_x_n
push 2
call esi
add esp, 4
push eax
call fcn.00401050
push dword [ebp - 8]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x1c
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.fwrite_dump__failed_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
push str.unexpected_length_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push eax
push str.unexpected_response__0x_04x__n
push 2
call esi
add esp, 4
push eax
call fcn.00401050
mov edi, dword [ebp - 4]
add esp, 0xc
jmp 0x401fd4