Function at 0x404370
Capabilities:
Accept command line arguments
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x188
mov ebx, dword [ebp + 0x10]
test byte [0x40708c], 8
jne 0x4046a0
call dword [sym.imp.kernel32.dll_GetCommandLineW]
lea edx, [ebp - 0x150]
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.shell32.dll_CommandLineToArgvW]
mov dword [ebp - 0x15c], eax
sub esp, 8
test eax, eax
je 0x404493
mov edx, dword [ebp - 0x150]
cmp edx, 1
jle 0x404486
mov eax, 0x409e98
mov edi, dword [sym.imp.ucrtbase.dll__wcsicmp]
mov ebx, 1
shr eax, 0x10
mov dword [ebp - 0x168], eax
mov eax, 0x409e9c
shr eax, 0x10
mov dword [ebp - 0x164], eax
mov eax, 0x409ea0
shr eax, 0x10
mov dword [ebp - 0x160], eax
jmp 0x404429
mov dword [esp + 4], 0x409eae
mov dword [esp], esi
call edi
test eax, eax
jne 0x404460
mov eax, 0xffffffff
mov word [0x407018], ax
mov edx, dword [ebp - 0x150]
add ebx, 1
cmp edx, ebx
jle 0x404486
mov eax, dword [ebp - 0x15c]
mov ecx, dword [eax + ebx*4]
movzx eax, word [ecx]
mov esi, eax
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404538
lea esi, [ecx + 2]
cmp ax, 0x2f
jne 0x404400
cmp word [ecx + 2], 0x2f
jne 0x404400
lea esi, [ecx + 4]
jmp 0x404400
mov dword [esp + 4], 0x409eb2
mov dword [esp], esi
call edi
test eax, eax
jne 0x4044a8
mov edx, dword [ebp - 0x150]
xor eax, eax
add ebx, 1
mov word [0x407018], ax
cmp edx, ebx
jg 0x404429
test byte [0x40708c], 1
jne 0x4047f0
mov eax, 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 4], 0x409ea0
mov dword [esp], esi
call edi
test eax, eax
jne 0x404780
test byte [0x40708c], 1
je 0x40441c
mov esi, dword [ebp - 0x160]
test esi, esi
je 0x404e2d
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x409ea0
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404505
mov eax, 0x409ea0
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.ignored__s_switch_n
mov dword [esp + 8], 0x40a1a8
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x40441c
mov eax, dword [ebp - 0x15c]
sub edx, ebx
mov dword [esp], ecx
sub edx, 1
mov dword [esp + 8], 0x419040
lea eax, [eax + ebx*4 + 4]
mov dword [section..bss], edx
mov dword [0x419004], eax
lea eax, [ebp - 0x158]
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x104
mov dword [ebp - 0x15c], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x404493
mov eax, dword [ebp - 0x158]
mov dword [esp + 4], 0x2e
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov ebx, eax
test eax, eax
je 0x404e53
lea edx, [ebp - 0x148]
call sym._get_engine_clsid
test eax, eax
jne 0x4049ca
test byte [0x40708c], 1
je 0x404493
mov eax, ebx
shr eax, 0x10
je 0x40507a
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x404e65
cmp word [ebx], 0
je 0x4050c7
lea esi, [esi]
nop
mov edx, eax
lea eax, [eax + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404608
mov esi, 0x224c
lea edi, [ebp - 0x16]
mov word [ebp - 0x138], si
lea esi, [ebp - 0x136]
jmp 0x404665
cmp ax, 9
je 0x404fb6
cmp ax, 0xa
jne 0x404fd4
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
lea eax, [edx - 1]
cmp esi, edi
ja 0x405047
test edx, edx
jle 0x405047
mov edx, eax
movzx eax, word [ebx]
add ebx, 2
cmp ax, 0xd
je 0x405025
jbe 0x40462c
cmp ax, 0x22
je 0x405036
cmp ax, 0x5c
jne 0x404fc7
mov eax, 0x5c5c
add esi, 2
mov word [esi - 2], ax
jmp 0x404650
test ebx, ebx
je 0x404e23
mov eax, ebx
shr eax, 0x10
je 0x404820
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x404833
cmp word [ebx], 0
je 0x404ee6
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x4046e0
mov ecx, 0x224c
lea esi, [ebp - 0x136]
lea edi, [ebp - 0x16]
mov word [ebp - 0x138], cx
jmp 0x404745
cmp ax, 9
je 0x404970
cmp ax, 0xa
jne 0x4048ed
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
test edx, edx
jle 0x404988
cmp esi, edi
ja 0x404988
mov edx, eax
movzx eax, word [ebx]
add ebx, 2
cmp ax, 0xd
je 0x404958
jbe 0x404708
cmp ax, 0x22
je 0x404940
cmp ax, 0x5c
jne 0x4048e0
mov ecx, 0x5c5c
add esi, 2
mov word [esi - 2], cx
jmp 0x404730
mov dword [esp + 4], 0x409e9c
mov dword [esp], esi
call edi
test eax, eax
jne 0x404878
test byte [0x40708c], 1
je 0x40441c
mov ecx, dword [ebp - 0x164]
test ecx, ecx
je 0x404e97
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x409e9c
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404505
mov eax, 0x409e9c
call sym._wine_dbgstr_wn.part.0.constprop.0_1
jmp 0x404505
mov dword [esp + 0xc], str.No_file_name_specified_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
mov eax, 1
jmp 0x404498
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf_2
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x14]
mov dword [esp + 0xc], str.__p__p__s__x__n
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_2
jmp 0x40438c
mov dword [esp + 4], 0x409e98
mov dword [esp], esi
call edi
test eax, eax
jne 0x404f07
test byte [0x40708c], 1
je 0x40441c
mov edx, dword [ebp - 0x168]
test edx, edx
je 0x4050e8
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x409e98
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404505
mov eax, 0x409e98
call sym._wine_dbgstr_wn.part.0.constprop.0_1
jmp 0x404505
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x4049c0
mov ecx, eax
mov byte [esi], 0x5c
add esi, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 4], cl
mov ecx, eax
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 3], cl
mov ecx, eax
and eax, 0xf
shr cx, 4
movzx eax, byte [eax + str.0123456789abcdefset_host_properties]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 1], al
mov byte [esi - 2], cl
jmp 0x404730
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404730
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404730
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404730
mov byte [esi], 0x22
test eax, eax
jle 0x404eff
mov edx, 0x2e2e
mov byte [esi + 3], 0x2e
lea eax, [esi + 4]
mov word [esi + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x138]
mov dword [esp], eax
call sym.___wine_dbg_strdup
jmp 0x404833
mov byte [esi], al
add esi, 1
jmp 0x404730
mov dword [esp], 0
lea ebx, [ebp - 0x138]
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x148]
sub esp, 4
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x410b18
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ole32.dll_CoCreateInstance]
sub esp, 0x14
test eax, eax
js 0x404ece
mov eax, dword [ebp - 0x138]
lea esi, [ebp - 0x14c]
mov edx, dword [eax]
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40d7f8
mov dword [esp], eax
call dword [edx]
mov esi, eax
mov eax, dword [ebp - 0x138]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test esi, esi
js 0x404ece
mov eax, dword [ebp - 0x14c]
lea esi, [ebp - 0x154]
mov edx, dword [eax]
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40d7e8
mov dword [esp], eax
call dword [edx]
mov ecx, dword [ebp - 0x15c]
sub esp, 0xc
test eax, eax
js 0x404ebd
mov edi, dword [ebp - 0x14c]
mov esi, dword [ebp - 0x154]
mov dword [esp + 4], ebx
mov dword [ebp - 0x15c], ecx
mov dword [esp], str.wscript.exe
call dword [sym.imp.oleaut32.dll_LoadTypeLib]
mov ecx, dword [ebp - 0x15c]
sub esp, 8
test eax, eax
js 0x404f80
mov eax, dword [ebp - 0x138]
mov dword [ebp - 0x15c], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x419024
mov dword [esp + 4], 0x40a1dc
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
test eax, eax
mov eax, dword [ebp - 0x138]
mov edx, dword [eax]
js 0x404f77
mov dword [esp + 8], 0x419020
mov dword [esp + 4], 0x40a1fc
mov dword [esp], eax
call dword [edx + 0x18]
mov ebx, eax
mov eax, dword [ebp - 0x138]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test ebx, ebx
js 0x404f80
mov eax, dword [edi]
mov dword [esp + 4], 0x407044
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x404f80
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x404f80
mov eax, dword [edi]
mov dword [esp + 8], 2
mov dword [esp + 4], str.WScript
mov dword [esp], edi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x404f80
mov eax, dword [edi]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x409e38
mov dword [esp], edi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x404f80
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404f80
mov eax, dword [ebp - 0x154]
mov ecx, dword [ebp - 0x15c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 1
mov dword [ebp - 0x164], eax
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x40510e
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x160], eax
mov dword [esp], esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
sub esp, 0x18
mov ebx, eax
mov dword [esp], esi
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
call esi
sub esp, 4
cmp ebx, 0xffffffff
je 0x40510e
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_MapViewOfFile]
sub esp, 0x14
mov dword [ebp - 0x15c], eax
mov dword [esp], ebx
call esi
mov esi, dword [ebp - 0x15c]
sub esp, 4
test esi, esi
je 0x40510e
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], esi
mov dword [esp + 0x14], 0
mov dword [ebp - 0x168], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
mov esi, eax
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov edx, dword [ebp - 0x168]
sub esp, 8
mov ebx, eax
mov dword [esp + 0x14], esi
mov esi, dword [ebp - 0x15c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
test ebx, ebx
je 0x40510e
mov edx, dword [ebp - 0x164]
mov eax, dword [edx]
mov dword [esp], edx
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0x82
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
call dword [eax + 0x14]
sub esp, 0x28
mov esi, eax
mov dword [esp], ebx
call dword [sym.imp.oleaut32.dll_SysFreeString]
sub esp, 4
test esi, esi
js 0x40517e
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x405144
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 0x1c]
mov eax, dword [0x419024]
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 8]
mov eax, dword [ebp - 0x154]
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
call dword [sym.imp.ole32.dll_CoUninitialize]
xor eax, eax
jmp 0x404498
mov eax, str._null_
jmp 0x404833
mov dword [ebp - 0x16c], 0x409ea0
movzx eax, word [ebp - 0x16c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x404505
test byte [0x40708c], 1
je 0x404493
mov edx, str._null_
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.Could_not_find_engine_for__s_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
mov eax, 1
jmp 0x404498
mov dword [ebp - 0x16c], 0x409e9c
movzx eax, word [ebp - 0x16c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x404505
mov eax, dword [ebp - 0x14c]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40708c], 1
jne 0x405094
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x404493
mov eax, 0x224c
mov byte [ebp - 0x136], 0x22
lea esi, [ebp - 0x136]
mov word [ebp - 0x138], ax
lea eax, [esi + 1]
jmp 0x4049a3
test byte [0x40708c], 1
je 0x404493
mov eax, esi
shr eax, 0x10
je 0x4051b8
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404f45
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.unsupported_switch__s_n
mov dword [esp + 8], 0x40a1a8
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
mov eax, 1
jmp 0x404498
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40708c], 1
je 0x404dfa
mov dword [esp + 0xc], str.Script_initialization_failed_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404dfa
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404650
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x4050bd
mov ecx, eax
mov byte [esi], 0x5c
add esi, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 4], cl
mov ecx, eax
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 3], cl
mov ecx, eax
and eax, 0xf
shr cx, 4
movzx eax, byte [eax + str.0123456789abcdefset_host_properties]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 1], al
mov byte [esi - 2], cl
jmp 0x404650
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404650
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404650
mov byte [esi], 0x22
test eax, eax
jle 0x4050e0
mov edi, 0x2e2e
mov byte [esi + 3], 0x2e
lea eax, [esi + 4]
mov word [esi + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x138]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov edx, eax
jmp 0x404e65
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf_2
mov edx, eax
jmp 0x404e65
mov dword [esp + 0xc], str.Could_not_create_script_engine_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404edb
mov byte [esi], al
add esi, 1
jmp 0x404650
mov ebx, 0x224c
mov byte [ebp - 0x136], 0x22
lea esi, [ebp - 0x136]
mov word [ebp - 0x138], bx
lea eax, [esi + 1]
jmp 0x405062
mov dword [ebp - 0x16c], 0x409e98
movzx eax, word [ebp - 0x16c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x404505
test byte [0x40708c], 1
je 0x404ddf
mov dword [esp + 0xc], str.Could_not_get_script_text_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404ddf
test byte [0x40708c], 1
je 0x404ddf
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.SetScriptState_failed:__08lx_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404ddf
test byte [0x40708c], 1
je 0x404ddf
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.ParseScriptText_failed:__08lx_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404ddf
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf_2
jmp 0x404f45