Function at 0x140039518
Capabilities:
Get file size
Write file on windows

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x2c0
mov qword [rsp + 0x70], 0xfffffffffffffffe
mov rax, qword [0x14009e140]
xor rax, rsp
mov qword [rsp + 0x2b0], rax
mov r14, r8
mov r13, rdx
mov r15d, ecx
mov dword [rsp + 0x44], ecx
mov qword [rsp + 0x60], r8
or r12, 0xffffffffffffffff
xor ebx, ebx
mov dword [rsp + 0x50], ebx
xor eax, eax
mov dword [rsp + 0x54], eax
mov edi, ebx
lea rsi, str.P5_n_
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x14003959c
test byte [rcx + 0x1c], 4
je 0x14003959c
cmp byte [rcx + 0x19], 5
jb 0x14003959c
lea edx, [rbx + 0x53]
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.14000ffa8
lea rcx, [0x14000a0a8]
lea rax, [0x14000a0c8]
cmp r15d, ebx
cmove rax, rcx
mov qword [rsp + 0x20], rax
mov r9, r13
lea r8, [0x140009d80]
mov edx, 0x104
lea rcx, [rsp + 0xa0]
call fcn.1400118ac
mov r13d, eax
cmp eax, ebx
jge 0x140039627
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x140039609
test byte [rcx + 0x1c], 4
je 0x140039609
cmp byte [rcx + 0x19], 2
jb 0x140039609
mov edx, 0x54
mov r9d, eax
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
mov ecx, r13d
and ecx, 0x1fff0000
movzx eax, r13w
mov edi, r13d
cmp ecx, 0x70000
cmove edi, eax
jmp 0x14003992c
mov dword [rsp + 0x38], 2
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
and byte [rax + rax], al
add byte [rax], al
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [r9 + 1]
lea rcx, [rsp + 0xa0]
call fcn.140079cec
mov r12, rax
mov qword [rsp + 0x58], rax
cmp rax, 0xffffffffffffffff
jne 0x1400396b4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x14003992c
test byte [rcx + 0x1c], 4
je 0x14003992c
cmp byte [rcx + 0x19], 2
jb 0x14003992c
lea edx, [r12 + 0x56]
mov r9d, eax
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
jmp 0x14003992c
lea rdx, [rsp + 0x50]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
cmp eax, ebx
jne 0x14003970f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x14003992c
test byte [rcx + 0x1c], 4
je 0x14003992c
cmp byte [rcx + 0x19], 2
jb 0x14003992c
mov edx, 0x56
mov r9d, eax
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
jmp 0x14003992c
cmp qword [rsp + 0x50], rbx
jne 0x1400398d6
mov eax, 0xfeff
mov word [rsp + 0x40], ax
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x4c]
mov r8d, 2
lea rdx, [rsp + 0x40]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, ebx
jne 0x14003978f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x14003992c
test byte [rcx + 0x1c], 4
je 0x14003992c
cmp byte [rcx + 0x19], 2
jb 0x14003992c
mov edx, 0x57
mov r9d, eax
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
jmp 0x14003992c
mov qword [rsp + 0x98], 7
mov qword [rsp + 0x90], rbx
mov word [rsp + 0x80], bx
lea rax, [0x140009ea0]
lea rcx, [0x14000a648]
cmp r15d, ebx
cmove rcx, rax
lea rdx, [rsp + 0x78]
call fcn.140035cf4
nop
lea rdx, [rsp + 0x80]
cmp qword [rsp + 0x98], 8
cmovae rdx, qword [rsp + 0x80]
mov r8d, dword [rsp + 0x90]
add r8d, r8d
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x4c]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, ebx
jne 0x140039861
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x140039840
test byte [rcx + 0x1c], 4
je 0x140039840
cmp byte [rcx + 0x19], 2
jb 0x140039840
mov edx, 0x59
mov r9d, eax
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
nop
cmp qword [rsp + 0x98], 8
jb 0x14003992c
mov rcx, qword [rsp + 0x80]
call fcn.14008c058
jmp 0x14003992c
cmp qword [rsp + 0x98], 8
jb 0x140039929
mov rcx, qword [rsp + 0x80]
call fcn.14008c058
jmp 0x140039929
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x140039929
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [str.P5_n_]
cmp rcx, rsi
je 0x14003992c
test byte [rcx + 0x1c], 4
je 0x14003992c
cmp byte [rcx + 0x19], 2
jb 0x14003992c
mov edx, 0x5a
mov r9d, eax
lea r8, [0x140009828]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
jmp 0x14003992c
mov qword [r14], r12
cmp edi, ebx
je 0x140039a04
cmp qword [r14], 0xffffffffffffffff
je 0x140039947
mov rcx, qword [r14]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
or qword [r14], 0xffffffffffffffff
cmp r15d, ebx
jne 0x140039954
mov dword [0x1400a3fdc], ebx
jmp 0x14003995a
mov dword [0x1400a3fe0], ebx
mov dword [rsp + 0x78], edi
mov word [rsp + 0x7c], bx
mov r9d, edi
lea r8, [0x140009d68]
mov edx, 0xc
lea rcx, [rsp + 0x7c]
call fcn.1400118ac
lea r8, [rsp + 0x7c]
cmp eax, ebx
cmovl r8, rbx
neg r15d
sbb edx, edx
add edx, 3
mov qword [rsp + 0x28], r8
mov rax, qword [0x1400a3fe8]
mov qword [rsp + 0x20], rax
mov ecx, 1
mov r9d, 0xc0007d3c
lea r8d, [rcx + 1]
call fcn.140077054
cmp r12, 0xffffffffffffffff
je 0x140039a04
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, ebx
jne 0x140039a04
mov rax, qword [str.P5_n_]
cmp rax, rsi
je 0x140039a04
test byte [rax + 0x1c], 4
je 0x140039a04
cmp byte [rax + 0x19], 2
jb 0x140039a04
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov edx, 0x5b
lea r8, [0x140009828]
mov rcx, qword [str.P5_n_]
mov rcx, qword [rcx + 0x10]
call fcn.1400100e0
mov eax, edi
mov rcx, qword [rsp + 0x2b0]
xor rcx, rsp
call fcn.14008c5b0
add rsp, 0x2c0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret