Function at 0x407e30
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
lea rdx, [0x004ca1e2]
mov qword [rsp + 0xa0], rcx
call sub.msvcrt.dll_fopen
test rax, rax
mov rbx, rax
je 0x40801d
mov rdi, qword [0x00506070]
mov esi, dword [rdi]
cmp esi, 1
jbe 0x408100
lea eax, [rsi - 2]
cmp eax, 1
ja 0x4081ca
cmp esi, 3
mov dword [rsp + 0x2c], 0
mov qword [rsp + 0x24], 0
je 0x407ea8
call fcn.00408210
mov rdx, qword [0x00506100]
cmp eax, dword [rdx]
je 0x408173
call fcn.00407290
mov esi, 0xc
mov r12d, 0x20
test eax, eax
je 0x407ece
cmp eax, 1
mov r12d, 0x28
mov eax, 0
cmovne r12d, eax
mov rbp, qword [0x005060f0]
mov rcx, rbx
mov rax, qword [rbp]
mov rdx, qword [rax]
call fcn.004074f0
test eax, eax
jne 0x40801d
mov rax, qword [rbp]
mov rcx, rbx
mov rdx, qword [rax + 8]
call fcn.004074f0
test eax, eax
jne 0x40801d
mov rax, qword [rbp]
mov rcx, rbx
mov eax, dword [rax + 0x10]
lea edx, [r12 + rax*2]
call fcn.004074a0
test eax, eax
jne 0x40801d
cmp dword [rdi], 3
je 0x407f34
call fcn.00408210
mov rdx, qword [0x00506100]
cmp eax, dword [rdx]
je 0x407f62
mov edx, 0x51879
mov rcx, rbx
call fcn.004074a0
test eax, eax
jne 0x40801d
mov rax, qword [0x00506100]
mov rcx, rbx
mov edx, dword [rax]
call fcn.004074a0
test eax, eax
jne 0x40801d
test esi, esi
jne 0x4080d3
mov rdx, qword [rbp]
mov eax, dword [rdx + 0x10]
test eax, eax
je 0x407fc3
mov r12, qword [0x00505fb0]
lea rdi, [rsp + 0x22]
xor esi, esi
mov rdx, qword [rdx + 0x18]
mov eax, esi
movsxd rcx, dword [rdx + rax*4]
mov rdx, rdi
mov rax, qword [r12]
mov rax, qword [rax + 8]
call qword [rax + 0x60]
mov r9, rbx
mov r8d, 1
mov rcx, rdi
mov edx, 2
call sub.msvcrt.dll_fwrite
cmp rax, 1
jne 0x40801d
mov rdx, qword [rbp]
add esi, 1
cmp dword [rdx + 0x10], esi
ja 0x407f83
mov r14, qword [0x005062c0]
mov r12, qword [r14 + 8]
cmp r12, qword [r14 + 0x10]
jae 0x40807f
mov rbp, qword [0x00506000]
lea r13, str._dumpsum__frompc_0x_lx_selfpc_0x_lx_count__lu_n
nop word cs:[rax + rax]
mov r15, qword [r12 + 0x120]
test r15, r15
je 0x40806e
nop dword [rax]
mov rax, qword [r15 + 8]
mov rcx, rbx
mov edi, dword [r15 + 0x10]
mov rsi, qword [rax]
mov rax, qword [r15]
mov rdx, qword [rax]
call fcn.004074f0
test eax, eax
je 0x408034
mov rcx, qword [rsp + 0xa0]
call sub.msvcrt.dll_perror
mov ecx, 1
call fcn.00408200
mov rdx, rsi
mov rcx, rbx
call fcn.004074f0
test eax, eax
jne 0x40801d
call fcn.00407290
test eax, eax
je 0x4080c0
cmp eax, 1
jne 0x40805f
mov edx, edi
mov rcx, rbx
call fcn.00407320
test eax, eax
jne 0x40801d
test byte [rbp], 0x40
jne 0x4080a0
mov r15, qword [r15 + 0x30]
test r15, r15
jne 0x408000
add r12, 0x128
cmp qword [r14 + 0x10], r12
ja 0x407ff0
mov rcx, rbx
call sub.msvcrt.dll_fclose
nop
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [r15 + 8]
mov rcx, r13
mov rdx, qword [r15]
mov r9d, dword [r15 + 0x10]
mov r8d, dword [rax]
mov rdx, qword [rdx]
call sub.msvcrt.dll_printf
jmp 0x408065
mov edx, edi
mov rcx, rbx
call fcn.004074a0
test eax, eax
je 0x40805f
jmp 0x40801d
lea rcx, [rsp + 0x24]
mov r9, rbx
mov r8, rsi
mov edx, 1
call sub.msvcrt.dll_fwrite
cmp rsi, rax
je 0x407f6a
jmp 0x40801d
mov rax, qword [0x00505fb0]
lea rsi, [rsp + 0x30]
mov ecx, 1
mov dword [rsp + 0x30], 0x6e6f6d67
lea rdx, [rsp + 0x34]
mov rax, qword [rax]
mov rax, qword [rax + 8]
call qword [rax + 0x48]
mov r9, rbx
mov r8d, 1
mov rcx, rsi
mov edx, 0x14
call sub.msvcrt.dll_fwrite
cmp rax, 1
jne 0x40801d
mov eax, dword [0x00513cc4]
test al, 1
jne 0x4081b2
test al, 2
jne 0x40819a
test al, 4
je 0x408088
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
call fcn.00401c20
jmp 0x408088
call fcn.00407290
xor esi, esi
mov r12d, 0xc
test eax, eax
je 0x407ece
cmp eax, 1
mov r12d, 0x14
cmovne r12d, esi
jmp 0x407ece
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
call fcn.00402560
mov eax, dword [0x00513cc4]
jmp 0x408156
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
call fcn.00408280
mov eax, dword [0x00513cc4]
jmp 0x408152
mov rax, qword [0x005062d0]
mov ecx, 2
mov rbx, qword [rax]
call qword [fcn.004c1900]
lea rdx, str._s:_dont_know_how_to_deal_with_file_format__d_n
mov r9d, esi
mov rcx, rax
mov r8, rbx
call sub.msvcrt.dll_fprintf
mov ecx, 1
call fcn.00408200
nop
nop