Function at 0x403200
Capabilities:
Access peb ldr_data
Get kernel32 base address
Get process heap flags
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov edi, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
movzx eax, word [edi]
test edx, edx
jne 0x403468
mov esi, dword [ebp + 0x1c]
mov edx, edi
add esi, 0x12
test ax, ax
je 0x40323d
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x403230
sub edx, edi
add esi, edx
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [eax], 0x57494e45
mov edx, eax
mov eax, dword [ebp + 0x14]
sub esp, 0xc
mov dword [edx + 4], esi
mov dword [edx + 0xc], eax
cmp word [edi], 0
je 0x40368c
mov eax, edi
nop
add eax, 2
cmp word [eax], 0
jne 0x403280
sub eax, edi
sar eax, 1
add eax, 1
mov dword [edx + 8], eax
xor eax, eax
lea esi, [esi]
movzx ecx, word [edi + eax]
mov word [edx + eax + 0x10], cx
add eax, 2
test cx, cx
jne 0x403298
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x4034e0
mov eax, dword [ebx + 0x24]
mov esi, dword [edx + 4]
lea edi, [ebp - 0x30]
mov dword [esp + 4], edx
mov dword [esp + 0xc], edi
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], eax
mov dword [esp + 8], esi
mov eax, dword [ebx + 0x20]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
mov edx, dword [ebp - 0x3c]
sub esp, 0x14
test eax, eax
jne 0x403380
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x403328
test byte [section..data], 2
jne 0x4035c0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
jmp 0x403397
mov eax, dword [0x41806c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x24]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov edx, dword [ebp - 0x3c]
sub esp, 8
cmp eax, 0x102
je 0x403637
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x20]
mov dword [ebp - 0x3c], edx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
mov edx, dword [ebp - 0x3c]
sub esp, 0x10
test eax, eax
je 0x40330d
lea esi, [esi]
cmp esi, dword [ebp - 0x30]
je 0x4033d0
test byte [section..data], 2
jne 0x403590
mov eax, 0x1d
mov esi, dword [ebp + 0x20]
xor ebx, ebx
mov dword [esi], eax
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, ebx
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x20]
mov dword [esp + 8], 4
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x20]
mov dword [ebp - 0x3c], edx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
mov edx, dword [ebp - 0x3c]
sub esp, 0x14
test eax, eax
jne 0x403560
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x403508
test byte [section..data], 2
je 0x40331a
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], str.service_protocol_error___failed_to_read_pipe_r___d__count___d__n
mov dword [esp + 0x14], eax
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x418000
mov dword [esp], 1
mov dword [ebp - 0x3c], edx
call fcn.004016c0
mov edx, dword [ebp - 0x3c]
jmp 0x40331a
mov esi, dword [ebp + 0x14]
or esi, 0x80000000
mov dword [ebp - 0x3c], esi
test ax, ax
je 0x4035ef
mov ecx, edi
nop
add ecx, 2
cmp word [ecx], 0
jne 0x403480
sub ecx, edi
lea eax, [ecx + 2]
lea esi, [ecx + 0x14]
mov dword [ebp + 0x1c], eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp + 0x18], edi
mov edi, 0x419bc6
mov dword [eax], 0x57494e45
mov edx, eax
mov eax, dword [ebp - 0x3c]
sub esp, 0xc
mov dword [edx + 4], esi
mov dword [edx + 0xc], eax
mov eax, 1
jmp 0x403290
mov esi, dword [ebp + 0x1c]
mov eax, dword [edx + 8]
mov dword [ebp - 0x3c], edx
mov dword [esp + 8], esi
mov esi, dword [ebp + 0x18]
lea eax, [edx + eax*2 + 0x10]
mov dword [esp], eax
mov dword [esp + 4], esi
call sub.ucrtbase.dll_memcpy
mov edx, dword [ebp - 0x3c]
jmp 0x4032b4
mov eax, dword [0x41806c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x24]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov edx, dword [ebp - 0x3c]
sub esp, 8
cmp eax, 0x102
je 0x403679
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x20]
mov dword [ebp - 0x3c], edx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
mov edx, dword [ebp - 0x3c]
sub esp, 0x10
test eax, eax
je 0x40341a
nop
mov ecx, dword [ebp - 0x30]
mov ebx, 1
cmp ecx, 4
je 0x40339e
test byte [section..data], 2
jne 0x403600
mov eax, 0x1e
jmp 0x403397
mov dword [esp + 0xc], str.service_protocol_error___failed_to_write_pipe__n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x418000
mov dword [esp], 1
mov dword [ebp - 0x3c], edx
call fcn.004016c0
mov edx, dword [ebp - 0x3c]
jmp 0x403392
mov dword [esp + 0xc], str.service_protocol_error___failed_to_write_pipe__n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x418000
mov dword [esp], 1
mov dword [ebp - 0x3c], edx
call fcn.004016c0
mov edx, dword [ebp - 0x3c]
jmp 0x40331a
mov dword [ebp + 0x1c], 2
mov esi, 0x14
jmp 0x403494
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.service_protocol_error___failed_to_read_pipe_r___d__count___d__n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x418000
mov dword [esp], 1
mov dword [ebp - 0x3c], edx
call fcn.004016c0
mov edx, dword [ebp - 0x3c]
jmp 0x40357e
test byte [section..data], 2
jne 0x403650
mov eax, dword [ebp + 0x20]
xor ebx, ebx
mov dword [eax], 0x41d
jmp 0x40339e
mov dword [esp + 0xc], str.sending_command_timed_out_n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x418000
mov dword [esp], 1
call fcn.004016c0
mov edx, dword [ebp - 0x3c]
jmp 0x403640
test byte [section..data], 2
je 0x403640
mov dword [esp + 0xc], str.receiving_command_result_timed_out_n
jmp 0x403658
mov eax, 1
jmp 0x403290