Function at 0x402370
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x410680
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
mov eax, dword [esp + 0x3c]
push ebx
mov ebx, ecx
push ebp
mov ecx, dword [eax + 0x10]
push edi
mov edx, dword [ebx + 0x70]
mov dword [esp + 0x20], ecx
lea ecx, [esp + 0x24]
mov dword [esp + 0x1c], edx
call fcn.0040fa78
lea ebp, [ebx + 0x84]
xor edi, edi
push ebp
mov dword [esp + 0x44], edi
mov dword [esp + 0x1c], ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebx + 0xa4]
mov byte [esp + 0x40], 1
cmp eax, edi
jne 0x4023fa
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [esp + 0x24]
mov dword [esp + 0x40], 0xffffffff
call sub.MFC42.DLL_CByteArray::CByteArray
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x2c]
mov dword fs:[0], ecx
add esp, 0x38
ret 4
cmp eax, 0x400
push esi
jle 0x402466
push 0xffffffffffffffff
push 0x400
lea ecx, [esp + 0x30]
call sub.MFC42.DLL_CByteArray::SetSize
mov esi, dword [ebx + 0xa0]
mov edi, dword [esp + 0x2c]
mov ecx, 0x100
push 0xffffffffffffffff
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebx + 0xa4]
mov edi, dword [ebx + 0xa0]
add eax, 0xfffffc00
mov ecx, eax
lea esi, [edi + 0x400]
mov edx, ecx
push eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebx + 0x9c]
call sub.MFC42.DLL_CByteArray::SetSize
mov eax, dword [ebx + 0x6c]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor edi, edi
jmp 0x402480
lea esi, [ebx + 0x9c]
lea ecx, [esp + 0x28]
push esi
call sub.MFC42.DLL_CByteArray::Copy
push 0xffffffffffffffff
push edi
mov ecx, esi
call sub.MFC42.DLL_CByteArray::SetSize
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
cmp eax, edi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], eax
mov ebp, 1
je 0x402515
cmp ebp, edi
je 0x402515
mov esi, dword [esp + 0x4c]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x10]
push esi
push edx
mov edx, dword [ebx + 0x34]
push eax
push ecx
push edx
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4024f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x4024f7
push 0xffffffffffffffff
lea eax, [esp + 0x24]
push edi
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
sub eax, edi
je 0x4024f7
dec eax
je 0x402561
sub eax, 0x101
xor ebp, ebp
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
sub ecx, eax
add edx, eax
cmp ecx, edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], edx
jne 0x4024a4
lea esi, [ebx + 0x84]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebx + 0xa4], edi
jne 0x402534
mov edx, dword [ebx + 0x74]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [esp + 0x28]
mov dword [esp + 0x44], 0xffffffff
call sub.MFC42.DLL_CByteArray::CByteArray
mov ecx, dword [esp + 0x3c]
pop esi
pop edi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x38
ret 4
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebx + 0x34]
cmp eax, 0xffffffff
je 0x4024f7
lea ecx, [esp + 0x10]
push edi
push ecx
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
jmp 0x4024f9