Function at 0x409780
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x432358
mov eax, dword fs:[0]
push eax
sub esp, 0x270
mov eax, dword [0x43e0b0]
xor eax, esp
mov dword [esp + 0x268], eax
push ebx
push esi
push edi
mov eax, dword [0x43e0b0]
xor eax, esp
push eax
lea eax, [esp + 0x280]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov esi, edx
xor ebx, ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
cmp esi, ebx
je 0x409ad8
cmp word [esi], bx
je 0x409ad8
push 0x206
lea eax, [esp + 0x72]
xor edx, edx
push ebx
push eax
mov word [esp + 0x78], dx
call fcn.00420a30
add esp, 0xc
push esi
push str..pipe_s
lea ecx, [esp + 0x74]
push 0x104
push ecx
call dword [sym.imp.SHLWAPI.dll_wnsprintfW]
add esp, 0x10
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], ebx
lea ecx, [esp + 0x24]
mov dword [esp + 0x288], ebx
call fcn.00408df0
lea eax, [esp + 0x24]
call fcn.00408f70
push 1
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x409878
push ebx
push eax
push 1
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
mov eax, dword [esp + 0x28]
cmp eax, ebx
je 0x40988f
push ebx
push eax
push 1
lea ecx, [esp + 0x38]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorSacl]
push ebx
push 0x80
push 3
lea eax, [esp + 0x4c]
push eax
push ebx
push 0xc0000000
lea ecx, [esp + 0x84]
lea edx, [esp + 0x44]
push ecx
mov dword [esp + 0x5c], 0xc
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4099d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, 0xe7
jne 0x409912
push ebx
lea edx, [esp + 0x70]
push edx
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
jne 0x409854
push esi
cmp dword [ebp + 0x10], ebx
jbe 0x40998d
dec dword [ebp + 0x10]
push str.WaitRetry
call fcn.00409260
add esp, 8
jmp 0x409854
cmp dword [ebp + 0x10], ebx
jbe 0x4099af
mov eax, dword [0x43e060]
mov edx, dword [eax + 0xc]
dec dword [ebp + 0x10]
mov ecx, 0x43e060
call edx
add eax, 0x10
mov dword [esp + 0x14], eax
push esi
push str.CreateRetry
push str._s_LastError___d
lea edi, [esp + 0x20]
mov byte [esp + 0x294], 1
call fcn.00405780
mov edi, dword [esp + 0x20]
add esp, 0xc
call fcn.004090b0
lea eax, [edi - 0x10]
mov byte [esp + 0x288], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409980
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x409854
push str.WaitEnd
call fcn.00409260
add esp, 8
lea ecx, [esp + 0x24]
mov dword [esp + 0x288], 0xffffffff
push ecx
jmp 0x409ad3
push esi
push str.CreateEnd
call fcn.00409260
add esp, 8
lea edx, [esp + 0x24]
mov dword [esp + 0x288], 0xffffffff
push edx
jmp 0x409ad3
mov eax, dword [esp + 0x18]
add eax, 8
push eax
mov dword [esp + 0x24], ebx
call fcn.0041e543
mov ebx, eax
xor esi, esi
add esp, 4
cmp ebx, esi
je 0x40999a
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebp + 8]
mov dword [ebx], edx
cmp ecx, esi
jne 0x409a03
xor eax, eax
mov dword [esp + 0x18], eax
jmp 0x409a07
mov eax, dword [esp + 0x18]
mov dword [ebx + 4], eax
cmp ecx, esi
je 0x409a1c
push eax
push ecx
lea eax, [ebx + 8]
push eax
call fcn.004217f0
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, 8
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], eax
je 0x409a9c
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x24]
push ecx
sub edx, esi
add edx, 8
push edx
lea eax, [esi + ebx]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x20], 0
jne 0x409a7c
mov eax, dword [esp + 0x14]
mov ecx, eax
inc eax
mov dword [esp + 0x14], eax
cmp ecx, 3
jg 0x409a88
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WriteFileRetry
call fcn.00409260
add esp, 8
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
add esi, dword [esp + 0x20]
cmp esi, dword [esp + 0x1c]
jb 0x409a2d
jmp 0x409a9c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WriteFileEnd
call fcn.00409260
add esp, 8
push ebx
call fcn.0041f3ee
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x288], 0xffffffff
cmp dword [esp + 0x1c], esi
jne 0x409ace
lea edx, [esp + 0x24]
push edx
call fcn.00408d50
mov eax, 1
jmp 0x409ada
lea eax, [esp + 0x24]
push eax
call fcn.00408d50
xor eax, eax
mov ecx, dword [esp + 0x280]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x268]
xor ecx, esp
call fcn.0041e965
mov esp, ebp
pop ebp
ret