Function at 0x40a930
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x18], r8
mov dword [rsp + 0x10], edx
mov qword [rsp + 8], rcx
sub rsp, 0x68
mov dword [rsp + 0x34], 0
mov eax, dword [rsp + 0x78]
cmp dword [rsp + 0x34], eax
je 0x40aad0
movsxd rax, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x70]
movsx eax, byte [rcx + rax]
cmp eax, 0xa
je 0x40a97a
mov eax, dword [rsp + 0x34]
inc eax
mov dword [rsp + 0x34], eax
jmp 0x40aacb
cmp dword [rsp + 0x34], 0
jle 0x40aa72
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x50], rax
mov eax, dword [rsp + 0x34]
mov dword [rsp + 0x3c], eax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, dword [rsp + 0x3c]
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x40a9d6
call qword [sym.imp.kernel32.dll_GetLastError]
cmp eax, 8
jne 0x40a9d6
mov eax, dword [rsp + 0x3c]
cmp dword [rsp + 0x30], eax
jne 0x40a9db
jmp 0x40aa72
cmp dword [rsp + 0x30], 0
jne 0x40aa43
mov eax, dword [rsp + 0x3c]
mov dword [rsp + 0x44], eax
mov eax, dword [rsp + 0x44]
sar eax, 1
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x44], 0
jle 0x40aa37
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, dword [rsp + 0x44]
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x40aa37
call qword [sym.imp.kernel32.dll_GetLastError]
cmp eax, 8
jne 0x40aa37
cmp dword [rsp + 0x30], 0
je 0x40a9ea
cmp dword [rsp + 0x30], 0
jne 0x40aa43
jmp 0x40abc5
mov eax, dword [rsp + 0x30]
mov ecx, dword [rsp + 0x3c]
sub ecx, eax
mov eax, ecx
mov dword [rsp + 0x3c], eax
mov eax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x50]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x50], rax
cmp dword [rsp + 0x3c], 0
jg 0x40a997
mov byte [rsp + 0x38], 0xd
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, 1
lea rdx, [rsp + 0x38]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.kernel32.dll_WriteFile]
movsxd rax, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x70]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x34]
mov ecx, dword [rsp + 0x78]
sub ecx, eax
mov eax, ecx
mov dword [rsp + 0x78], eax
mov dword [rsp + 0x34], 1
jmp 0x40a94a
cmp dword [rsp + 0x78], 0
jbe 0x40abc5
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x58], rax
mov eax, dword [rsp + 0x78]
mov dword [rsp + 0x40], eax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, dword [rsp + 0x40]
mov rdx, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x40ab2c
call qword [sym.imp.kernel32.dll_GetLastError]
cmp eax, 8
jne 0x40ab2c
mov eax, dword [rsp + 0x40]
cmp dword [rsp + 0x30], eax
jne 0x40ab31
jmp 0x40abc5
cmp dword [rsp + 0x30], 0
jne 0x40ab96
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x48], eax
mov eax, dword [rsp + 0x48]
sar eax, 1
mov dword [rsp + 0x48], eax
cmp dword [rsp + 0x48], 0
jle 0x40ab8d
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, dword [rsp + 0x48]
mov rdx, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x40ab8d
call qword [sym.imp.kernel32.dll_GetLastError]
cmp eax, 8
jne 0x40ab8d
cmp dword [rsp + 0x30], 0
je 0x40ab40
cmp dword [rsp + 0x30], 0
jne 0x40ab96
jmp 0x40abc5
mov eax, dword [rsp + 0x30]
mov ecx, dword [rsp + 0x40]
sub ecx, eax
mov eax, ecx
mov dword [rsp + 0x40], eax
mov eax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x58]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x58], rax
cmp dword [rsp + 0x40], 0
jg 0x40aaed
add rsp, 0x68
ret