Function at 0x402f80
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
mov r13, rdx
test byte [0x00407030], 8
jne 0x403250
mov rbx, qword [sym.imp.oleaut32.dll_SafeArrayGetDim]
mov rcx, r13
call rbx
cmp eax, 1
jne 0x40340f
lea r8, [rsp + 0x64]
mov edx, 1
mov rcx, r13
call qword [sym.imp.oleaut32.dll_SafeArrayGetLBound]
lea r8, [rsp + 0x60]
mov edx, 1
mov rcx, r13
call qword [sym.imp.oleaut32.dll_SafeArrayGetUBound]
lea rdx, [rsp + 0x68]
mov rcx, r13
call qword [sym.imp.oleaut32.dll_SafeArrayAccessData]
mov r14d, eax
test eax, eax
js 0x4031d3
mov edi, dword [rsp + 0x60]
sub edi, dword [rsp + 0x64]
mov edx, 8
lea ecx, [rdi + 1]
mov dword [rsp + 0x54], ecx
call qword [sym.imp.ucrtbase.dll_calloc]
mov r12, rax
test rax, rax
je 0x40347c
mov r9d, dword [rsp + 0x54]
test r9d, r9d
je 0x40344c
mov rsi, rax
mov eax, edi
mov qword [rsp + 0x48], r12
mov rbp, qword [sym.imp.oleaut32.dll_SysStringLen]
lea r14, [rax + rax*2 + 3]
mov qword [rsp + 0x58], rax
xor ebx, ebx
lea r15, [r14*8]
jmp 0x4030a0
xor r8d, r8d
lea rcx, [rsp + 0x70]
mov r9d, 8
mov rdx, r12
mov word [rsp + 0x70], r8w
xor r8d, r8d
call qword [sym.imp.oleaut32.dll_VariantChangeType]
mov r14d, eax
test eax, eax
js 0x4031f0
mov rcx, qword [rsp + 0x78]
mov qword [rsi], rcx
call rbp
add rbx, 0x18
add rsi, 8
add edi, eax
cmp r15, rbx
je 0x403280
mov r12, qword [rsp + 0x68]
add r12, rbx
cmp word [r12], 1
jne 0x403058
lea rcx, str.null
call qword [sym.imp.oleaut32.dll_SysAllocString]
mov qword [rsi], rax
mov rcx, rax
test rax, rax
jne 0x40308b
mov r12, qword [rsp + 0x48]
mov r15, rax
mov rcx, r13
mov r14d, 0x8007000e
call qword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
nop
mov rsi, qword [sym.imp.oleaut32.dll_SysFreeString]
mov edi, dword [rsp + 0x54]
xor ebx, ebx
nop dword [rax]
mov rcx, qword [r12 + rbx*8]
add rbx, 1
call rsi
cmp edi, ebx
ja 0x4030f0
mov rsi, qword [sym.imp.ucrtbase.dll_free]
mov rcx, r12
call rsi
test r14d, r14d
jne 0x4031d3
cmp word [0x00407028], 0
jne 0x4033f8
xor ebp, ebp
xor r13d, r13d
xor ebx, ebx
cmp word [r15], 0
mov rcx, r15
je 0x403150
nop word [rax + rax]
add rcx, 2
cmp word [rcx], 0
jne 0x403138
sub rcx, r15
mov rbx, rcx
sar rbx, 1
mov r13d, ebx
mov ebp, ebx
mov ecx, 0xfffffff5
mov r12, qword [sym.imp.kernel32.dll_GetStdHandle]
lea rdi, [rsp + 0x70]
call r12
mov r8d, ebp
mov r9, rdi
mov rbp, qword [sym.imp.kernel32.dll_WriteConsoleW]
mov qword [rsp + 0x20], 0
mov rcx, rax
mov rdx, r15
call rbp
test eax, eax
je 0x403308
lea r13, [0x004085d0]
mov rbx, r13
nop dword [rax]
add rbx, 2
cmp word [rbx], 0
jne 0x403198
sub rbx, r13
mov ecx, 0xfffffff5
xor r14d, r14d
call r12
mov r8, rbx
mov r9, rdi
lea rdx, [0x004085d0]
mov qword [rsp + 0x20], 0
mov rcx, rax
sar r8, 1
call rbp
mov rcx, r15
call rsi
mov eax, r14d
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r15, r12
mov r12, qword [rsp + 0x48]
test byte [0x00407030], 4
jne 0x403218
mov rcx, r13
xor r15d, r15d
call qword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
jmp 0x4030e0
mov rcx, r15
call sym.wine_dbgstr_variant
lea r9, str.Could_not_convert_argument__s_to_string_n
mov ecx, 2
lea r8, [0x00408ed0]
mov qword [rsp + 0x20], rax
lea rdx, [0x00407030]
call sym.wine_dbg_log.constprop.0_1
jmp 0x403201
mov qword [rsp + 0x20], rdx
lea r9, [0x00408264]
lea r8, str.Host_Echo
mov ecx, 3
lea rdx, [0x00407030]
call sym.wine_dbg_log.constprop.0_1
jmp 0x402fa3
mov rcx, r13
mov r12, qword [rsp + 0x48]
call qword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
lea ecx, [rdi + 1]
add rcx, rcx
call qword [sym.imp.ucrtbase.dll_malloc]
mov r15, rax
test rax, rax
je 0x403490
mov r13, qword [rsp + 0x58]
mov rdi, rax
xor esi, esi
jmp 0x4032d0
mov rdi, rbx
cmp esi, 0xffffffff
je 0x4032cc
mov ecx, 0x20
add rdi, 2
mov word [rbx], cx
add rsi, 1
mov r14, qword [r12 + rsi*8]
mov rcx, r14
call rbp
mov rdx, r14
mov rcx, rdi
mov ebx, eax
add rbx, rbx
mov r8, rbx
add rbx, rdi
call sym.memcpy
cmp r13, rsi
jne 0x4032b8
xor edx, edx
xor r14d, r14d
mov word [rbx], dx
jmp 0x4030e0
mov r10, qword [sym.imp.kernel32.dll_GetOEMCP]
mov qword [rsp + 0x48], r10
call r10
mov r9d, r13d
mov r8, r15
xor edx, edx
mov ecx, eax
mov dword [rsp + 0x28], 0
mov r14, qword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x20], 0
call r14
mov ecx, ebx
mov ebp, eax
call qword [sym.imp.ucrtbase.dll_malloc]
mov rbx, rax
test rax, rax
je 0x4033e5
mov r10, qword [rsp + 0x48]
call r10
mov r9d, r13d
mov r8, r15
xor edx, edx
mov dword [rsp + 0x28], ebp
mov ecx, eax
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x20], rbx
call r14
mov ecx, 0xfffffff5
call r12
mov r8d, ebp
mov r9, rdi
mov rdx, rbx
mov rcx, rax
mov rbp, qword [sym.imp.kernel32.dll_WriteFile]
mov qword [rsp + 0x20], 0
call rbp
mov rcx, rbx
call rsi
mov ecx, 0xfffffff5
call r12
mov r9, rdi
mov r8d, 2
mov qword [rsp + 0x20], 0
mov rcx, rax
lea rdx, [0x00408629]
call rbp
mov rcx, r15
xor r14d, r14d
call rsi
jmp 0x4031d3
xor r9d, r9d
lea r8, str.Windows_Script_Host
mov rdx, r15
xor ecx, ecx
call qword [sym.imp.user32.dll_MessageBoxW]
jmp 0x4033e5
mov r14d, 0x80004001
test byte [0x00407030], 1
je 0x4031d3
mov rcx, r13
call rbx
lea r9, str.Unsupported_args_dim__d_n
lea r8, str.Host_Echo
xor ecx, ecx
mov dword [rsp + 0x20], eax
lea rdx, [0x00407030]
call sym.wine_dbg_log.constprop.0_1
jmp 0x4031d3
mov rcx, r13
call qword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
xor ecx, ecx
call qword [sym.imp.ucrtbase.dll_malloc]
mov r15, rax
test rax, rax
je 0x40349b
xor eax, eax
mov rsi, qword [sym.imp.ucrtbase.dll_free]
mov rcx, r12
mov word [r15], ax
call rsi
jmp 0x403113
mov rcx, r13
mov r14d, 0x8007000e
call qword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
jmp 0x4031d3
mov r14d, 0x8007000e
jmp 0x4030e0
mov rcx, r12
mov r14d, 0x8007000e
call qword [sym.imp.ucrtbase.dll_free]
jmp 0x4031d3