Function at 0x409930
Capabilities:
Read file on windows
Terminate process
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x440
mov eax, dword [0x586f0c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
xor eax, eax
push edi
xor edi, edi
mov dword [ebp - 0x440], edi
mov dword [ebp - 0x43c], eax
mov dword [ebp - 0x438], eax
mov dword [ebp - 0x434], eax
mov dword [ebp - 0x430], eax
mov dword [ebp - 0x42c], edi
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
push 0x21
push eax
mov dword [ebp - 0x424], eax
mov eax, dword [esi + 4]
lea ebx, [esi + 4]
push eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov ecx, dword [esi]
mov eax, dword [esi + 0x14]
lea edx, [ebp - 0x440]
push edx
push edi
mov dword [ebp - 0x41c], ecx
push 0x200
lea ecx, [ebp - 0x204]
push ecx
push eax
mov dword [ebp - 0x420], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea esp, [esp]
push 0xffffffffffffffff
push edi
lea edx, [ebp - 0x424]
push edx
push 3
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, edi
jne 0x409a4a
mov eax, dword [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
lea ecx, [ebp - 0x428]
push ecx
push 0x200
lea edx, [ebp - 0x404]
push edx
push ebx
call fcn.00401078
add esp, 0x10
mov dword [ebp - 0x414], eax
cmp eax, edi
jbe 0x409b5a
push edi
lea ecx, [ebp - 0x40c]
push ecx
push eax
mov eax, dword [esi + 0x10]
lea edx, [ebp - 0x404]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4099c0
mov ecx, dword [ebp - 0x40c]
cmp ecx, dword [ebp - 0x414]
jne 0x409b5a
cmp dword [ebp - 0x428], edi
jne 0x4099e3
jmp 0x4099c0
cmp eax, 1
jne 0x409b5a
mov ecx, dword [esi + 0x14]
push edi
lea edx, [ebp - 0x414]
push edx
lea eax, [ebp - 0x440]
push eax
push ecx
mov dword [ebp - 0x410], edi
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x409b49
cmp dword [0x58a24c], 0
mov edx, dword [ebp - 0x414]
lea edi, [ebp - 0x204]
mov dword [ebp - 0x418], edx
je 0x409abf
lea eax, [ebp - 0x42c]
push eax
lea ecx, [ebp - 0x410]
push ecx
lea edx, [ebp - 0x418]
push edx
mov eax, edi
push eax
call fcn.0040122b
add esp, 0x10
test eax, eax
je 0x409abf
mov edi, dword [ebp - 0x410]
mov ecx, dword [ebp - 0x424]
mov edx, dword [ebx]
push 0
push ecx
push edx
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov eax, dword [ebx]
push eax
call fcn.004161b0
mov ecx, dword [ebp - 0x418]
push ecx
push edi
push ebx
call fcn.00401190
mov dword [ebp - 0x40c], eax
mov eax, dword [ebp - 0x410]
add esp, 0x10
test eax, eax
je 0x409b03
push eax
call fcn.004be321
add esp, 4
mov edx, dword [ebp - 0x40c]
cmp edx, dword [ebp - 0x418]
jne 0x409b5a
mov eax, dword [ebp - 0x424]
mov ecx, dword [ebx]
push 0x21
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov ecx, dword [esi + 0x14]
lea edx, [ebp - 0x440]
push edx
push 0
push 0x200
lea eax, [ebp - 0x204]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
xor edi, edi
jmp 0x4099c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x4099c0
mov edx, dword [ebp - 0x424]
push edx
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
mov edi, dword [esi]
call fcn.00409710
cmp eax, 0xffffffff
jne 0x409b8a
push 0x1c1
push str.ncat_exec_win.c
push str.unregister_subprocess_info__proc_____1
call fcn.004becc9
add esp, 0xc
mov ecx, dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
lea eax, [ebp - 0x408]
push eax
push ecx
call edi
cmp dword [ebp - 0x408], 0x103
jne 0x409be4
cmp dword [0x58a208], 1
jle 0x409bbe
push str.Subprocess_still_running__terminating_it._n
call fcn.00401113
add esp, 4
mov edx, dword [esi]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
test eax, eax
jne 0x409be4
cmp dword [0x58a208], 1
jle 0x409be4
push eax
push str.TerminateProcess_failed_with_code__d._n
call fcn.00401113
add esp, 8
mov ecx, dword [esi]
lea eax, [ebp - 0x408]
push eax
push ecx
call edi
cmp dword [0x58a208], 1
jle 0x409c0d
mov edx, dword [ebp - 0x408]
push edx
push str.Subprocess_ended_with_exit_code__d._n
call fcn.00401113
add esp, 8
mov eax, dword [ebx]
push 2
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
call fcn.004095e0
push esi
call fcn.004be321
mov ecx, dword [0x58a580]
add esp, 4
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
pop edi
pop esi
pop ebx
test eax, eax
je 0x409c53
push 0x1d7
push str.ncat_exec_win.c
push str.WaitForSingleObject_pseudo_sigchld_mutex__INFINITE___WAIT_OBJECT_0
call fcn.004becc9
add esp, 0xc
mov eax, dword [0x58a57c]
test eax, eax
je 0x409c5e
call eax
mov edx, dword [0x58a580]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x409c86
push 0x1da
push str.ncat_exec_win.c
push str.ReleaseMutex_pseudo_sigchld_mutex____0
call fcn.004becc9
add esp, 0xc
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x408]
xor ecx, ebp
call fcn.004bf32e
mov esp, ebp
pop ebp
ret 4