Function at 0x140005dc0
Capabilities:
Get file size
Print debug messages
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rdi
mov eax, 0x1ef0
call fcn.140008ef0
sub rsp, rax
mov rax, qword [0x14000f020]
xor rax, rsp
mov qword [rsp + 0x1ee0], rax
mov rax, qword [rsp + 0x1f00]
movzx eax, word [rax + 0x28]
test eax, eax
je 0x1400061ae
cmp qword [rsp + 0x1f08], 0
je 0x1400061ae
mov qword [rsp + 0x460], 0xffffffffffffffff
mov dword [rsp + 0x468], 0
lea rdi, [rsp + 0x470]
xor eax, eax
mov ecx, 0x1000
rep stosb byte [rdi], al
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x1000
lea rax, [rsp + 0x470]
mov qword [rsp + 0x20], rax
mov r9d, 0xffffffff
mov r8, qword [rsp + 0x1f08]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov qword [rsp + 0x1470], 0
lea r8, [rsp + 0x1470]
mov edx, 0x1000
lea rcx, [rsp + 0x470]
call fcn.140005470
cmp qword [rsp + 0x1470], 0
jbe 0x1400061ae
lea rdi, [rsp + 0x60]
xor eax, eax
mov ecx, 0x400
rep stosb byte [rdi], al
lea rdi, [rsp + 0x1480]
xor eax, eax
mov ecx, 0x40
rep stosb byte [rdi], al
mov r8d, 0x20
lea rdx, [rsp + 0x1480]
mov rcx, qword [rsp + 0x1f00]
call fcn.140005d40
mov rax, qword [rsp + 0x1f00]
movzx eax, word [rax + 0x230]
test eax, eax
jne 0x140005fee
xor eax, eax
mov word [rsp + 0x1ad0], ax
lea rdi, [rsp + 0x1ad2]
xor eax, eax
mov ecx, 0x3fe
rep stosb byte [rdi], al
mov r8d, 0x200
lea rdx, [rsp + 0x1ad0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor edx, edx
mov word [rsp + 0x18c0], dx
lea rdi, [rsp + 0x18c2]
xor eax, eax
mov ecx, 0x206
rep stosb byte [rdi], al
xor eax, eax
mov word [rsp + 0x14c0], ax
lea rdi, [rsp + 0x14c2]
xor eax, eax
mov ecx, 0x3fe
rep stosb byte [rdi], al
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0x104
lea r9, [rsp + 0x14c0]
mov r8d, 0x104
lea rdx, [rsp + 0x18c0]
lea rcx, [rsp + 0x1ad0]
call qword [sym.imp.MSVCR90.dll__wsplitpath_s]
mov rcx, qword [rsp + 0x1f00]
add rcx, 0x230
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x14c0]
lea r8, [rsp + 0x18c0]
mov edx, 0x200
call qword [sym.imp.MSVCR90.dll__wmakepath_s]
mov rcx, qword [rsp + 0x1f00]
add rcx, 0x28
mov r9, qword [rsp + 0x1f00]
add r9, 0x230
mov eax, dword [rsp + 0x468]
mov dword [rsp + 0x30], eax
lea rax, [rsp + 0x1480]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
lea r8, str._s_s__s__04d.csv
mov edx, 0x400
lea rcx, [rsp + 0x60]
call fcn.1400053e0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x460], rax
cmp qword [rsp + 0x460], 0xffffffffffffffff
je 0x140006199
lea rdx, [rsp + 0x1ed0]
mov rcx, qword [rsp + 0x460]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x1400060bb
mov rcx, qword [rsp + 0x460]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x460], 0xffffffffffffffff
jmp 0x1400061ae
mov rax, qword [rsp + 0x1f00]
mov eax, dword [rax + 0xc]
cmp qword [rsp + 0x1ed0], rax
jge 0x14000616c
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x460]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x140006140
mov dword [rsp + 0x1ed8], 0
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x1ed8]
mov r8d, dword [rsp + 0x1470]
lea rdx, [rsp + 0x470]
mov rcx, qword [rsp + 0x460]
call qword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x14000613e
lea rcx, [0x14000b030]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x14000614e
mov rcx, qword [rsp + 0x1f08]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov rcx, qword [rsp + 0x460]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x460], 0xffffffffffffffff
jmp 0x1400061ae
mov eax, dword [rsp + 0x468]
add eax, 1
mov dword [rsp + 0x468], eax
mov rcx, qword [rsp + 0x460]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x460], 0xffffffffffffffff
jmp 0x1400061a9
mov rcx, qword [rsp + 0x1f08]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x1400061ae
jmp 0x140005e9a
mov rcx, qword [rsp + 0x1ee0]
xor rcx, rsp
call fcn.140008440
add rsp, 0x1ef0
pop rdi
ret