Function at 0x402ca3
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x30
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
test eax, eax
je 0x402d4d
mov eax, dword [ebp + 8]
mov dword [eax + 0x10], 0
mov dword [ebp - 0x10], 0
mov eax, dword [ebp + 8]
lea edx, [eax + 0x14]
mov dword [esp + 0xc], 0
lea eax, [ebp - 0x10]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
call eax
sub esp, 0x10
test eax, eax
jne 0x402d21
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.GetOverlappedResult
call dbg.syserror
jmp 0x402ea7
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call dbg.iobuf_consume
mov eax, dword [ebp - 0x10]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x77
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dbg.print_xfer
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._iobuf_datalen_2
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
test eax, eax
jne 0x402d7f
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov eax, 0
jmp 0x402ea7
mov dword [ebp - 0x14], 0
mov eax, dword [ebp + 8]
lea esi, [eax + 0x14]
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._iobuf_dataptr_2
mov dword [esp + 0x10], esi
lea edx, [ebp - 0x14]
mov dword [esp + 0xc], edx
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WriteFile]
call eax
sub esp, 0x14
test eax, eax
je 0x402e1d
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x402dec
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.fd_closed
call dbg.error
jmp 0x402ea7
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call dbg.iobuf_consume
mov eax, dword [ebp - 0x14]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x77
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dbg.print_xfer
jmp 0x402ea2
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
cmp eax, 0x3e5
je 0x402e3e
cmp eax, 0x3e5
ja 0x402e81
cmp eax, 1
je 0x402e60
cmp eax, 0x6d
je 0x402e4a
jmp 0x402e81
mov eax, dword [ebp + 8]
mov dword [eax + 0x10], 1
jmp 0x402ea2
mov dword [esp + 4], str.child_process_has_closed_pipe
mov dword [esp], 0
call dbg.info
jmp 0x402ea2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.not_running_within_a_TS_session
call dbg.error
jmp 0x402ea7
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ResetEvent]
call eax
sub esp, 4
mov dword [esp], str.failed_to_write
call dbg.syserror
jmp 0x402ea7
mov eax, 0
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret