Function at 0x40c880
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 4], ecx
mov eax, dword [ebp - 4]
cmp dword [eax + 0x38], 0
je 0x40c8ac
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 4]
call dword [sym.imp.MSVCP140.dll_protected_virtual:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::xsputn_char_const___long_long___int64__]
jmp 0x40ca32
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x20]
cmp dword [ecx], 0
je 0x40c8d0
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x30]
mov ecx, dword [eax]
mov dword [ebp - 0xc], ecx
jmp 0x40c8d7
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0xc]
cdq
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x20], eax
cmp dword [ebp + 0x10], 0
jl 0x40c9e3
jg 0x40c903
cmp dword [ebp + 0xc], 0
jbe 0x40c9e3
cmp dword [ebp - 0x20], 0
jl 0x40c9e3
jg 0x40c919
cmp dword [ebp - 0x24], 0
jbe 0x40c9e3
mov ecx, dword [ebp + 0x10]
cmp ecx, dword [ebp - 0x20]
jg 0x40c937
jl 0x40c92b
mov edx, dword [ebp + 0xc]
cmp edx, dword [ebp - 0x24]
jae 0x40c937
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x20]
mov ecx, dword [eax]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x24]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
call fcn.00401df0
movzx ecx, al
test ecx, ecx
je 0x40c988
mov dword [ebp - 8], 0
jmp 0x40c96c
mov edx, dword [ebp - 8]
add edx, 1
mov dword [ebp - 8], edx
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x10]
je 0x40c986
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp - 8]
mov edx, dword [ebp + 8]
add edx, dword [ebp - 8]
mov al, byte [edx]
mov byte [ecx], al
jmp 0x40c963
jmp 0x40c99c
mov ecx, dword [ebp - 0x10]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x14]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0x24]
add ecx, dword [ebp + 8]
mov dword [ebp + 8], ecx
mov edx, dword [ebp + 0xc]
sub edx, dword [ebp - 0x24]
mov eax, dword [ebp + 0x10]
sbb eax, dword [ebp - 0x20]
mov dword [ebp + 0xc], edx
mov dword [ebp + 0x10], eax
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x30]
mov ecx, dword [eax]
sub ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x30]
mov dword [eax], ecx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x20]
mov eax, dword [edx]
add eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x20]
mov dword [edx], eax
cmp dword [ebp + 0x10], 0
jl 0x40ca26
jg 0x40c9f1
cmp dword [ebp + 0xc], 0
jbe 0x40ca26
mov eax, dword [ebp - 4]
cmp dword [eax + 0x4c], 0
je 0x40ca26
mov ecx, dword [ebp - 4]
mov edx, dword [ecx + 0x4c]
push edx
mov eax, dword [ebp + 0xc]
push eax
push 1
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
xor edx, edx
mov ecx, dword [ebp + 0xc]
sub ecx, eax
mov eax, dword [ebp + 0x10]
sbb eax, edx
mov dword [ebp + 0xc], ecx
mov dword [ebp + 0x10], eax
mov eax, dword [ebp - 0x34]
sub eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x30]
sbb edx, dword [ebp + 0x10]
mov esp, ebp
pop ebp
ret 0xc