Function at 0x403430
Capabilities:
Access peb ldr_data
Check for peb beingdebugged flag
Get kernel32 base address
Get process heap flags
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x68
mov eax, dword [ecx + 4]
mov dword [ebp - 0x44], eax
test byte [0x406018], 8
jne 0x4038e0
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sym._SafeArrayGetDim_4
sub esp, 4
cmp eax, 1
jne 0x4039db
lea eax, [ebp - 0x30]
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov edi, dword [ebp - 0x44]
mov dword [esp], edi
call sym._SafeArrayGetLBound_12
lea eax, [ebp - 0x34]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], edi
call sym._SafeArrayGetUBound_12
lea eax, [ebp - 0x2c]
sub esp, 0xc
mov dword [esp + 4], eax
mov dword [esp], edi
call sym._SafeArrayAccessData_8
sub esp, 8
mov ecx, eax
test eax, eax
js 0x40388a
mov eax, dword [ebp - 0x34]
sub eax, dword [ebp - 0x30]
lea ebx, [eax + 1]
mov dword [ebp - 0x3c], eax
lea eax, [ebx*4]
mov dword [esp + 4], 8
mov dword [esp + 8], eax
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x48], eax
call eax
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x403ac2
test ebx, ebx
je 0x4039ee
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x40], esi
xor ebx, ebx
mov edi, eax
jmp 0x403576
xor eax, eax
mov word [ebp - 0x28], ax
lea eax, [ebp - 0x28]
mov dword [esp + 0xc], 8
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._VariantChangeType_16
sub esp, 0x10
test eax, eax
js 0x4036e0
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x40]
mov dword [ecx + ebx*4], eax
mov dword [esp], eax
call sym._SysStringLen_4
mov ecx, dword [ebp - 0x3c]
add edi, eax
sub esp, 4
lea eax, [ebx + 1]
cmp ebx, ecx
je 0x403910
mov ebx, eax
mov edx, ebx
shl edx, 4
add edx, dword [ebp - 0x2c]
cmp word [edx], 1
mov esi, edx
jne 0x403520
mov dword [esp], str.null
call sym._SysAllocString_4
mov esi, dword [ebp - 0x40]
sub esp, 4
mov dword [esi + ebx*4], eax
test eax, eax
jne 0x403559
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sym._SafeArrayUnaccessData_4
sub esp, 4
mov dword [ebp - 0x44], 0
mov ecx, 0x8007000e
mov edi, dword [ebp - 0x3c]
mov dword [ebp - 0x3c], ecx
xor ebx, ebx
lea esi, [esi]
mov eax, dword [esi + ebx*4]
mov dword [esp], eax
call sym._SysFreeString_4
mov eax, ebx
add ebx, 1
sub esp, 4
cmp edi, eax
jne 0x4035c8
mov dword [esp + 8], esi
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov ecx, dword [ebp - 0x3c]
sub esp, 0xc
test ecx, ecx
jne 0x40388a
cmp word [0x40f008], 0
jne 0x4039b0
mov esi, dword [ebp - 0x44]
cmp word [esi], 0
mov eax, esi
je 0x403a51
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x403630
mov esi, dword [ebp - 0x44]
sub eax, esi
sar eax, 1
mov dword [ebp - 0x40], eax
mov edi, eax
mov eax, dword [sym.imp.kernel32.dll_GetStdHandle]
mov dword [esp], 0xfffffff5
mov dword [ebp - 0x3c], eax
call eax
lea ecx, [ebp - 0x28]
mov esi, dword [sym.imp.kernel32.dll_WriteConsoleW]
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
mov ecx, dword [ebp - 0x44]
mov dword [esp], eax
mov dword [esp + 4], ecx
call esi
sub esp, 0x14
test eax, eax
je 0x403718
mov edi, 0x407598
nop
add edi, 2
cmp word [edi], 0
jne 0x403690
mov dword [esp], 0xfffffff5
sub edi, 0x407598
mov eax, dword [ebp - 0x3c]
call eax
sar edi, 1
lea ecx, [ebp - 0x28]
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
mov dword [esp + 4], 0x407598
mov dword [esp], eax
call esi
sub esp, 0x14
jmp 0x403865
mov ebx, esi
mov ecx, eax
mov esi, dword [ebp - 0x40]
test byte [0x406018], 4
jne 0x4038a0
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x40], ecx
mov dword [esp], eax
call sym._SafeArrayUnaccessData_4
mov dword [ebp - 0x44], 0
mov ecx, dword [ebp - 0x40]
sub esp, 4
jmp 0x4035b9
mov ecx, dword [sym.imp.kernel32.dll_GetConsoleOutputCP]
mov dword [ebp - 0x58], ecx
call ecx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov esi, dword [ebp - 0x40]
mov dword [esp + 0xc], esi
mov edx, dword [ebp - 0x44]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov dword [ebp - 0x50], eax
call eax
sub esp, 0x20
mov dword [ebp - 0x4c], eax
mov edx, dword fs:[0x18]
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x54], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov ecx, dword [ebp - 0x48]
call ecx
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x403865
mov ecx, dword [ebp - 0x58]
call ecx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov edi, dword [ebp - 0x4c]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], edi
mov ecx, dword [ebp - 0x40]
mov dword [esp + 0xc], ecx
mov edx, dword [ebp - 0x44]
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x50]
call eax
sub esp, 0x20
mov dword [esp], 0xfffffff5
mov eax, dword [ebp - 0x3c]
call eax
lea ecx, [ebp - 0x28]
sub esp, 4
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
mov edi, dword [sym.imp.kernel32.dll_WriteFile]
mov dword [esp + 4], esi
mov dword [esp + 0x10], 0
mov dword [esp], eax
call edi
sub esp, 0x14
mov dword [esp + 8], esi
lea esi, [ebp - 0x28]
mov dword [esp + 4], 0
mov edx, dword [ebp - 0x54]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
mov dword [esp], 0xfffffff5
mov eax, dword [ebp - 0x3c]
call eax
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 8], 2
mov dword [esp + 4], 0x4075ed
mov dword [esp], eax
call edi
sub esp, 0x14
mov ecx, dword [ebp - 0x44]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
xor ecx, ecx
sub esp, 0xc
lea esp, [ebp - 0x10]
mov eax, ecx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 8
mov dword [ebp - 0x40], 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], 0x407c50
mov dword [esp + 4], 0x406018
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
mov ecx, dword [ebp - 0x40]
jmp 0x4036f4
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4071a0
mov dword [esp + 8], str.Host_Echo
mov dword [esp + 4], 0x406018
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x403457
mov eax, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
mov dword [esp], eax
call sym._SafeArrayUnaccessData_4
lea edx, [edi + edi + 2]
xor edi, edi
sub esp, 4
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x48]
call eax
mov dword [ebp - 0x44], eax
sub esp, 0xc
test eax, eax
je 0x4035ad
mov dword [ebp - 0x40], eax
jmp 0x403970
lea ecx, [ebx + 2]
mov edi, eax
mov dword [ebp - 0x40], ecx
mov ecx, 0x20
mov word [ebx], cx
mov eax, dword [esi + edi*4]
mov dword [esp], eax
call sym._SysStringLen_4
lea ebx, [eax + eax]
mov eax, dword [esi + edi*4]
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp - 0x40]
add ebx, eax
lea eax, [edi + 1]
cmp dword [ebp - 0x3c], edi
jne 0x403960
xor eax, eax
xor ecx, ecx
mov word [ebx], ax
jmp 0x4035b9
mov dword [esp + 0xc], 0
mov dword [esp + 8], str.Windows_Script_Host
mov eax, dword [ebp - 0x44]
mov dword [esp], 0
mov dword [esp + 4], eax
call sym._MessageBoxW_16
sub esp, 0x10
jmp 0x403865
test byte [0x406018], 1
jne 0x403a5f
mov ecx, 0x80004001
jmp 0x40388a
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sym._SafeArrayUnaccessData_4
sub esp, 4
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x48]
call eax
mov dword [ebp - 0x44], eax
sub esp, 0xc
test eax, eax
je 0x403a9a
mov eax, dword [ebp - 0x44]
xor edx, edx
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov word [eax], dx
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
jmp 0x403610
mov dword [ebp - 0x40], 0
xor edi, edi
jmp 0x403645
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sym._SafeArrayGetDim_4
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.0_1
jmp 0x4039e4
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
mov ecx, 0x8007000e
jmp 0x40388a
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sym._SafeArrayUnaccessData_4
sub esp, 4
jmp 0x403ab8