Function at 0x403000
Capabilities:
Read file on windows
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
push 0x40771c
push dword [ebp + 8]
mov dword [ebp - 0x1c], edx
mov ebx, ecx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov esi, eax
add esp, 8
mov dword [ebp - 0x20], esi
test esi, esi
jne 0x403049
push str.fopen_load__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 2
push 0
push 0
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fseeki64]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__ftelli64]
add esp, 0x14
mov dword [ebp - 4], eax
mov edi, edx
mov dword [ebp - 0x18], edi
push 0
push 0
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 0xc
push edi
push dword [ebp - 4]
push str.file_size_:_0x_llx_n
push 2
call esi
add esp, 4
push eax
call fcn.00401050
mov ecx, str.write_partition
call fcn.00401ad0
mov edx, dword [ebp - 0x1c]
mov ecx, ebx
push 1
push edi
push edi
push dword [ebp - 4]
call fcn.00402220
add esp, 0x20
mov ecx, ebx
call fcn.00401640
mov ecx, ebx
call fcn.00401750
test eax, eax
jne 0x4030df
push str.timeout_reached_n
push 2
call esi
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]
cmp dword [ebx + 0x20], 6
jge 0x4030ea
or ecx, 0xffffffff
jmp 0x403100
mov eax, dword [ebx]
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
or ecx, eax
cmp ecx, 0x80
je 0x40311e
push ecx
push str.unexpected_response__0x_04x__n
push 2
call esi
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov eax, dword [ebp - 4]
xorps xmm0, xmm0
mov ecx, dword [ebp - 0x18]
mov edi, eax
or eax, ecx
movlpd qword [ebp - 0x10], xmm0
je 0x40322e
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
mov edx, dword [ebp + 0xc]
test ecx, ecx
jb 0x403151
ja 0x40314f
cmp edi, edx
jbe 0x403151
mov edi, edx
push dword [ebp - 0x20]
push edi
push 1
push dword [ebx + 0xc]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
cmp eax, edi
jne 0x403227
push edi
push dword [ebx + 0xc]
mov edx, 2
mov ecx, ebx
call fcn.00401510
add esp, 8
mov ecx, ebx
call fcn.00401640
mov esi, dword [ebx + 0x2c]
mov eax, 0x3a98
cmp esi, eax
mov ecx, ebx
cmovg eax, esi
mov dword [ebx + 0x2c], eax
call fcn.00401750
mov dword [ebx + 0x2c], esi
test eax, eax
je 0x403205
mov ecx, ebx
call fcn.00401ab0
cmp eax, 0x80
jne 0x4031e1
mov esi, dword [ebp - 0xc]
mov edx, dword [ebp - 0x14]
add esi, edi
mov edi, dword [ebp - 4]
mov ecx, dword [ebp - 0x18]
adc edx, 0
sub edi, esi
mov dword [ebp - 0xc], esi
mov eax, edi
mov dword [ebp - 0x14], edx
sbb ecx, edx
or eax, ecx
jne 0x403142
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov eax, dword [ebp - 0xc]
jmp 0x403234
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 edx, dword [ebp - 0x14]
add esp, 0xc
mov eax, dword [ebp - 0xc]
jmp 0x403234
push str.timeout_reached_n
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push 2
call eax
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.fread_load__failed_n
jmp 0x40320a
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
push edx
push eax
push dword [ebp - 0x18]
push dword [ebp - 4]
push dword [ebp - 0x1c]
push str.load_partition:__s__target:_0x_llx__written:_0x_llx_n
push 2
call esi
add esp, 4
push eax
call fcn.00401050
add esp, 0x1c
push dword [ebp - 0x20]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov edx, 3
mov ecx, ebx
push 0
push 0
call fcn.00401510
add esp, 8
mov ecx, ebx
call fcn.00401640
mov ecx, ebx
call fcn.00401750
test eax, eax
je 0x4030c2
cmp dword [ebx + 0x20], 6
jge 0x403294
or ecx, 0xffffffff
jmp 0x4032aa
mov eax, dword [ebx]
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
or ecx, eax
cmp ecx, 0x80
je 0x4032c5
push ecx
push str.unexpected_response__0x_04x__n
push 2
call esi
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
jmp 0x4030d7
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret