Function at 0x401100
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x408004]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor esi, esi
mov dword [ebp - 0x28], edx
push esi
push esi
push esi
mov edi, ecx
mov dword [ebp - 0x3c], eax
push esi
mov dword [ebp - 0x2c], edi
mov ebx, 0x1000
mov dword [ebp - 0xc], esi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
xorps xmm0, xmm0
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x28]
sub esp, 8
movups xmmword [ebp - 0x20], xmm0
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x406870]
mulsd xmm0, qword [0x406868]
movsd qword [ebp - 0x34], xmm0
fld qword [ebp - 0x34]
fstp qword [esp]
call sub.api_ms_win_crt_math_l1_1_0.dll_ceil
add esp, 8
fstp qword [ebp - 0x34]
movsd xmm0, qword [ebp - 0x34]
call fcn.004045d0
mov dword [ebp - 0x24], eax
test eax, eax
jne 0x401196
cmp dword [ebp + 0x10], esi
mov ecx, 1
cmovne eax, ecx
mov dword [ebp - 0x24], eax
lea ecx, [edi - 9]
mov dword [ebp - 0x38], ecx
test ecx, ecx
jne 0x4011eb
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea eax, [edi - 5]
mov dword [eax], ebx
push 0xffffffffffffffff
push dword [0x408394]
mov byte [edi - 1], 0
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40120b
cmp eax, 0x80
je 0x401317
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov dword [ecx], eax
lea eax, [ecx + 4]
test eax, eax
jne 0x4011b5
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
jmp 0x4011b7
mov eax, dword [ebp - 0x24]
xor edi, edi
test eax, eax
je 0x40132a
lea ecx, [eax - 1]
mov dword [ebp - 0x30], ecx
nop
cmp edi, ecx
jne 0x401267
mov ecx, dword [ebp - 0x2c]
mov eax, 0xfff001
mul dword [ebp - 0x28]
mov ebx, dword [ebp - 0x28]
shr edx, 4
imul eax, edx, 0x1001
sub ebx, eax
lea eax, [ecx - 5]
test eax, eax
jne 0x40125b
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp - 0x2c]
jmp 0x40125d
mov dword [eax], ebx
cmp dword [ebp + 0x10], 0
je 0x401267
mov byte [ecx - 1], 1
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebx + 9]
push eax
push dword [ebp - 0x38]
push dword [0x40839c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
jne 0x4012be
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x3e5
jne 0x4012da
push 0xffffffffffffffff
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 1
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x20]
push eax
push dword [0x40839c]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov esi, eax
test esi, esi
je 0x4012d4
mov ecx, dword [ebp - 0x3c]
inc edi
mov eax, dword [ebp - 0xc]
add dword [ecx], eax
cmp edi, dword [ebp - 0x24]
jae 0x40132a
mov ecx, dword [ebp - 0x30]
jmp 0x401220
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [0x408398], 0
je 0x4012fa
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.____hChannel_thread__08X__WriteChannel:__ld_n
call fcn.004010b0
add esp, 0xc
push dword [0x408394]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x401317
push str.Release_failed1_n
call fcn.004010b0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00403830
mov esp, ebp
pop ebp
ret
push dword [0x408394]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test eax, eax
jne 0x401347
push str.Release_failed2_n
call fcn.004010b0
add esp, 4
mov ecx, dword [ebp - 8]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00403830
mov esp, ebp
pop ebp
ret