Function at 0x415420
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
mov rsi, rcx
mov rcx, qword [rcx + 0xa0]
mov rdi, r8
mov r14d, r9d
mov rax, rcx
mov ebp, r14d
sub rax, rdx
cmp rbp, rax
jle 0x41546a
test rax, rax
jle 0x415480
sub r14d, eax
add rdi, rax
mov rdx, rcx
mov rax, rcx
mov ebp, r14d
sub rax, rdx
cmp rbp, rax
jg 0x41544e
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r13, qword [rsi + 0xa8]
mov r12, r13
sub r12, rdx
cmp rbp, r12
jle 0x4154c0
mov r8, rdi
mov rcx, rsi
mov r9d, r12d
call fcn.00415420
sub r14d, r12d
add rdi, r12
mov rdx, r13
mov rcx, qword [rsi + 0xa0]
jmp 0x415440
lea rax, [rsi + 0x50]
test r14d, r14d
mov qword [rsp + 0x30], rax
je 0x415580
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x38], rax
jmp 0x4154e9
test r14d, r14d
je 0x415580
mov r11, qword [rsi + 0x70]
mov rdx, rdi
mov r15d, dword [rsi + 0x7c]
mov ebx, dword [rsi + 0x78]
and r15d, r11d
sub ebx, r15d
mov ecx, r15d
cmp ebx, r14d
cmovg ebx, r14d
add rcx, qword [rsi + 0x68]
mov r13d, ebx
sub r14d, ebx
add ebx, r15d
mov r8, r13
add rdi, r13
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsi + 0x70]
add rdx, r13
cmp ebx, dword [rsi + 0x78]
mov qword [rsi + 0x70], rdx
jne 0x4154e0
mov r13, qword [rsi + 0x68]
mov rcx, qword [rsp + 0x30]
call fcn.004153c0
mov rcx, qword [rsi + 0x58]
mov r8d, ebx
mov rdx, r13
mov qword [rsp + 0x20], 0
mov r9, qword [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4155bc
cmp ebx, dword [rsp + 0x4c]
jne 0x4155bc
add qword [rsi + 0x60], rbx
test r14d, r14d
jne 0x4154e9
nop dword [rax]
nop word cs:[rax + rax]
add qword [rsi + 0xb0], rbp
cmp rbp, r12
jne 0x41546a
mov rax, qword [rsi + 0x98]
mov rdx, qword [rax]
add rax, 0x18
mov qword [rsi + 0xa0], rdx
mov rdx, qword [rax - 0x10]
mov qword [rsi + 0x98], rax
mov qword [rsi + 0xa8], rdx
jmp 0x41546a
call fcn.00428990
nop
nop dword [rax]
nop word cs:[rax + rax]
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
test r8d, r8d
mov rbx, rcx
mov rdi, rdx
mov dword [rsp + 0xb0], r8d
je 0x415799
mov rax, qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rdx, qword [rcx + 0xc0]
mov qword [rsp + 0x38], rax
mov r10, qword [rbx + 0xd0]
mov ebp, dword [rsp + 0xb0]
cmp r10, rdx
jbe 0x415890
sub r10, rdx
cmp r10, rbp
cmovg r10, rbp
test r10d, r10d
mov r12d, r10d
je 0x415740
mov edx, dword [rbx + 0x10218]
lea rbp, [rbx + 0x210]
mov rsi, rdi
mov r13d, r10d
jmp 0x41568c
mov r14d, 0x10000
sub r14d, edx
add rdx, rbp
cmp r13d, r14d
mov rcx, rsi
cmovle r14d, r13d
mov r15d, r14d
mov r8, r15
add rsi, r15
call sub.msvcrt.dll_memcpy
mov edx, r14d
add edx, dword [rbx + 0x10218]
sub r13d, r14d
mov dword [rbx + 0x10218], edx
je 0x415883
cmp edx, 0x10000
jne 0x415650
mov rcx, qword [rbx + 0xe8]
mov r14d, 0x10000
mov rdx, rbp
cmp qword [rbx + 0x10210], 0x10000
cmovle r14, qword [rbx + 0x10210]
mov rax, qword [rcx]
mov r8d, r14d
mov r14d, r14d
call qword [rax + 0x10]
mov rdx, rbp
mov dword [rbx + 0x10218], 0
sub qword [rbx + 0x10210], r14
mov r14d, 0x10000
jmp 0x41565c
mov rax, qword [rbx + 0x90]
mov rdx, qword [rax]
add rax, 0x1c
mov qword [rbx + 0xd0], rdx
mov rdx, qword [rax - 0x14]
mov qword [rbx + 0xd8], rdx
mov rdx, qword [rax - 0xc]
mov qword [rbx + 0xc8], rdx
mov edx, dword [rax - 4]
mov qword [rbx + 0x90], rax
mov dword [rbx + 0xe0], edx
mov rdx, qword [rbx + 0xc0]
nop dword [rax]
nop word cs:[rax + rax]
mov rcx, qword [rbx + 0xa0]
mov r13d, r12d
mov rbp, rdi
mov rax, rcx
mov r15d, r13d
sub rax, rdx
cmp rax, r15
jge 0x415777
test rax, rax
jle 0x4157b0
sub r13d, eax
add rbp, rax
mov rdx, rcx
mov rax, rcx
mov r15d, r13d
sub rax, rdx
cmp rax, r15
jl 0x41575b
mov edx, r12d
add rdi, rdx
add rdx, qword [rbx + 0xc0]
sub dword [rsp + 0xb0], r12d
mov qword [rbx + 0xc0], rdx
jne 0x41560a
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rsi, qword [rbx + 0xa8]
mov r14, rsi
sub r14, rdx
cmp r15, r14
jle 0x415990
mov r8, rbp
mov rcx, rbx
mov r9d, r14d
call fcn.00415420
sub r13d, r14d
add rbp, r14
mov rdx, rsi
mov rcx, qword [rbx + 0xa0]
jmp 0x41574d
mov r15d, dword [rsp + 0x30]
mov r11, rdi
test r15d, r15d
je 0x415832
nop dword [rax]
mov edx, r13d
mov esi, dword [rbx + 0x78]
mov rcx, r11
and edx, dword [rbx + 0x7c]
sub esi, edx
cmp esi, r15d
cmovg esi, r15d
add rdx, qword [rbx + 0x68]
mov r12d, esi
mov r8, r12
add r13, r12
call sub.msvcrt.dll_memcpy
mov r11, rax
add r11, r12
sub r15d, esi
jne 0x415800
cmp ebp, dword [rsp + 0x30]
mov r12d, ebp
jbe 0x415862
mov rcx, qword [rsp + 0x30]
sub ebp, 1
xor eax, eax
sub ebp, ecx
mov ecx, ecx
lea rdx, [rbp + 1]
add rcx, rdi
movzx r8d, byte [rdi + rax]
mov byte [rcx + rax], r8b
add rax, 1
cmp rax, rdx
jne 0x415850
mov rax, qword [rbx + 0xc8]
cmp r14, rax
je 0x4156f0
add qword [rbx + 0xd8], r14
sub rax, r14
mov qword [rbx + 0xc8], rax
mov rdx, qword [rbx + 0xc0]
jmp 0x415740
mov esi, dword [rbx + 0xe0]
mov eax, dword [rbx + 0x88]
cmp qword [rbx + 0xc8], rbp
cmovle rbp, qword [rbx + 0xc8]
cmp esi, eax
jb 0x4158cc
lea edx, [rsi + 1]
add eax, eax
lea rcx, [rbx + 0x80]
cmp eax, edx
cmovge edx, eax
call fcn.0041fb00
mov rdx, qword [rbx + 0xc0]
mov r12, qword [rbx + 0xd8]
lea rcx, [rsi + rsi*2]
mov r14d, ebp
mov rax, qword [rbx + 0x80]
mov r15, qword [rbx + 0x70]
sub rdx, r12
cmp rdx, r14
mov rsi, rdx
cmovg rsi, r14
add r12, qword [rax + rcx*8 + 0x10]
sub r12, qword [rax + rcx*8]
mov qword [rsp + 0x30], rsi
cmp r12, r15
mov r13, r12
jge 0x4157f0
mov ecx, esi
sub r15, r12
cmp rcx, r15
cmovle r15, rcx
cmp r12, qword [rbx + 0x60]
mov rcx, qword [rbx + 0x58]
je 0x415943
mov qword [rbx + 0x60], r12
lea r8, [rbx + 0x64]
xor r9d, r9d
mov edx, r12d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x415ace
mov rcx, qword [rbx + 0x58]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x4c]
mov r8d, r15d
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x41596c
cmp r15d, dword [rsp + 0x4c]
je 0x415ab0
mov rax, qword [0x0042bff0]
lea rcx, [0x0042a29c]
xor r8d, r8d
mov edx, dword [rax]
call sub.msvcrt.dll_printf
mov ecx, 1
call sub.msvcrt.dll_exit
nop
test r13d, r13d
je 0x415a6c
mov qword [rsp + 0xa8], rdi
mov edi, r13d
mov r13, rbp
mov dword [rsp + 0x30], r12d
jmp 0x4159b8
test edi, edi
je 0x415a5f
mov r9, qword [rbx + 0x70]
mov rdx, r13
mov r12d, dword [rbx + 0x7c]
mov esi, dword [rbx + 0x78]
and r12d, r9d
sub esi, r12d
mov ecx, r12d
cmp esi, edi
cmovg esi, edi
add rcx, qword [rbx + 0x68]
mov ebp, esi
sub edi, esi
add esi, r12d
mov r8, rbp
add r13, rbp
call sub.msvcrt.dll_memcpy
mov rdx, qword [rbx + 0x70]
add rdx, rbp
cmp esi, dword [rbx + 0x78]
mov qword [rbx + 0x70], rdx
jne 0x4159b0
cmp rdx, qword [rbx + 0x60]
mov rbp, qword [rbx + 0x68]
mov rcx, qword [rbx + 0x58]
je 0x415a27
mov qword [rbx + 0x60], rdx
lea r8, [rbx + 0x64]
xor r9d, r9d
mov rax, qword [rsp + 0x38]
call rax
cmp eax, 0xffffffff
je 0x415b00
mov rcx, qword [rbx + 0x58]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x4c]
mov r8d, esi
mov rdx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x415b10
cmp esi, dword [rsp + 0x4c]
jne 0x415b10
add qword [rbx + 0x60], rsi
test edi, edi
jne 0x4159b8
mov r12d, dword [rsp + 0x30]
mov rdi, qword [rsp + 0xa8]
add qword [rbx + 0xb0], r15
cmp r15, r14
jne 0x415777
mov rax, qword [rbx + 0x98]
mov rdx, qword [rax]
add rax, 0x18
mov qword [rbx + 0xa0], rdx
mov rdx, qword [rax - 0x10]
mov qword [rbx + 0x98], rax
mov qword [rbx + 0xa8], rdx
jmp 0x415777
lea r13, [r12 + r15]
mov eax, r15d
add qword [rbx + 0x60], rax
lea r11, [rdi + r15]
mov eax, dword [rsp + 0x30]
sub eax, r15d
mov r15d, eax
jmp 0x4157f8
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x41593f
mov rax, qword [0x0042bff0]
lea rcx, str._r_c_r__ERROR__Seek_failed__n
xor r8d, r8d
mov edx, dword [rax]
call sub.msvcrt.dll_printf
mov ecx, 1
call sub.msvcrt.dll_exit
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x415a23
jmp 0x415adc
call fcn.00428990
nop
nop word cs:[rax + rax]