Function at 0x406a70
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x444
mov eax, dword [0x433eb0]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
lea edi, [ebx + 8]
push 0xa
mov ecx, edi
call fcn.00406e50
mov eax, dword [edi]
mov eax, dword [eax + 4]
xor esi, esi
test byte [eax + edi + 0xc], 6
jne 0x406ac1
mov eax, dword [eax + edi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x406ac1
mov esi, 4
mov ecx, dword [edi]
mov ecx, dword [ecx + 4]
add ecx, edi
test esi, esi
je 0x406ae2
mov eax, dword [ecx + 0xc]
or eax, esi
cmp dword [ecx + 0x38], 0
jne 0x406ada
or eax, 4
push 0
push eax
call fcn.00401c20
lea eax, [ebx + 0xc]
push eax
lea esi, [esp + 0x14]
call fcn.004032c0
mov eax, dword [0x437a08]
test eax, eax
je 0x406b31
mov ecx, dword [ebx + 0xa0]
mov edx, esi
push edx
mov edx, dword [ebx + 0xa8]
push ecx
mov ecx, dword [ebx + 0xa4]
push edx
mov edx, dword [ebx]
push ecx
push edx
call eax
add esp, 0x14
test al, al
je 0x406b31
cmp dword [esp + 0x24], 0x10
jb 0x406ce0
mov eax, dword [esp + 0x10]
push eax
jmp 0x406cd8
cmp dword [ebx], 2
jl 0x406b6d
cmp dword [esp + 0x24], 0x10
mov eax, dword [esp + 0x10]
jae 0x406b45
lea eax, [esp + 0x10]
push eax
push 0x430418
call fcn.004148ba
add eax, 0x40
push eax
call fcn.00414c55
add esp, 0xc
call fcn.004148ba
add eax, 0x40
push eax
call fcn.00414bf9
add esp, 4
call fcn.004066d0
cmp dword [0x437a10], 0
jne 0x406b8c
mov ecx, dword [0x437a14]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x406b99
mov edx, dword [0x437a0c]
push edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.00406800
test al, al
je 0x406bdc
mov eax, dword [0x4379f8]
push 2
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [esp + 0x24], 0x10
mov eax, dword [esp + 0x10]
jae 0x406bc3
lea eax, [esp + 0x10]
mov edx, dword [esp + 0x20]
push 0
lea ecx, [esp + 0x10]
push ecx
push edx
push eax
mov eax, dword [0x4379f8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [0x437a10], 0
jne 0x406bf4
mov ecx, dword [0x437a14]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x406c01
mov edx, dword [0x437a0c]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx]
cmp eax, 4
jne 0x406c75
mov ecx, dword [esp + 0x20]
mov eax, 0x400
cmp ecx, eax
jae 0x406c17
mov eax, ecx
cmp dword [esp + 0x24], 0x10
mov ecx, dword [esp + 0x10]
jae 0x406c26
lea ecx, [esp + 0x10]
push eax
push ecx
lea eax, [esp + 0x50]
push eax
call fcn.00412770
lea ecx, [esp + 0x54]
add esp, 0xc
push ecx
call fcn.00407620
add esp, 4
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x406c51
call fcn.00401000
cmp dword [0x437a00], 0
je 0x406c4c
lea eax, [ebx + 0xc]
push eax
lea esi, [esp + 0x30]
call fcn.004032c0
mov edx, esi
push edx
call dword [0x437a00]
add esp, 4
jmp 0x406cb8
cmp eax, 3
jne 0x406ccc
cmp dword [0x437a04], 0
lea eax, [ebx + 0xc]
lea esi, [esp + 0x2c]
push eax
je 0x406caa
call fcn.004032c0
mov ecx, esi
push ecx
call dword [0x437a04]
add esp, 4
cmp dword [esp + 0x40], 0x10
jb 0x406ccc
mov edx, dword [esp + 0x2c]
push edx
jmp 0x406cc4
call fcn.004032c0
lea ecx, [esp + 0x2c]
call fcn.004068b0
cmp dword [esp + 0x40], 0x10
jb 0x406ccc
mov eax, dword [esp + 0x2c]
push eax
call fcn.0041275a
add esp, 4
cmp dword [esp + 0x24], 0x10
jb 0x406ce0
mov ecx, dword [esp + 0x10]
push ecx
call fcn.0041275a
add esp, 4
mov edx, dword [ebx + 0xac]
push edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
mov ecx, dword [eax + 4]
lea esi, [edi + 0x50]
mov dword [ecx + esi - 0x50], 0x4302d0
lea ecx, [esi - 0x4c]
call fcn.00402200
mov edx, dword [esi - 0x50]
mov eax, dword [edx + 4]
mov dword [eax + esi - 0x50], 0x430290
push esi
mov dword [esi], 0x430250
call fcn.0041211a
mov ecx, dword [esp + 0x450]
add esp, 4
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004134fa
mov esp, ebp
pop ebp
ret 4