Function at 0x140040630
Capabilities:
Write file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r15
lea rbp, [rsp - 0x4f0]
sub rsp, 0x5f0
mov rax, qword [0x14024fa28]
xor rax, rsp
mov qword [rbp + 0x4e0], rax
mov rbx, qword [rcx + 8]
xor dil, dil
mov qword [rsp + 0x78], rcx
mov rsi, rcx
test rbx, rbx
je 0x140040b63
mov rax, 0xffffffffffffffff
inc rax
cmp word [rbx + rax*2], 0
jne 0x140040676
xor r15d, r15d
lfence
mov edx, 0x104
lea rcx, [rbp + 0x2d0]
mov r8, rbx
cmp rax, rdx
jae 0x1400406a2
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
jmp 0x1400406b6
mov r9d, 0x103
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
mov word [rbp + 0x4d6], r15w
mov edx, 0x5c
lea rcx, [rbp + 0x2d0]
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
je 0x1400406e8
lea rcx, [rbp + 0x2d0]
mov word [rax], r15w
call fcn.14018fa80
test eax, eax
je 0x1400406e8
xor al, al
jmp 0x140040b67
mov r9d, 2
mov dword [rsp + 0x20], r15d
mov r8d, r9d
xor edx, edx
mov rcx, rbx
call fcn.14018cd60
mov rbx, rax
test rax, rax
je 0x140040b63
mov eax, dword [rsi + 0x18]
test eax, eax
je 0x140040b34
mov qword [rsp + 0x628], r12
mov r12, r15
mov qword [rsp + 0x630], r13
mov r13d, eax
mov qword [rsp + 0x638], r14
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x58], rax
nop
mov rax, qword [rsi + 0x10]
lea rdx, [0x1401f11e4]
mov r8d, 1
mov rcx, rbx
mov r14, qword [r12 + rax]
call fcn.14018cf60
mov r8, qword [r14]
lea rax, [rbp - 0x30]
mov qword [rsp + 0x38], r15
mov r9d, 0xffffffff
mov qword [rsp + 0x30], r15
xor edx, edx
mov dword [rsp + 0x28], 0x100
xor ecx, ecx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea rax, [rbp - 0x30]
mov byte [rbp + 0xcf], 0
mov rcx, 0xffffffffffffffff
nop dword [rax]
inc rcx
cmp byte [rax + rcx], 0
jne 0x1400407a0
movzx eax, byte [0x140256a90]
test al, al
je 0x1400407fe
mov qword [rsp + 0x40], r15
lea rax, [rbp - 0x30]
mov qword [rsp + 0x38], r15
xorps xmm0, xmm0
mov dword [rsp + 0x30], ecx
xor r9d, r9d
mov qword [rsp + 0x28], rax
xor r8d, r8d
lea rax, [rbp - 0x80]
xor edx, edx
mov rcx, rbx
mov qword [rsp + 0x20], rax
movups xmmword [rbp - 0x80], xmm0
call qword [0x1401ea898]
mov ecx, eax
call qword [0x14024f040]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140040818
mov r8d, ecx
mov qword [rsp + 0x20], r15
mov rcx, rbx
lea r9, [rsp + 0x60]
lea rdx, [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r8d, 3
lea rdx, [0x1401fa050]
mov rcx, rbx
call fcn.14018cf60
mov eax, dword [r14 + 0x14]
test eax, eax
je 0x140040b04
xor r13d, r13d
lea r12, [0x1401fa054]
mov edi, r13d
mov esi, r13d
mov r15d, eax
nop dword [rax]
mov r8, r13
cmp rsi, qword [r14 + 0x14]
jae 0x140040864
mov rax, qword [r14 + 0xc]
mov rcx, qword [rdi + rax]
mov r8, qword [rcx]
mov qword [rsp + 0x38], r13
lea rax, [rbp + 0xd0]
xor edx, edx
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], 0x100
xor ecx, ecx
mov qword [rsp + 0x20], rax
lea r9d, [rdx - 1]
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov r8, r13
mov byte [rbp + 0x1cf], r13b
cmp rsi, qword [r14 + 0x14]
jae 0x1400408ac
mov rax, qword [r14 + 0xc]
mov rcx, qword [rax + rdi]
mov r8, qword [rcx + 8]
mov qword [rsp + 0x38], r13
lea rax, [rbp + 0x1d0]
xor edx, edx
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], 0x100
xor ecx, ecx
mov qword [rsp + 0x20], rax
lea r9d, [rdx - 1]
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea rax, [rbp + 0xd0]
mov byte [rbp + 0x2cf], r13b
mov rcx, 0xffffffffffffffff
nop dword [rax]
inc rcx
cmp byte [rax + rcx], r13b
jne 0x1400408f0
movzx eax, byte [0x140256a90]
test al, al
je 0x140040951
mov qword [rsp + 0x40], r13
lea rax, [rbp + 0xd0]
mov qword [rsp + 0x38], r13
xorps xmm0, xmm0
mov dword [rsp + 0x30], ecx
xor r9d, r9d
mov qword [rsp + 0x28], rax
xor r8d, r8d
lea rax, [rbp - 0x70]
xor edx, edx
mov rcx, rbx
mov qword [rsp + 0x20], rax
movups xmmword [rbp - 0x70], xmm0
call qword [0x1401ea898]
mov ecx, eax
call qword [0x14024f040]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x14004096e
mov r8d, ecx
mov qword [rsp + 0x20], r13
mov rcx, rbx
lea r9, [rsp + 0x64]
lea rdx, [rbp + 0xd0]
call qword [sym.imp.KERNEL32.dll_WriteFile]
movzx eax, byte [0x140256a90]
mov rcx, rbx
test al, al
je 0x1400409c3
mov qword [rsp + 0x40], r13
lea rax, [rbp - 0x60]
mov qword [rsp + 0x38], r13
xorps xmm0, xmm0
mov dword [rsp + 0x30], 1
xor r9d, r9d
mov qword [rsp + 0x28], r12
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x20], rax
movups xmmword [rbp - 0x60], xmm0
call qword [0x1401ea898]
mov ecx, eax
call qword [0x14024f040]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1400409dc
lea r9, [rsp + 0x68]
mov qword [rsp + 0x20], r13
mov r8d, 1
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
lea rcx, [rbp + 0x1d0]
mov rax, 0xffffffffffffffff
nop word [rax + rax]
inc rax
cmp byte [rcx + rax], r13b
jne 0x1400409f0
movzx ecx, byte [0x140256a90]
test cl, cl
mov rcx, rbx
je 0x140040a51
mov qword [rsp + 0x40], r13
xorps xmm0, xmm0
mov qword [rsp + 0x38], r13
xor r9d, r9d
mov dword [rsp + 0x30], eax
xor r8d, r8d
lea rax, [rbp + 0x1d0]
xor edx, edx
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x20], rax
movups xmmword [rbp - 0x50], xmm0
call qword [0x1401ea898]
mov ecx, eax
call qword [0x14024f040]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140040a6b
lea r9, [rsp + 0x6c]
mov qword [rsp + 0x20], r13
mov r8d, eax
lea rdx, [rbp + 0x1d0]
call qword [sym.imp.KERNEL32.dll_WriteFile]
movzx eax, byte [0x140256a90]
mov rcx, rbx
test al, al
je 0x140040ac7
mov qword [rsp + 0x40], r13
lea rax, [0x1401f9fd0]
mov qword [rsp + 0x38], r13
xorps xmm0, xmm0
mov dword [rsp + 0x30], 2
xor r9d, r9d
mov qword [rsp + 0x28], rax
xor r8d, r8d
lea rax, [rbp - 0x40]
xor edx, edx
mov qword [rsp + 0x20], rax
movups xmmword [rbp - 0x40], xmm0
call qword [0x1401ea898]
mov ecx, eax
call qword [0x14024f040]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140040ae4
lea r9, [rsp + 0x70]
mov qword [rsp + 0x20], r13
mov r8d, 2
lea rdx, [0x1401f9fd0]
call qword [sym.imp.KERNEL32.dll_WriteFile]
inc rsi
add rdi, 8
sub r15, 1
jne 0x140040850
mov r12, qword [rsp + 0x50]
mov r13, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x78]
add r12, 8
sub r13, 1
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x58], r13
jne 0x140040740
mov r14, qword [rsp + 0x638]
mov r13, qword [rsp + 0x630]
mov r12, qword [rsp + 0x628]
movzx eax, byte [0x140256a90]
mov rcx, rbx
test al, al
je 0x140040b5a
call qword [0x1401e9888]
mov ecx, eax
call qword [0x14024f040]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140040b60
call qword [case.0x1401b9e8b.6]
mov dil, 1
movzx eax, dil
mov rcx, qword [rbp + 0x4e0]
xor rcx, rsp
call fcn.1401c5190
add rsp, 0x5f0
pop r15
pop rdi
pop rsi
pop rbx
pop rbp
ret