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

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x370
mov qword [rsp + 0x60], 0xfffffffffffffffe
mov rax, qword [0x140078790]
xor rax, rsp
mov qword [rsp + 0x360], rax
mov r12, r9
mov r13d, r8d
mov r14, rdx
mov rsi, rcx
xor r8d, r8d
lea rdx, str.AddCleanupLine
lea rcx, [rsp + 0xa0]
call fcn.14002de00
nop
xor edi, edi
test rsi, rsi
je 0x140006652
cmp word [rsi], di
je 0x140006652
test r14, r14
je 0x140006648
cmp word [r14], di
je 0x140006648
xor edx, edx
mov r8d, 0x20a
lea rcx, [rsp + 0x150]
call fcn.140034b00
mov dword [rsp + 0x50], 0x104
mov r8d, 0x100
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x150]
call fcn.140009a7c
test eax, eax
jns 0x140006219
mov ecx, eax
call fcn.140032390
lea rdx, str.Cleanup.txt
lea rcx, [rsp + 0x150]
call qword [sym.imp.SHLWAPI.dll_PathAppendW]
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0000000
lea rcx, [rsp + 0x150]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
mov qword [rsp + 0x48], rax
cmp rax, 0xffffffffffffffff
jne 0x140006291
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, 0x1fff0000
je 0x14000627e
mov ecx, eax
call fcn.140032390
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
call fcn.140032390
mov dword [rsp + 0x44], edi
mov word [rsp + 0x40], di
mov qword [rsp + 0x20], rdi
lea r9, [rsp + 0x44]
mov r8d, 2
lea rdx, [rsp + 0x40]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1400062d7
cmp dword [rsp + 0x44], 2
jb 0x1400062d7
mov r15d, 0xfeff
cmp word [rsp + 0x40], r15w
je 0x1400063a7
jmp 0x1400062dd
mov r15d, 0xfeff
lea rcx, [rsp + 0x48]
call fcn.140007d28
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
lea rcx, [rsp + 0x150]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
lea rcx, [rsp + 0x48]
call fcn.140007d28
mov qword [rsp + 0x48], rbx
cmp rbx, 0xffffffffffffffff
jne 0x140006354
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, 0x1fff0000
je 0x140006341
mov ecx, eax
call fcn.140032390
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
call fcn.140032390
mov dword [rsp + 0x54], edi
mov word [rsp + 0x40], r15w
mov qword [rsp + 0x20], rdi
lea r9, [rsp + 0x54]
mov r8d, 2
lea rdx, [rsp + 0x40]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1400063a7
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, 0x1fff0000
je 0x140006394
mov ecx, eax
call fcn.140032390
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
call fcn.140032390
lea r9, [rsp + 0x150]
lea r8, str.FilePath___ls
xor edx, edx
lea rcx, [rsp + 0xa0]
call fcn.140030824
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, 0x1fff0000
je 0x1400063fc
cmp eax, 0x80000000
jb 0x140006413
mov ecx, eax
call fcn.140032390
test eax, eax
je 0x140006413
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
call fcn.140032390
lea rcx, [rsp + 0x78]
call fcn.140002fd4
nop
cmp word [rsi], di
jne 0x140006428
mov rax, rdi
jmp 0x140006430
mov rcx, rsi
call fcn.140037f9c
mov r8, rax
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140011f54
lea rsi, [0x140051dc0]
mov rcx, rsi
call fcn.140037f9c
mov r8, rax
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140011f54
cmp word [r14], di
jne 0x14000646a
mov rax, rdi
jmp 0x140006472
mov rcx, r14
call fcn.140037f9c
mov r8, rax
mov rdx, r14
lea rcx, [rsp + 0x78]
call fcn.140011f54
test r13d, r13d
jne 0x140006490
test r12, r12
je 0x140006555
mov rcx, rsi
call fcn.140037f9c
mov r8, rax
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140011f54
xor edx, edx
lea r8d, [rdx + 0x40]
lea rcx, [rsp + 0x110]
call fcn.140034b00
mov r9d, 0xa
lea r8d, [r9 + 0x16]
lea rdx, [rsp + 0x110]
mov ecx, r13d
call fcn.140037c8c
cmp word [rsp + 0x110], di
jne 0x1400064e4
mov rax, rdi
jmp 0x1400064f1
lea rcx, [rsp + 0x110]
call fcn.140037f9c
mov r8, rax
lea rdx, [rsp + 0x110]
lea rcx, [rsp + 0x78]
call fcn.140011f54
test r12, r12
je 0x140006555
mov rcx, rsi
call fcn.140037f9c
mov r8, rax
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140011f54
lea rsi, [0x140051c7c]
cmp word [r12], di
cmovne rsi, r12
cmp word [rsi], di
jne 0x14000653d
mov rax, rdi
jmp 0x140006545
mov rcx, rsi
call fcn.140037f9c
mov r8, rax
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140011f54
lea rcx, [0x140051dc4]
call fcn.140037f9c
mov r8, rax
lea rdx, [0x140051dc4]
lea rcx, [rsp + 0x78]
call fcn.140011f54
lea r9, [rsp + 0x80]
cmp qword [rsp + 0x98], 8
cmovae r9, qword [rsp + 0x80]
lea r8, str.accum___ls
xor edx, edx
lea rcx, [rsp + 0xa0]
call fcn.140030824
mov dword [rsp + 0x58], edi
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0x68], rax
lea rdx, [rsp + 0x80]
cmp qword [rsp + 0x98], 8
cmovae rdx, qword [rsp + 0x80]
lea r8d, [rax + rax]
mov qword [rsp + 0x20], rdi
lea r9, [rsp + 0x58]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140006613
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, 0x1fff0000
je 0x1400065ff
mov ecx, eax
call fcn.140032390
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
call fcn.140032390
nop
xor r8d, r8d
mov dl, 1
lea rcx, [rsp + 0x78]
call fcn.140011b58
nop
mov edx, 1
lea r8d, [rdx + 0xf]
mov rcx, qword [rsp + 0x78]
call fcn.140011434
mov qword [rsp + 0x78], rdi
lea rcx, [rsp + 0x48]
call fcn.140007d28
nop
jmp 0x140006661
mov ecx, 0x80070057
call fcn.140032390
mov ecx, 0x80070057
call fcn.140032390
nop
mov edi, dword [rsp + 0x40]
mov r8d, edi
lea rdx, [0x14004ee5e]
lea rcx, [rsp + 0xa0]
call fcn.140030b9c
nop
lea rcx, [rsp + 0xa0]
call fcn.14002e7a8
mov eax, edi
mov rcx, qword [rsp + 0x360]
xor rcx, rsp
call fcn.140033cb0
add rsp, 0x370
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret