Function at 0x4032d0
Capabilities:
Encode data using xor
Read file on windows
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x74
mov eax, dword [0x40a004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push 0x40771c
push eax
mov dword [ebp - 0x74], edx
xor ebx, ebx
mov dword [ebp - 0x6c], ecx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x70], 0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x4037a1
push 2
push ebx
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
add esp, 0xc
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
mov esi, eax
add esp, 4
test esi, esi
je 0x403797
push ebx
push ebx
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
xor ecx, ecx
add esp, 0xc
mov eax, esi
add eax, ecx
setb cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [ebp - 0x68], eax
test eax, eax
je 0x403797
push edi
push esi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
push edi
mov esi, eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x14
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [ebp - 0x60], eax
test eax, eax
jne 0x4033a9
push str.malloc_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 esi, dword [ebp - 0x68]
xor edx, edx
mov eax, 0x200
mov ecx, 4
mov edi, 0xffff
cmp dword [esi], 0x4e56
cmovne eax, edx
lea edx, [eax + esi]
lea eax, [edx + 4]
nop dword [eax]
mov eax, dword [eax]
shr eax, 0x10
add eax, 7
add ecx, eax
and ecx, 0xfffffffc
cmp word [ecx + edx], di
lea eax, [ecx + edx]
jne 0x4033d0
lea edi, [ecx + 8]
push edi
push edx
push dword [ebp - 0x60]
mov dword [ebp - 0x64], edi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push edi
push str.file_size_:_0x_zx_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
mov ecx, dword [ebp + 0xc]
mov eax, 2
add esp, 0xc
mov dword [ebp - 0x68], eax
add edi, 0xfffffffe
nop dword [eax + eax]
cmp edi, ecx
cmova edi, ecx
mov ecx, dword [ebp - 0x60]
add ecx, eax
mov edx, edi
mov eax, dword [ebp - 0x70]
mov esi, ecx
mov dword [ebp - 0x5c], ecx
movzx eax, ax
test edi, edi
je 0x403472
nop dword [eax + eax]
movzx ecx, byte [esi]
lea esi, [esi + 1]
xor ecx, eax
shr ax, 8
movzx ecx, cl
xor ax, word [ecx*2 + 0x407270]
movzx eax, ax
sub edx, 1
jne 0x403450
mov ecx, dword [ebp - 0x5c]
movzx eax, ax
xor esi, esi
movzx edx, ax
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x5c], edx
test edi, edi
je 0x403510
cmp edi, 8
jb 0x4034f4
mov eax, edi
xorps xmm2, xmm2
and eax, 0xfffffff8
xorps xmm3, xmm3
nop dword [eax + eax]
movd xmm1, dword [ecx]
lea ecx, [ecx + 8]
xorps xmm0, xmm0
add esi, 8
punpcklbw xmm1, xmm0
punpcklwd xmm1, xmm0
paddd xmm2, xmm1
movd xmm1, dword [ecx - 4]
punpcklbw xmm1, xmm0
punpcklwd xmm1, xmm0
paddd xmm3, xmm1
cmp esi, eax
jb 0x4034a0
paddd xmm2, xmm3
movaps xmm0, xmm2
psrldq xmm0, 8
paddd xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 4
paddd xmm2, xmm0
movd eax, xmm2
add ebx, eax
cmp esi, edi
jae 0x403510
mov ecx, dword [ebp - 0x68]
mov edx, edi
add ecx, esi
add ecx, dword [ebp - 0x60]
sub edx, esi
movzx eax, byte [ecx]
lea ecx, [ecx + 1]
add ebx, eax
sub edx, 1
jne 0x403500
mov edx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp + 0xc]
add eax, edi
mov edi, dword [ebp - 0x64]
mov dword [ebp - 0x68], eax
sub edi, eax
jne 0x403430
movzx ecx, dx
movzx eax, cl
shr ecx, 8
add eax, ebx
mov ebx, ecx
mov dword [ebp - 0x5c], ecx
mov ecx, dword [ebp - 0x60]
add ebx, eax
mov eax, edx
shr eax, 8
mov byte [ecx], al
mov byte [ecx + 1], dl
mov ecx, str.write_partition
call fcn.00401ad0
push 0x50
lea eax, [ebp - 0x58]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov esi, dword [ebp - 0x74]
add esp, 0xc
xor edx, edx
cmp edx, 0x24
jae 0x40378d
mov al, byte [esi + edx]
movsx ecx, al
mov byte [ebp + edx*2 - 0x58], al
mov eax, ecx
sar eax, 8
mov byte [ebp + edx*2 - 0x57], al
inc edx
test ecx, ecx
jne 0x403564
mov ecx, dword [ebp - 0x64]
mov edx, 1
mov esi, dword [ebp - 0x6c]
mov eax, ecx
shr eax, 8
mov byte [ebp - 0xf], al
mov eax, ecx
shr eax, 0x10
mov byte [ebp - 0xe], al
mov eax, ecx
shr eax, 0x18
mov byte [ebp - 0xd], al
mov eax, ebx
shr eax, 8
mov byte [ebp - 0xb], al
mov eax, ebx
shr eax, 0x10
mov byte [ebp - 0xa], al
lea eax, [ebp - 0x58]
mov byte [ebp - 0xc], bl
mov byte [ebp - 0x10], cl
mov ecx, esi
push 0x50
shr ebx, 0x18
push eax
mov byte [ebp - 9], bl
call fcn.00401510
add esp, 8
mov ecx, esi
call fcn.00401640
mov ecx, esi
call fcn.00401750
test eax, eax
jne 0x403609
push str.timeout_reached_n
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push 2
call edi
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 [esi + 0x20], 6
jge 0x403614
or ecx, 0xffffffff
jmp 0x40362a
mov eax, dword [esi]
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
or ecx, eax
cmp ecx, 0x80
je 0x40364e
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push ecx
push str.unexpected_response__0x_04x__n
push 2
call edi
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 edi, dword [ebp - 0x64]
xor ebx, ebx
test edi, edi
je 0x4036d0
nop word [eax + eax]
cmp edi, dword [ebp + 0xc]
mov eax, dword [ebp - 0x60]
cmova edi, dword [ebp + 0xc]
add eax, ebx
push edi
push eax
push dword [esi + 0xc]
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov edx, 2
mov ecx, esi
push edi
push dword [esi + 0xc]
call fcn.00401510
add esp, 8
mov ecx, esi
call fcn.00401640
mov esi, dword [esi + 0x2c]
mov eax, 0x3a98
mov ecx, dword [ebp - 0x6c]
cmp esi, eax
cmovg eax, esi
mov dword [ecx + 0x2c], eax
call fcn.00401750
mov ecx, dword [ebp - 0x6c]
mov dword [ecx + 0x2c], esi
test eax, eax
je 0x4035e6
mov esi, ecx
call fcn.00401ab0
cmp eax, 0x80
jne 0x403733
add ebx, edi
mov edi, dword [ebp - 0x64]
sub edi, ebx
jne 0x403660
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push 0
push ebx
push 0
push dword [ebp - 0x64]
push dword [ebp - 0x74]
push str.load_nv_partition:__s__target:_0x_llx__written:_0x_llx_n
push 2
call edi
add esp, 4
push eax
call fcn.00401050
add esp, 0x1c
push dword [ebp - 0x60]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov edx, 3
mov ecx, esi
push 0
push 0
call fcn.00401510
add esp, 8
mov ecx, esi
call fcn.00401640
mov ecx, esi
call fcn.00401750
test eax, eax
jne 0x403751
push str.timeout_reached_n
push 2
jmp 0x4035f3
mov edi, 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 edi
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
jmp 0x4036d6
cmp dword [esi + 0x20], 6
jge 0x40375c
or ecx, 0xffffffff
jmp 0x403772
mov eax, dword [esi]
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
or ecx, eax
cmp ecx, 0x80
je 0x4037c2
push ecx
push str.unexpected_response__0x_04x__n
push 2
call edi
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
jmp 0x403601
push str.name_too_long_n
jmp 0x4035eb
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push dword [ebp - 0x5c]
push str.loadfile___s___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, 0xc
jmp 0x403601
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004056f6
mov esp, ebp
pop ebp
ret