Function at 0x406330
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x45acc0
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebp
push esi
push edi
mov eax, dword [0x46d184]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
xor ebp, ebp
mov dword [esp + 0x40], ebp
or edi, 0xffffffff
cmp dword [ebx + 0x1c], ebp
je 0x406369
cmp dword [ebx + 0x5c], edi
jne 0x406370
mov esi, ebx
call fcn.00405c00
cmp dword [ebx + 0x1c], ebp
jne 0x4063bd
mov dword [esp + 0x40], edi
mov esi, dword [esp + 0x4c]
cmp esi, ebp
je 0x4063a6
lea eax, [esi + 8]
mov ecx, edi
lock xadd dword [eax], ecx
jne 0x4063a6
mov edx, dword [esi]
mov eax, dword [edx]
mov ecx, esi
call eax
lea ecx, [esi + 0xc]
lock xadd dword [ecx], edi
jne 0x4063a6
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov ecx, esi
call eax
xor al, al
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
add esp, 0x34
ret 8
mov eax, dword [ebx + 0x5c]
cmp eax, edi
jne 0x4063ec
mov dword [esp + 0x40], edi
mov esi, dword [esp + 0x4c]
cmp esi, ebp
je 0x4063a6
lea ecx, [esi + 8]
mov edx, edi
lock xadd dword [ecx], edx
jne 0x4063a6
mov eax, dword [esi]
mov edx, dword [eax]
mov ecx, esi
call edx
lea eax, [esi + 0xc]
lock xadd dword [eax], edi
jmp 0x40639b
push ebp
push ebp
lea ecx, [esp + 0x20]
push ecx
push eax
mov dword [esp + 0x28], 2
call dword [sym.imp.KERNEL32.dll_SetNamedPipeHandleState]
cmp eax, ebp
jne 0x406415
lea eax, [esp + 0x48]
mov dword [esp + 0x40], edi
call fcn.00405860
jmp 0x4063a6
mov edx, dword [ebx + 0x5c]
mov edi, str.IPMS
mov dword [esp + 0x1c], edx
mov esi, 4
mov ecx, dword [esp + 0x1c]
push 0
lea eax, [esp + 0x24]
push eax
push esi
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x406454
mov eax, dword [esp + 0x20]
add ebp, eax
sub esi, eax
add edi, eax
cmp ebp, 4
jl 0x406426
sete al
test al, al
jne 0x406471
mov esi, ebx
call fcn.004065f0
lea eax, [esp + 0x48]
mov dword [esp + 0x40], 0xffffffff
call fcn.00405860
jmp 0x4063a6
mov edx, dword [esp + 0x48]
mov eax, dword [edx + 4]
mov ecx, dword [ebx + 0x5c]
mov dword [esp + 0x24], eax
lea edi, [esp + 0x24]
mov dword [esp + 0x20], ecx
xor ebp, ebp
mov esi, 4
mov eax, dword [esp + 0x20]
push 0
lea edx, [esp + 0x20]
push edx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x406454
mov eax, dword [esp + 0x1c]
add ebp, eax
sub esi, eax
add edi, eax
cmp ebp, 4
jl 0x40648e
sete al
test al, al
je 0x406454
mov ecx, dword [esp + 0x48]
mov edx, dword [ecx + 8]
mov eax, dword [ebx + 0x5c]
mov dword [esp + 0x14], edx
lea edi, [esp + 0x14]
mov dword [esp + 0x20], eax
xor ebp, ebp
mov esi, 4
mov edx, dword [esp + 0x20]
push 0
lea ecx, [esp + 0x20]
push ecx
push esi
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x406454
mov eax, dword [esp + 0x1c]
add ebp, eax
sub esi, eax
add edi, eax
cmp ebp, 4
jl 0x4064d9
sete al
test al, al
je 0x406454
mov ecx, dword [esp + 0x48]
mov eax, dword [ecx]
mov edx, dword [eax]
call edx
mov ecx, dword [esp + 0x14]
mov edx, dword [ebx + 0x5c]
push ecx
push edx
call fcn.004062e0
add esp, 8
test al, al
je 0x406454
mov eax, dword [ebx + 0x50]
mov eax, dword [eax]
mov ecx, dword [ebx + 0x3c]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x50]
mov edx, ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x30], edx
nop
test ecx, ecx
je 0x40655a
cmp ecx, dword [esp + 0x30]
je 0x40655f
call fcn.0044515c
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x2c], eax
je 0x4065c6
mov ebp, dword [ebx + 0x60]
mov dword [esp + 0x20], ebp
test ebp, ebp
je 0x40657e
lea ecx, [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea esi, [esp + 0x28]
mov byte [esp + 0x40], 1
call fcn.004066c0
mov edi, dword [eax]
sub esp, 8
lea eax, [esp + 0x50]
mov esi, esp
mov dword [esp + 0x24], esp
call fcn.00405800
mov edx, dword [edi]
mov eax, dword [edx + 4]
mov ecx, edi
call eax
test ebp, ebp
je 0x4065b7
add ebp, 8
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea esi, [esp + 0x28]
call fcn.004066f0
mov ecx, dword [esp + 0x28]
jmp 0x406550
lea eax, [esp + 0x48]
mov dword [esp + 0x40], 0xffffffff
call fcn.00405860
mov al, 1
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
add esp, 0x34
ret 8