Function at 0x4040e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x58
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x404660
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x18]
mov ecx, dword fs:[0]
mov edx, edi
mov dword [ebp - 0x18], ecx
lea ecx, [ebp - 0x3c]
mov dword fs:[0], eax
call fcn.00403db0
mov ebx, dword [ebp - 0x3c]
cmp ebx, 6
jne 0x40419a
mov al, byte [edi]
cmp al, 2
je 0x4044d3
mov ecx, dword [ebp + 0x10]
lea ebx, [edi + 4]
test al, al
je 0x4042df
mov ecx, dword [ebx]
cmp ecx, 0xffffffff
je 0x404236
mov eax, dword [ecx]
nop word [eax + eax]
test eax, eax
je 0x404236
js 0x4044cf
lea edx, [eax + 1]
lock cmpxchg dword [ecx], edx
jne 0x404150
mov eax, ebx
mov eax, dword [ebx]
mov edi, esi
mov dword [ebp - 0x3c], eax
mov esi, dword [eax + 8]
lock dec dword [eax]
jne 0x40418b
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x10], 0xffffffff
push eax
call fcn.004036e0
add esp, 4
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x10], 0xffffffff
jmp 0x4042e8
movsd xmm0, qword [ebp - 0x30]
movsd xmm1, qword [ebp - 0x28]
mov esi, dword [ebp - 0x38]
mov edi, dword [ebp - 0x34]
cmp ebx, 3
movsd qword [ebp - 0x64], xmm0
movsd qword [ebp - 0x5c], xmm1
je 0x404220
movsd xmm0, qword [ebp - 0x64]
movsd xmm1, qword [ebp - 0x5c]
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], edi
movsd qword [ebp - 0x30], xmm0
movsd qword [ebp - 0x28], xmm1
push 4
push 0x1c
call fcn.00403a70
add esp, 8
test eax, eax
je 0x4044e9
movsd xmm0, qword [ebp - 0x64]
movsd xmm1, qword [ebp - 0x5c]
mov dword [eax], ebx
mov dword [eax + 4], esi
mov dword [eax + 8], edi
movsd qword [eax + 0xc], xmm0
movsd qword [eax + 0x14], xmm1
push 0x42d83c
push eax
push 0x27
lea eax, [ebp - 0x3c]
push eax
call fcn.00407fd0
add esp, 0x10
mov esi, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x38]
mov eax, dword [ebp + 8]
mov dword [eax + 4], esi
mov esi, eax
mov dword [eax + 8], edi
mov dword [eax], 1
jmp 0x4044bc
mov dword [ebp - 0x44], 0xe9
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x4c], 1
cmp dword [ebp - 0x44], 0xe8
jne 0x40433e
mov al, byte [edi]
movsd xmm0, qword [ebp - 0x48]
cmp al, 2
movsd qword [ebp - 0x54], xmm0
je 0x40436c
test al, al
jne 0x4042b0
mov eax, dword [ebx]
mov dword [ebp - 0x40], ebx
mov eax, dword [eax + 8]
mov dword [ebp - 0x10], 4
mov dword [ebp - 0x20], eax
push eax
call sub.KERNEL32.dll_FlushFileBuffers
mov eax, dword [ebp + 0xc]
cmp byte [eax + 1], 0
jne 0x404299
push dword [ebp - 0x20]
call sub.KERNEL32.dll_DisconnectNamedPipe
push dword [ebp - 0x20]
call sub.KERNEL32.dll_CloseHandle
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp - 0x40]
cmp byte [eax], 0
je 0x404355
mov eax, dword [ebx]
cmp eax, 0xffffffff
je 0x40436c
lock dec dword [eax + 4]
jne 0x40436c
push 4
push 0xc
push dword [ebx]
call fcn.00403a80
add esp, 0xc
mov dword [ebp - 0x10], 1
jmp 0x40436c
mov eax, ebx
mov eax, dword [ebx]
mov edi, esi
mov esi, dword [eax + 8]
mov dword [ebp - 0x3c], 0
push 0
lea eax, [ebp - 0x3c]
push eax
push dword [ebp + 0x14]
push ecx
push esi
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x404316
mov eax, dword [ebp - 0x3c]
mov esi, edi
mov dword [edi + 4], eax
mov dword [edi], 0
jmp 0x4044bc
call fcn.0040e020
mov esi, edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x4c], 1
cmp dword [ebp - 0x44], 0xe8
je 0x404258
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x44]
mov dword [esi + 8], ecx
mov dword [esi + 4], eax
mov dword [esi], 1
jmp 0x4044bc
mov eax, dword [ebx]
lock dec dword [eax]
jne 0x40436c
mov dword [ebp - 0x10], 3
push ebx
call fcn.004036e0
add esp, 4
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x39]
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x10], 1
mov byte [edx], 2
mov dword [edx + 4], ecx
lea ecx, [ebp - 0x3c]
mov dword [edx + 1], eax
call fcn.00403db0
mov ebx, dword [ebp - 0x3c]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
cmp ebx, 6
jne 0x4043dc
mov eax, dword [ebp + 0xc]
cmp byte [eax], 2
je 0x4044fe
push edx
push ecx
push eax
push dword [ebp + 8]
call fcn.00404670
add esp, 0x10
cmp byte [ebp - 0x54], 3
jne 0x4044b9
mov ecx, dword [ebp - 0x50]
mov eax, dword [ecx]
mov dword [ebp - 0x20], ecx
mov ecx, dword [ecx + 4]
mov dword [ebp - 0x10], 6
push eax
call dword [ecx]
add esp, 4
jmp 0x404491
movsd xmm0, qword [ebp - 0x30]
movsd xmm1, qword [ebp - 0x28]
mov esi, dword [ebp - 0x38]
mov edi, dword [ebp - 0x34]
cmp ebx, 3
movsd qword [ebp - 0x64], xmm0
movsd qword [ebp - 0x5c], xmm1
je 0x404462
movsd xmm0, qword [ebp - 0x64]
movsd xmm1, qword [ebp - 0x5c]
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], edi
movsd qword [ebp - 0x30], xmm0
movsd qword [ebp - 0x28], xmm1
push 4
push 0x1c
call fcn.00403a70
add esp, 8
test eax, eax
je 0x404514
movsd xmm0, qword [ebp - 0x64]
movsd xmm1, qword [ebp - 0x5c]
mov dword [eax], ebx
mov dword [eax + 4], esi
mov dword [eax + 8], edi
movsd qword [eax + 0xc], xmm0
movsd qword [eax + 0x14], xmm1
push 0x42d83c
push eax
push 0x27
lea eax, [ebp - 0x3c]
push eax
call fcn.00407fd0
add esp, 0x10
mov esi, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x38]
mov eax, dword [ebp + 8]
cmp byte [ebp - 0x54], 3
mov dword [eax + 4], esi
mov esi, eax
mov dword [eax + 8], edi
mov dword [eax], 1
jne 0x4044bc
mov ecx, dword [ebp - 0x50]
mov eax, dword [ecx]
mov dword [ebp - 0x20], ecx
mov ecx, dword [ecx + 4]
mov dword [ebp - 0x10], 5
push eax
call dword [ecx]
add esp, 4
mov esi, dword [ebp - 0x20]
mov eax, dword [esi + 4]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x4044ac
push dword [eax + 8]
push ecx
push dword [esi]
call fcn.00403a80
add esp, 0xc
push 4
push 0xc
push esi
call fcn.00403a80
add esp, 0xc
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
mov eax, esi
add esp, 0x58
pop esi
pop edi
pop ebx
pop ebp
ret
ud2
push 0x42d740
push 0x28
push 0x42d705
call fcn.0042c3c0
add esp, 0xc
ud2
mov dword [ebp - 0x10], 0
push 4
push 0x1c
call fcn.0042c390
add esp, 8
jmp 0x404527
push 0x42d730
push 0x28
push 0x42d705
call fcn.0042c3c0
add esp, 0xc
jmp 0x404527
mov dword [ebp - 0x10], 2
push 4
push 0x1c
call fcn.0042c390
add esp, 8
ud2