Function at 0x402ffa
Capabilities:
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff8
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x58
mov eax, dword [ecx + 4]
mov dword [ebp - 0x3c], eax
test byte [0x406018], 8
jne 0x403300
mov eax, dword [ebp - 0x3c]
mov ebx, dword [sym.imp.oleaut32.dll_SafeArrayGetDim]
mov dword [esp], eax
call ebx
sub esp, 4
cmp eax, 1
jne 0x40352a
mov edi, dword [ebp - 0x3c]
lea eax, [ebp - 0x28]
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [sym.imp.oleaut32.dll_SafeArrayGetLBound]
lea eax, [ebp - 0x2c]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [sym.imp.oleaut32.dll_SafeArrayGetUBound]
lea eax, [ebp - 0x24]
sub esp, 0xc
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.oleaut32.dll_SafeArrayAccessData]
sub esp, 8
mov ecx, eax
test eax, eax
js 0x403283
mov eax, dword [ebp - 0x2c]
sub eax, dword [ebp - 0x28]
mov dword [esp + 4], 4
mov dword [ebp - 0x34], eax
add eax, 1
mov dword [ebp - 0x38], eax
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_calloc]
mov esi, eax
test eax, eax
je 0x403588
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x4035a1
mov eax, dword [ebp - 0x34]
xor edi, edi
mov dword [ebp - 0x30], esi
mov ebx, edi
mov edi, eax
jmp 0x403128
xor eax, eax
mov dword [esp + 0xc], 8
mov word [ebp - 0x20], ax
lea eax, [ebp - 0x20]
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_VariantChangeType]
sub esp, 0x10
test eax, eax
js 0x403293
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x30]
mov dword [ecx + ebx*4], eax
mov dword [esp], eax
mov esi, dword [sym.imp.oleaut32.dll_SysStringLen]
call esi
add edi, eax
sub esp, 4
lea eax, [ebx + 1]
cmp dword [ebp - 0x34], ebx
je 0x403330
mov ebx, eax
mov edx, ebx
shl edx, 4
add edx, dword [ebp - 0x24]
cmp word [edx], 1
mov esi, edx
jne 0x4030d0
mov dword [esp], str.null
call dword [sym.imp.oleaut32.dll_SysAllocString]
mov ecx, dword [ebp - 0x30]
sub esp, 4
mov dword [ecx + ebx*4], eax
test eax, eax
jne 0x40310a
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x3c]
mov esi, ecx
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
mov ecx, 0x8007000e
sub esp, 4
mov dword [ebp - 0x30], ecx
xor edi, edi
mov eax, esi
mov ebx, dword [sym.imp.oleaut32.dll_SysFreeString]
mov esi, edi
mov edi, eax
lea esi, [esi]
mov edx, dword [edi + esi*4]
add esi, 1
mov dword [esp], edx
call ebx
sub esp, 4
cmp dword [ebp - 0x38], esi
ja 0x403180
mov dword [esp], edi
mov ebx, dword [sym.imp.ucrtbase.dll_free]
call ebx
mov ecx, dword [ebp - 0x30]
test ecx, ecx
jne 0x403283
cmp word [section..bss], 0
jne 0x403501
mov ecx, dword [ebp - 0x34]
cmp word [ecx], 0
mov eax, ecx
je 0x40357a
lea esi, [esi]
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x4031d0
sub eax, dword [ebp - 0x34]
sar eax, 1
mov dword [ebp - 0x38], eax
mov edi, eax
mov eax, dword [sym.imp.kernel32.dll_GetStdHandle]
mov dword [esp], 0xfffffff5
mov dword [ebp - 0x30], eax
call eax
lea ecx, [ebp - 0x20]
mov esi, dword [sym.imp.kernel32.dll_WriteConsoleW]
sub esp, 4
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp - 0x34]
mov dword [esp + 0x10], 0
mov dword [esp + 8], edi
mov dword [esp + 4], ecx
mov dword [esp], eax
call esi
sub esp, 0x14
test eax, eax
je 0x4033d0
mov eax, 0xa
mov edi, 0x40858c
jmp 0x403237
movzx eax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x403233
mov dword [esp], 0xfffffff5
mov eax, dword [ebp - 0x30]
sub edi, 0x40858c
call eax
sar edi, 1
lea ecx, [ebp - 0x20]
sub esp, 4
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40858c
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x34]
sub esp, 0x14
mov dword [esp], eax
call ebx
xor ecx, ecx
lea esp, [ebp - 0x10]
mov eax, ecx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 8
mov ebx, esi
mov ecx, eax
mov esi, dword [ebp - 0x30]
test byte [0x406018], 4
jne 0x4032c4
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x30], ecx
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
mov dword [ebp - 0x34], 0
mov ecx, dword [ebp - 0x30]
sub esp, 4
jmp 0x40316b
mov dword [ebp - 0x30], eax
mov eax, ebx
call dbg.wine_dbgstr_variant
mov dword [esp + 0xc], str.Could_not_convert_argument__s_to_string_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0x408c50
mov dword [esp + 4], 0x406018
mov dword [esp], 2
call sym._wine_dbg_log.constprop.14
mov ecx, dword [ebp - 0x30]
jmp 0x4032a3
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x408224
mov dword [esp + 8], str.Host_Echo
mov dword [esp + 4], 0x406018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.14
jmp 0x403017
mov ebx, esi
mov esi, dword [ebp - 0x30]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
lea eax, [edi + edi + 2]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_malloc]
mov ecx, 0x8007000e
mov dword [ebp - 0x34], eax
test eax, eax
je 0x40316b
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x40], ebx
mov edi, esi
mov ebx, eax
mov dword [ebp - 0x44], esi
lea ecx, [esi + edx*4]
mov dword [ebp - 0x3c], ecx
jmp 0x40338b
mov eax, 0x20
lea ebx, [esi + 2]
mov word [esi], ax
mov edx, dword [edi]
mov eax, dword [ebp - 0x40]
add edi, 4
mov dword [esp], edx
mov dword [ebp - 0x30], edx
call eax
mov edx, dword [ebp - 0x30]
sub esp, 4
lea esi, [eax + eax]
mov dword [esp + 8], esi
add esi, ebx
mov dword [esp + 4], edx
mov dword [esp], ebx
call sym._memcpy
cmp dword [ebp - 0x3c], edi
jne 0x403380
mov edx, esi
xor ebx, ebx
mov esi, dword [ebp - 0x44]
xor ecx, ecx
mov word [edx], bx
jmp 0x40316b
mov edx, dword [sym.imp.kernel32.dll_GetOEMCP]
mov dword [ebp - 0x44], edx
call edx
mov ecx, dword [ebp - 0x38]
mov esi, dword [ebp - 0x34]
mov dword [esp + 0x1c], 0
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 4], 0
mov dword [ebp - 0x40], eax
call eax
sub esp, 0x20
mov dword [ebp - 0x3c], eax
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_malloc]
mov esi, eax
test eax, eax
je 0x4034e7
mov edx, dword [ebp - 0x44]
call edx
mov ecx, dword [ebp - 0x38]
mov edi, dword [ebp - 0x3c]
mov dword [esp + 0x1c], 0
mov dword [esp], eax
mov eax, dword [ebp - 0x40]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp - 0x34]
mov dword [esp + 0x14], edi
mov dword [esp + 8], ecx
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], esi
mov dword [esp + 4], 0
call eax
mov eax, dword [ebp - 0x30]
sub esp, 0x20
mov dword [esp], 0xfffffff5
call eax
lea ecx, [ebp - 0x20]
sub esp, 4
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
mov edi, dword [sym.imp.kernel32.dll_WriteFile]
mov dword [esp + 0x10], 0
mov dword [esp + 4], esi
mov dword [esp], eax
call edi
sub esp, 0x14
mov dword [esp], esi
call ebx
mov dword [esp], 0xfffffff5
mov eax, dword [ebp - 0x30]
call eax
lea ecx, [ebp - 0x20]
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 2
mov dword [esp + 4], 0x4085e1
mov dword [esp], eax
call edi
sub esp, 0x14
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call ebx
lea esp, [ebp - 0x10]
xor ecx, ecx
mov eax, ecx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 8
mov eax, dword [ebp - 0x34]
mov dword [esp + 0xc], 0
mov dword [esp + 8], str.Windows_Script_Host
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.user32.dll_MessageBoxW]
sub esp, 0x10
jmp 0x4034e7
mov ecx, 0x80004001
test byte [0x406018], 1
je 0x403283
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x30], ecx
mov dword [esp], eax
call ebx
sub esp, 4
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unsupported_args_dim__d_n
mov dword [esp + 8], str.Host_Echo
mov dword [esp + 4], 0x406018
mov dword [esp], 0
call sym._wine_dbg_log.constprop.14
mov ecx, dword [ebp - 0x30]
jmp 0x403283
xor edi, edi
mov dword [ebp - 0x38], 0
jmp 0x4031e3
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
mov ecx, 0x8007000e
sub esp, 4
jmp 0x403283
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SafeArrayUnaccessData]
push ecx
mov dword [esp], 0
call dword [sym.imp.ucrtbase.dll_malloc]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x4035da
mov eax, dword [ebp - 0x34]
xor edx, edx
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov word [eax], dx
mov dword [esp], esi
call ebx
jmp 0x4031a9
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_free]
mov ecx, 0x8007000e
jmp 0x403283