Function at 0x404840
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, 0x184
mov ebx, dword [ebp + 0x10]
test byte [0x407090], 8
jne 0x404b60
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]
sub esp, 8
mov edi, eax
test eax, eax
je 0x404955
mov edx, dword [ebp - 0x150]
cmp edx, 1
jle 0x404948
mov eax, 0x408964
mov ebx, 1
shr eax, 0x10
mov dword [ebp - 0x164], eax
mov eax, 0x408968
shr eax, 0x10
mov dword [ebp - 0x160], eax
mov eax, 0x40896c
shr eax, 0x10
mov dword [ebp - 0x15c], eax
jmp 0x4048f3
mov dword [esp + 4], 0x40897a
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404920
mov eax, 0xffffffff
mov word [0x4073c8], ax
mov edx, dword [ebp - 0x150]
inc ebx
cmp edx, ebx
jle 0x404948
mov ecx, dword [edi + ebx*4]
movzx eax, word [ecx]
mov esi, eax
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404a00
lea esi, [ecx + 2]
cmp ax, 0x2f
jne 0x4048c8
cmp word [ecx + 2], 0x2f
jne 0x4048c8
lea esi, [ecx + 4]
jmp 0x4048c8
mov dword [esp + 4], 0x40897e
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404968
mov edx, dword [ebp - 0x150]
xor eax, eax
inc ebx
mov word [0x4073c8], ax
cmp edx, ebx
jg 0x4048f3
test byte [0x407090], 1
jne 0x404cb0
mov eax, 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 4], 0x40896c
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404c40
test byte [0x407090], 1
je 0x4048e8
mov esi, dword [ebp - 0x15c]
test esi, esi
je 0x4052ff
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x40896c
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x4049c9
mov eax, 0x40896c
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], str.set_host_properties
mov dword [esp + 4], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4048e8
lea eax, [edi + ebx*4 + 4]
dec edx
mov dword [esp], ecx
mov dword [0x4070a8], eax
sub edx, ebx
lea eax, [ebp - 0x158]
mov dword [0x407164], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x4071a0
mov dword [esp + 4], 0x104
mov dword [ebp - 0x15c], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
dec eax
sub esp, 0x10
cmp eax, 0x103
ja 0x404955
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 0x405325
lea edx, [ebp - 0x148]
call sym._get_engine_clsid
test eax, eax
jne 0x404e98
test byte [0x407090], 1
je 0x404955
mov eax, ebx
shr eax, 0x10
je 0x40554c
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 0x405337
cmp word [ebx], 0
je 0x405597
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404ac8
mov esi, 0x224c
lea edi, [ebp - 0x16]
mov word [ebp - 0x138], si
lea esi, [ebp - 0x136]
jmp 0x404b25
cmp ax, 9
je 0x405488
cmp ax, 0xa
jne 0x4054a6
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
lea eax, [edx - 1]
cmp esi, edi
ja 0x405519
test edx, edx
jle 0x405519
mov edx, eax
movzx eax, word [ebx]
add ebx, 2
cmp ax, 0xd
je 0x4054f7
jbe 0x404aec
cmp ax, 0x22
je 0x405508
cmp ax, 0x5c
jne 0x405499
mov eax, 0x5c5c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b10
test ebx, ebx
je 0x4052f5
mov eax, ebx
shr eax, 0x10
je 0x404ce0
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 0x404cf3
movzx eax, word [ebx]
test ax, ax
je 0x4053b8
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404ba8
mov ecx, 0x224c
lea esi, [ebp - 0x136]
lea edi, [ebp - 0x16]
mov word [ebp - 0x138], cx
jmp 0x404c08
cmp ax, 9
je 0x404e40
cmp ax, 0xa
jne 0x404db5
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea ecx, [edx - 1]
test edx, edx
jle 0x404e58
cmp esi, edi
ja 0x404e58
movzx eax, word [ebx]
mov edx, ecx
add ebx, 2
cmp ax, 0xd
je 0x404e28
jbe 0x404bd0
cmp ax, 0x22
je 0x404e10
cmp ax, 0x5c
jne 0x404da8
mov ecx, 0x5c5c
add esi, 2
mov word [esi - 2], cx
jmp 0x404bf0
mov dword [esp + 4], 0x408968
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404d38
test byte [0x407090], 1
je 0x4048e8
mov ecx, dword [ebp - 0x160]
test ecx, ecx
je 0x405369
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x408968
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x4049c9
mov eax, 0x408968
call sym._wine_dbgstr_wn.part.0.constprop.0_1
jmp 0x4049c9
mov dword [esp + 0xc], str.No_file_name_specified_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
mov eax, 1
jmp 0x40495a
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], 0x407090
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_2
jmp 0x40485c
mov dword [esp + 4], 0x408964
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x4053d9
test byte [0x407090], 1
je 0x4048e8
mov edx, dword [ebp - 0x164]
test edx, edx
je 0x4055b8
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x408964
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x4049c9
mov eax, 0x408964
call sym._wine_dbgstr_wn.part.0.constprop.0_1
jmp 0x4049c9
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x404e90
mov ecx, eax
mov byte [esi], 0x5c
add esi, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdef0123456789abcdef]
mov byte [esi - 4], cl
mov ecx, eax
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdef0123456789abcdef]
mov byte [esi - 3], cl
mov ecx, eax
and eax, 0xf
shr cx, 4
movzx eax, byte [eax + str.0123456789abcdef0123456789abcdef]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdef0123456789abcdef]
mov byte [esi - 1], al
mov byte [esi - 2], cl
jmp 0x404bf0
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404bf0
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404bf0
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404bf0
mov byte [esi], 0x22
test ecx, ecx
jle 0x4053d1
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 0x404cf3
mov byte [esi], al
inc esi
jmp 0x404bf0
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], 0x40ef00
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 0x4053a0
mov eax, dword [ebp - 0x138]
lea esi, [ebp - 0x14c]
mov edx, dword [eax]
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40b670
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 0x4053a0
mov eax, dword [ebp - 0x14c]
lea esi, [ebp - 0x154]
mov edx, dword [eax]
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40b6c0
mov dword [esp], eax
call dword [edx]
mov ecx, dword [ebp - 0x15c]
sub esp, 0xc
test eax, eax
js 0x40538f
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 0x405452
mov eax, dword [ebp - 0x138]
mov dword [ebp - 0x15c], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x4070c4
mov dword [esp + 4], 0x40d190
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
test eax, eax
mov eax, dword [ebp - 0x138]
mov edx, dword [eax]
js 0x405449
mov dword [esp + 8], 0x4070a4
mov dword [esp + 4], 0x40b870
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 0x405452
mov eax, dword [edi]
mov dword [esp + 4], 0x4073c0
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x405452
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x405452
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 0x405452
mov eax, dword [edi]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x408904
mov dword [esp], edi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x405452
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x405452
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 0x4055de
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 0x4055de
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 edx, dword [ebp - 0x15c]
sub esp, 4
test edx, edx
je 0x4055de
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], edx
mov esi, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call esi
sub esp, 0x18
mov dword [ebp - 0x168], 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], edx
mov edx, dword [ebp - 0x15c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call esi
mov edx, dword [ebp - 0x15c]
sub esp, 0x18
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
test ebx, ebx
je 0x4055de
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 0x40564e
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x405614
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 0x1c]
mov eax, dword [0x4070c4]
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 0x40495a
mov eax, str._null_
jmp 0x404cf3
mov dword [ebp - 0x168], 0x40896c
movzx eax, word [ebp - 0x168]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x4049c9
test byte [0x407090], 1
je 0x404955
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], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
mov eax, 1
jmp 0x40495a
mov dword [ebp - 0x168], 0x408968
movzx eax, word [ebp - 0x168]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x4049c9
mov eax, dword [ebp - 0x14c]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x407090], 1
jne 0x405566
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x404955
mov eax, 0x224c
mov byte [ebp - 0x136], 0x22
lea esi, [ebp - 0x136]
mov word [ebp - 0x138], ax
lea eax, [esi + 1]
jmp 0x404e73
test byte [0x407090], 1
je 0x404955
mov eax, esi
shr eax, 0x10
je 0x405688
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 0x405417
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], str.set_host_properties
mov dword [esp + 4], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
mov eax, 1
jmp 0x40495a
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x407090], 1
je 0x4052cc
mov dword [esp + 0xc], str.Script_initialization_failed_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4052cc
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b10
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x40558f
mov ecx, eax
mov byte [esi], 0x5c
add esi, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdef0123456789abcdef]
mov byte [esi - 4], cl
mov ecx, eax
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdef0123456789abcdef]
mov byte [esi - 3], cl
mov ecx, eax
and eax, 0xf
shr cx, 4
movzx eax, byte [eax + str.0123456789abcdef0123456789abcdef]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdef0123456789abcdef]
mov byte [esi - 1], al
mov byte [esi - 2], cl
jmp 0x404b10
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b10
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b10
mov byte [esi], 0x22
test eax, eax
jle 0x4055b0
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 0x405337
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf_2
mov edx, eax
jmp 0x405337
mov dword [esp + 0xc], str.Could_not_create_script_engine_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4053ad
mov byte [esi], al
inc esi
jmp 0x404b10
mov ebx, 0x224c
mov byte [ebp - 0x136], 0x22
lea esi, [ebp - 0x136]
mov word [ebp - 0x138], bx
lea eax, [esi + 1]
jmp 0x405534
mov dword [ebp - 0x168], 0x408964
movzx eax, word [ebp - 0x168]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x4049c9
test byte [0x407090], 1
je 0x4052b1
mov dword [esp + 0xc], str.Could_not_get_script_text_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4052b1
test byte [0x407090], 1
je 0x4052b1
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], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4052b1
test byte [0x407090], 1
je 0x4052b1
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], 0x407090
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4052b1
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf_2
jmp 0x405417