Function at 0x40a948
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push rbx
mov rbp, rsp
sub rsp, 0x70
mov qword [rbp + 0x20], rcx
lea rdx, [0x004f91c7]
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_fopen
mov qword [rbp - 0x28], rax
cmp qword [rbp - 0x28], 0
jne 0x40a984
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
mov rax, qword [0x00527c60]
mov eax, dword [rax]
test eax, eax
je 0x40a9a3
mov rax, qword [0x00527c60]
mov eax, dword [rax]
cmp eax, 1
jne 0x40aa74
lea rax, [rbp - 0x40]
mov r8d, 4
lea rdx, str.gmon
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [0x00527be0]
mov rax, qword [rax]
mov rax, qword [rax + 8]
mov rax, qword [rax + 0x48]
lea rdx, [rbp - 0x40]
add rdx, 4
mov ecx, 1
call rax
mov rdx, qword [rbp - 0x28]
lea rax, [rbp - 0x40]
mov r9, rdx
mov r8d, 1
mov edx, 0x14
mov rcx, rax
call sub.msvcrt.dll_fwrite
cmp rax, 1
je 0x40aa14
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
mov eax, dword [0x0053ccc0]
and eax, 1
test eax, eax
je 0x40aa31
mov rax, qword [rbp - 0x28]
mov rdx, qword [rbp + 0x20]
mov rcx, rax
call fcn.0040c209
mov eax, dword [0x0053ccc0]
and eax, 2
test eax, eax
je 0x40aa4e
mov rax, qword [rbp - 0x28]
mov rdx, qword [rbp + 0x20]
mov rcx, rax
call fcn.00402b10
mov eax, dword [0x0053ccc0]
and eax, 4
test eax, eax
je 0x40ae00
mov rax, qword [rbp - 0x28]
mov rdx, qword [rbp + 0x20]
mov rcx, rax
call fcn.004019ce
jmp 0x40ae00
mov rax, qword [0x00527c60]
mov eax, dword [rax]
cmp eax, 2
je 0x40aa94
mov rax, qword [0x00527c60]
mov eax, dword [rax]
cmp eax, 3
jne 0x40adc1
lea rax, [rbp - 0x4e]
mov r8d, 0xc
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_memset
mov dword [rbp - 8], 0
mov rax, qword [0x00527c60]
mov eax, dword [rax]
cmp eax, 3
je 0x40aad4
call fcn.0040bbb0
mov edx, eax
mov rax, qword [0x00527cf0]
mov eax, dword [rax]
cmp edx, eax
je 0x40aafe
mov dword [rbp - 0xc], 0xc
call fcn.00409970
test eax, eax
je 0x40aaeb
cmp eax, 1
je 0x40aaf4
jmp 0x40ab26
mov dword [rbp - 8], 0x20
jmp 0x40aafc
mov dword [rbp - 8], 0x28
nop
jmp 0x40ab26
mov dword [rbp - 0xc], 0
call fcn.00409970
test eax, eax
je 0x40ab15
cmp eax, 1
je 0x40ab1e
jmp 0x40ab26
mov dword [rbp - 8], 0xc
jmp 0x40ab26
mov dword [rbp - 8], 0x14
nop
mov rax, qword [0x00527ce0]
mov rax, qword [rax]
mov rdx, qword [rax]
mov rax, qword [rbp - 0x28]
mov rcx, rax
call fcn.00409cc0
test eax, eax
jne 0x40ab86
mov rax, qword [0x00527ce0]
mov rax, qword [rax]
mov rdx, qword [rax + 8]
mov rax, qword [rbp - 0x28]
mov rcx, rax
call fcn.00409cc0
test eax, eax
jne 0x40ab86
mov rax, qword [0x00527ce0]
mov rax, qword [rax]
mov eax, dword [rax + 0x10]
lea edx, [rax + rax]
mov eax, dword [rbp - 8]
add edx, eax
mov rax, qword [rbp - 0x28]
mov rcx, rax
call fcn.00409c04
test eax, eax
je 0x40ab99
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
mov rax, qword [0x00527c60]
mov eax, dword [rax]
cmp eax, 3
je 0x40abbb
call fcn.0040bbb0
mov edx, eax
mov rax, qword [0x00527cf0]
mov eax, dword [rax]
cmp edx, eax
je 0x40abfe
mov rax, qword [rbp - 0x28]
mov edx, 0x51879
mov rcx, rax
call fcn.00409c04
test eax, eax
jne 0x40abeb
mov rax, qword [0x00527cf0]
mov eax, dword [rax]
mov edx, eax
mov rax, qword [rbp - 0x28]
mov rcx, rax
call fcn.00409c04
test eax, eax
je 0x40abfe
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
cmp dword [rbp - 0xc], 0
je 0x40ac40
mov edx, dword [rbp - 0xc]
mov rcx, qword [rbp - 0x28]
lea rax, [rbp - 0x4e]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fwrite
mov rdx, rax
mov eax, dword [rbp - 0xc]
cmp rdx, rax
je 0x40ac40
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
mov dword [rbp - 4], 0
jmp 0x40acb9
mov rax, qword [0x00527be0]
mov rax, qword [rax]
mov rax, qword [rax + 8]
mov rax, qword [rax + 0x60]
mov rdx, qword [0x00527ce0]
mov rdx, qword [rdx]
mov rdx, qword [rdx + 0x18]
mov ecx, dword [rbp - 4]
shl rcx, 2
add rdx, rcx
mov edx, dword [rdx]
movsxd rcx, edx
lea rdx, [rbp - 0x42]
call rax
mov rdx, qword [rbp - 0x28]
lea rax, [rbp - 0x42]
mov r9, rdx
mov r8d, 1
mov edx, 2
mov rcx, rax
call sub.msvcrt.dll_fwrite
cmp rax, 1
je 0x40acb5
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
add dword [rbp - 4], 1
mov rax, qword [0x00527ce0]
mov rax, qword [rax]
mov eax, dword [rax + 0x10]
cmp dword [rbp - 4], eax
jb 0x40ac49
mov rax, qword [0x00527eb0]
mov rax, qword [rax + 8]
mov qword [rbp - 0x20], rax
jmp 0x40ad9e
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x120]
mov qword [rbp - 0x18], rax
jmp 0x40ad8b
mov rax, qword [rbp - 0x18]
mov r8d, dword [rax + 0x10]
mov rax, qword [rbp - 0x18]
mov rax, qword [rax + 8]
mov rcx, qword [rax]
mov rax, qword [rbp - 0x18]
mov rax, qword [rax]
mov rdx, qword [rax]
mov rax, qword [rbp - 0x28]
mov r9d, r8d
mov r8, rcx
mov rcx, rax
call fcn.00409e6f
test eax, eax
je 0x40ad3d
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.0040bb92
mov rax, qword [0x00527c30]
mov eax, dword [rax]
and eax, 0x40
test eax, eax
je 0x40ad7f
mov rax, qword [rbp - 0x18]
mov edx, dword [rax + 0x10]
mov rax, qword [rbp - 0x18]
mov rax, qword [rax + 8]
mov rax, qword [rax]
mov ecx, eax
mov rax, qword [rbp - 0x18]
mov rax, qword [rax]
mov rax, qword [rax]
mov r9d, edx
mov r8d, ecx
mov edx, eax
lea rcx, str._dumpsum__frompc_0x_lx_selfpc_0x_lx_count__lu_n
call sub.msvcrt.dll_printf
mov rax, qword [rbp - 0x18]
mov rax, qword [rax + 0x30]
mov qword [rbp - 0x18], rax
cmp qword [rbp - 0x18], 0
jne 0x40acf7
add qword [rbp - 0x20], 0x128
mov rax, qword [0x00527eb0]
mov rax, qword [rax + 0x10]
cmp qword [rbp - 0x20], rax
jb 0x40ace3
mov rax, qword [rbp - 0x28]
mov rcx, rax
call sub.msvcrt.dll_fclose
jmp 0x40ae00
mov rax, qword [0x00527c60]
mov esi, dword [rax]
mov rax, qword [0x00527ec0]
mov rbx, qword [rax]
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x60
mov r9d, esi
mov r8, rbx
lea rdx, str._s:_dont_know_how_to_deal_with_file_format__d_n
mov rcx, rax
call sub.msvcrt.dll_fprintf
mov ecx, 1
call fcn.0040bb92
nop
add rsp, 0x70
pop rbx
pop rsi
pop rbp
ret