Function at 0x409640
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4f7fc2
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5370e4]
xor eax, esp
push eax
lea eax, [esp + 0x20]
mov dword fs:[0], eax
mov ebx, dword [esp + 0x30]
lea eax, [ebx + 0x3c]
push eax
mov dword [esp + 0x2c], 2
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0x18]
mov ebp, dword [eax]
mov esi, dword [ebx]
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x18], esi
lea esp, [esp]
mov edi, dword [ebx + 0x18]
mov eax, dword [ebx]
test esi, esi
je 0x40969d
cmp esi, eax
je 0x4096a2
call fcn.00429d5a
cmp ebp, edi
je 0x4097b9
test esi, esi
jne 0x4097b2
call fcn.00429d5a
cmp ebp, dword [esi + 0x18]
jne 0x4096c1
call fcn.00429d5a
mov edi, dword [ebp + 0x28]
mov ecx, dword [edi + 4]
mov edx, dword [ecx + 8]
push 0
lea eax, [esp + 0x18]
push eax
push 0
push 0
push edx
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [edi + 4]
call fcn.00409110
mov esi, dword [edi + 8]
call fcn.00409110
mov eax, dword [edi]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, dword [edi + 4]
test esi, esi
je 0x40974a
mov ecx, dword [esi + 0x28]
push ecx
call fcn.0041ef45
add esp, 4
lea ebp, [esi + 0x2c]
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebp
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov eax, dword [esi]
sub eax, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409741
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push esi
call fcn.0041ef45
add esp, 4
mov esi, dword [edi + 8]
test esi, esi
je 0x409795
mov ecx, dword [esi + 0x28]
push ecx
call fcn.0041ef45
add esp, 4
lea ebp, [esi + 0x2c]
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebp
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov eax, dword [esi]
sub eax, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40978c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push esi
call fcn.0041ef45
add esp, 4
push edi
call dword [sym.imp.ole32.dll_CoTaskMemFree]
lea esi, [esp + 0x18]
call fcn.0040b9e0
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
jmp 0x409690
mov esi, dword [esi]
jmp 0x4096b7
mov ecx, dword [ebx + 0x18]
mov edx, dword [ecx + 4]
push edx
mov ecx, ebx
call fcn.0040b030
mov eax, dword [ebx + 0x18]
mov dword [eax + 4], eax
mov eax, dword [ebx + 0x18]
mov dword [ebx + 0x1c], 0
mov dword [eax], eax
mov eax, dword [ebx + 0x18]
mov dword [eax + 8], eax
mov eax, dword [ebx + 0x6c]
mov edi, dword [eax]
mov eax, dword [ebx + 0x54]
lea esi, [ebx + 0x54]
mov dword [esp + 0x18], eax
mov edi, edi
mov ecx, dword [esp + 0x18]
mov ebp, dword [esi + 0x18]
mov eax, dword [esi]
test ecx, ecx
je 0x409801
cmp ecx, eax
je 0x409806
call fcn.00429d5a
cmp edi, ebp
je 0x4098af
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x40985e
call fcn.00429d5a
xor eax, eax
cmp edi, dword [eax + 0x18]
jne 0x409827
call fcn.00429d5a
mov ebp, dword [edi + 0x10]
mov ecx, dword [ebp]
push ecx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
lea edx, [ebp + 4]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push ebp
call dword [sym.imp.ole32.dll_CoTaskMemFree]
cmp dword [esp + 0x18], 0
jne 0x409851
call fcn.00429d5a
cmp byte [edi + 0x15], 0
je 0x409862
call fcn.00429d5a
jmp 0x4097f0
mov eax, dword [eax]
jmp 0x40981d
mov eax, dword [edi + 8]
cmp byte [eax + 0x15], 0
jne 0x40988f
mov edi, eax
mov eax, dword [edi]
cmp byte [eax + 0x15], 0
jne 0x4097f0
lea esp, [esp]
mov edi, eax
mov eax, dword [edi]
cmp byte [eax + 0x15], 0
je 0x409880
jmp 0x4097f0
mov eax, dword [edi + 4]
cmp byte [eax + 0x15], 0
jne 0x4098a8
cmp edi, dword [eax + 8]
jne 0x4098a8
mov edi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x15], 0
je 0x409898
mov edi, eax
jmp 0x4097f0
mov eax, dword [esi + 0x18]
mov ebp, dword [eax + 4]
cmp byte [ebp + 0x15], 0
mov edi, ebp
jne 0x4098de
lea ecx, [ecx]
mov ecx, dword [edi + 8]
push ecx
mov ecx, esi
call fcn.00405d00
mov edi, dword [edi]
push ebp
call fcn.0041ef45
add esp, 4
cmp byte [edi + 0x15], 0
mov ebp, edi
je 0x4098c0
mov eax, dword [esi + 0x18]
mov dword [eax + 4], eax
mov eax, dword [esi + 0x18]
mov dword [esi + 0x1c], 0
mov dword [eax], eax
mov eax, dword [esi + 0x18]
lea edi, [ebx + 0x3c]
push edi
mov dword [eax + 8], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push edi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov dword [esp + 0x14], esi
mov byte [esp + 0x28], 3
call fcn.0040b690
mov esi, dword [esi]
push esi
call fcn.0041ef45
add esp, 4
cmp dword [ebx + 0x38], 0x10
jb 0x409932
mov eax, dword [ebx + 0x24]
push eax
call fcn.0041ef45
add esp, 4
mov dword [ebx + 0x38], 0xf
mov dword [ebx + 0x34], 0
mov byte [ebx + 0x24], 0
mov esi, ebx
mov dword [esp + 0x28], 4
call fcn.0040b390
mov edx, dword [ebx]
push edx
call fcn.0041ef45
add esp, 4
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 4