Function at 0x40d8f8
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbp
push rdi
push rsi
push rbx
mov eax, 0x2198
call fcn.004d8d40
sub rsp, rax
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x2140], rcx
mov dword [rbp + 0x2148], edx
mov qword [rbp + 0x2150], r8
mov qword [rbp + 0x2158], r9
mov rax, qword [0x0053cd30]
mov qword [rbp + 0x20e8], rax
mov rax, qword [rbp + 0x2140]
mov rdx, qword [rax + 8]
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_strcpy
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
movzx eax, byte [rax]
cmp al, 0x2f
je 0x40d99d
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
movzx eax, byte [rax]
cmp al, 0x5c
je 0x40d99d
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
movzx eax, byte [rax]
test al, al
je 0x40d9a8
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
add rax, 1
movzx eax, byte [rax]
cmp al, 0x3a
jne 0x40d9a8
mov qword [rbp + 0x20e8], 0
mov qword [rbp + 0x20f8], 0
mov rax, qword [0x00527c30]
mov eax, dword [rax]
and eax, 0x2000
test eax, eax
je 0x40d9e6
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
lea rdx, [rbp - 0x60]
mov r8, rdx
mov rdx, rax
lea rcx, str._annotate_source_:_looking_for__s__trying__s_n
call sub.msvcrt.dll_printf
lea rax, [rbp - 0x60]
lea rdx, [0x004fa0ae]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov qword [rbp + 0x20d8], rax
cmp qword [rbp + 0x20d8], 0
jne 0x40dc4e
cmp qword [rbp + 0x20e8], 0
jne 0x40db02
cmp qword [rbp + 0x20f8], 0
jne 0x40db02
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
mov edx, 0x2f
mov rcx, rax
call sub.msvcrt.dll_strrchr
mov qword [rbp + 0x20f8], rax
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
mov edx, 0x5c
mov rcx, rax
call sub.msvcrt.dll_strrchr
mov qword [rbp + 0x20d0], rax
cmp qword [rbp + 0x20f8], 0
je 0x40da8c
cmp qword [rbp + 0x20d0], 0
je 0x40da9a
mov rax, qword [rbp + 0x20d0]
cmp rax, qword [rbp + 0x20f8]
jbe 0x40da9a
mov rax, qword [rbp + 0x20d0]
mov qword [rbp + 0x20f8], rax
cmp qword [rbp + 0x20f8], 0
jne 0x40dae2
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
movzx eax, byte [rax]
test al, al
je 0x40dae2
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
add rax, 1
movzx eax, byte [rax]
cmp al, 0x3a
jne 0x40dae2
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
add rax, 1
mov qword [rbp + 0x20f8], rax
cmp qword [rbp + 0x20f8], 0
je 0x40db02
add qword [rbp + 0x20f8], 1
mov rax, qword [0x0053cd30]
mov qword [rbp + 0x20e8], rax
cmp qword [rbp + 0x20e8], 0
je 0x40dbe8
mov rax, qword [rbp + 0x20e8]
lea rdx, [rax + 8]
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_strcpy
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_strlen
sub rax, 1
movzx eax, byte [rbp + rax - 0x60]
cmp al, 0x3a
jne 0x40db6e
lea rax, [rbp - 0x60]
mov rcx, 0xffffffffffffffff
mov rdx, rax
mov eax, 0
mov rdi, rdx
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea rdx, [rax - 1]
lea rax, [rbp - 0x60]
add rax, rdx
mov word [rax], 0x2e
lea rax, [rbp - 0x60]
mov rcx, 0xffffffffffffffff
mov rdx, rax
mov eax, 0
mov rdi, rdx
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea rdx, [rax - 1]
lea rax, [rbp - 0x60]
add rax, rdx
mov word [rax], 0x2f
cmp qword [rbp + 0x20f8], 0
je 0x40dbbb
mov rdx, qword [rbp + 0x20f8]
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_strcat
jmp 0x40dbd2
mov rax, qword [rbp + 0x2140]
mov rdx, qword [rax + 8]
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_strcat
mov rax, qword [rbp + 0x20e8]
mov rax, qword [rax]
mov qword [rbp + 0x20e8], rax
jmp 0x40d9b3
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
cmp eax, 2
jne 0x40dc31
mov rax, qword [rbp + 0x2140]
mov rsi, qword [rax + 8]
mov rax, qword [0x00527ec0]
mov rbx, qword [rax]
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x60
mov r9, rsi
mov r8, rbx
lea rdx, str._s:_could_not_locate___s_n
mov rcx, rax
call sub.msvcrt.dll_fprintf
jmp 0x40dc44
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
mov rcx, rax
call sub.msvcrt.dll_perror
mov eax, 0
jmp 0x40dfb4
nop
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x30
mov qword [rbp + 0x20f0], rax
mov eax, dword [0x0053cd20]
test eax, eax
je 0x40ddcf
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
mov edx, 0x2f
mov rcx, rax
call sub.msvcrt.dll_strrchr
mov qword [rbp + 0x20e0], rax
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
mov edx, 0x5c
mov rcx, rax
call sub.msvcrt.dll_strrchr
mov qword [rbp + 0x20c8], rax
cmp qword [rbp + 0x20e0], 0
je 0x40dcd3
cmp qword [rbp + 0x20c8], 0
je 0x40dce1
mov rax, qword [rbp + 0x20c8]
cmp rax, qword [rbp + 0x20e0]
jbe 0x40dce1
mov rax, qword [rbp + 0x20c8]
mov qword [rbp + 0x20e0], rax
cmp qword [rbp + 0x20e0], 0
jne 0x40dd29
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
movzx eax, byte [rax]
test al, al
je 0x40dd29
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
add rax, 1
movzx eax, byte [rax]
cmp al, 0x3a
jne 0x40dd29
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
add rax, 1
mov qword [rbp + 0x20e0], rax
cmp qword [rbp + 0x20e0], 0
je 0x40dd3d
add qword [rbp + 0x20e0], 1
jmp 0x40dd4f
mov rax, qword [rbp + 0x2140]
mov rax, qword [rax + 8]
mov qword [rbp + 0x20e0], rax
mov rdx, qword [rbp + 0x20e0]
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_strcpy
lea rax, [rbp - 0x60]
mov rcx, 0xffffffffffffffff
mov rdx, rax
mov eax, 0
mov rdi, rdx
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea rdx, [rax - 1]
lea rax, [rbp - 0x60]
add rax, rdx
mov dword [rax], 0x6e6e612d
mov byte [rax + 4], 0
lea rax, [rbp - 0x60]
lea rdx, [0x004fa0cc]
mov rcx, rax
call sub.msvcrt.dll_fopen
mov qword [rbp + 0x20f0], rax
cmp qword [rbp + 0x20f0], 0
jne 0x40ddcf
lea rax, [rbp - 0x60]
mov rcx, rax
call sub.msvcrt.dll_perror
mov eax, 0
jmp 0x40dfb4
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
add rax, 0x30
cmp qword [rbp + 0x20f0], rax
jne 0x40de74
mov eax, dword [0x004da640]
test eax, eax
je 0x40ddff
mov dword [0x004da640], 0
jmp 0x40de13
mov rax, qword [rbp + 0x20f0]
mov rdx, rax
mov ecx, 0xa
call sub.msvcrt.dll_fputc
mov rax, qword [0x00527c70]
mov eax, dword [rax]
test eax, eax
je 0x40de2f
mov rax, qword [0x00527c70]
mov dword [rax], 0
jmp 0x40de50
mov rax, qword [rbp + 0x20f0]
mov r9, rax
mov r8d, 2
mov edx, 1
lea rcx, [0x004fa0ce]
call sub.msvcrt.dll_fwrite
mov rax, qword [rbp + 0x2140]
mov rdx, qword [rax + 8]
mov rax, qword [rbp + 0x20f0]
mov r8, rdx
lea rdx, str._File__s:_n
mov rcx, rax
call sub.msvcrt.dll_fprintf
mov eax, dword [rbp + 0x2148]
add eax, 1
mov eax, eax
mov rcx, rax
call fcn.004d75e6
mov qword [rbp + 0x20c0], rax
mov dword [rbp + 0x2108], 1
mov dword [rbp + 0x2104], 1
jmp 0x40df58
mov dword [rbp + 0x210c], 0
jmp 0x40df46
cmp dword [rbp + 0x2104], 0
je 0x40df00
mov r9, qword [rbp + 0x2158]
mov r8d, dword [rbp + 0x2108]
mov edx, dword [rbp + 0x2148]
mov rcx, qword [rbp + 0x20c0]
mov rax, qword [rbp + 0x2150]
call rax
mov rdx, qword [rbp + 0x20f0]
mov rax, qword [rbp + 0x20c0]
mov rcx, rax
call sub.msvcrt.dll_fputs
add dword [rbp + 0x2108], 1
mov eax, dword [rbp + 0x210c]
cdqe
movzx eax, byte [rbp + rax + 0xb0]
cmp al, 0xa
sete al
movzx eax, al
mov dword [rbp + 0x2104], eax
mov eax, dword [rbp + 0x210c]
cdqe
movzx eax, byte [rbp + rax + 0xb0]
movsx eax, al
mov rdx, qword [rbp + 0x20f0]
mov ecx, eax
call sub.msvcrt.dll_fputc
add dword [rbp + 0x210c], 1
mov eax, dword [rbp + 0x210c]
cmp eax, dword [rbp + 0x20bc]
jl 0x40deb6
mov rdx, qword [rbp + 0x20d8]
lea rax, [rbp + 0xb0]
mov r9, rdx
mov r8d, 0x2000
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fread
mov dword [rbp + 0x20bc], eax
cmp dword [rbp + 0x20bc], 0
jg 0x40dea7
mov rax, qword [rbp + 0x20c0]
mov rcx, rax
call sub.msvcrt.dll_free
mov rax, qword [rbp + 0x20d8]
mov rcx, rax
call sub.msvcrt.dll_fclose
mov rax, qword [rbp + 0x20f0]
add rsp, 0x2198
pop rbx
pop rsi
pop rdi
pop rbp
ret