Function at 0x4047c0
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, 0x19c
mov ebx, dword [ebp + 0x10]
test byte [0x407090], 8
jne 0x404ad0
call dword [sym.imp.kernel32.dll_GetCommandLineW]
lea edx, [ebp - 0x15c]
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 0x4048c6
mov edx, dword [ebp - 0x15c]
cmp edx, 1
jle 0x4048b9
mov eax, str.nologo
mov ebx, 1
shr eax, 0x10
mov dword [ebp - 0x16c], eax
jmp 0x40485c
mov dword [esp + 4], 0x408972
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404890
mov esi, 0xffffffff
mov word [0x4073c8], si
mov edx, dword [ebp - 0x15c]
inc ebx
cmp edx, ebx
jle 0x4048b9
mov ecx, dword [edi + ebx*4]
movzx eax, word [ecx]
mov esi, eax
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404970
lea esi, [ecx + 2]
cmp ax, 0x2f
jne 0x404830
cmp word [ecx + 2], 0x2f
jne 0x404830
lea esi, [ecx + 4]
jmp 0x404830
mov dword [esp + 4], 0x408976
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x4048d8
mov edx, dword [ebp - 0x15c]
xor ecx, ecx
inc ebx
mov word [0x4073c8], cx
cmp edx, ebx
jg 0x40485c
test byte [0x407090], 1
jne 0x404c20
mov eax, 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 4], str.nologo
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404bb0
test byte [0x407090], 1
je 0x404851
mov edx, dword [ebp - 0x16c]
test edx, edx
je 0x40523b
mov dword [esp + 4], 0xffffffff
mov dword [esp], str.nologo
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404939
mov eax, str.nologo
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 0x404851
lea eax, [edi + ebx*4 + 4]
dec edx
mov dword [esp], ecx
mov dword [0x4070a8], eax
sub edx, ebx
lea eax, [ebp - 0x164]
mov dword [0x407164], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x4071a0
mov dword [esp + 4], 0x104
mov dword [ebp - 0x16c], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
dec eax
sub esp, 0x10
cmp eax, 0x103
ja 0x4048c6
mov eax, dword [ebp - 0x164]
mov dword [esp + 4], 0x2e
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov ebx, eax
test eax, eax
je 0x4051f7
lea edx, [ebp - 0x154]
call sym._get_engine_clsid
test eax, eax
jne 0x404d90
test byte [0x407090], 1
je 0x4048c6
mov eax, ebx
shr eax, 0x10
je 0x4053c6
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 0x405209
cmp word [ebx], 0
je 0x405411
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404a38
mov esi, 0x224c
lea edi, [ebp - 0x22]
mov word [ebp - 0x144], si
lea esi, [ebp - 0x142]
jmp 0x404a95
cmp ax, 9
je 0x405313
cmp ax, 0xa
jne 0x405331
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
lea eax, [edx - 1]
cmp esi, edi
ja 0x405393
test edx, edx
jle 0x405393
mov edx, eax
movzx eax, word [ebx]
add ebx, 2
cmp ax, 0xd
je 0x405302
jbe 0x404a5c
cmp ax, 0x22
je 0x405382
cmp ax, 0x5c
jne 0x405324
mov eax, 0x5c5c
add esi, 2
mov word [esi - 2], ax
jmp 0x404a80
test ebx, ebx
je 0x4051ed
mov eax, ebx
shr eax, 0x10
je 0x404c50
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 0x404c63
movzx eax, word [ebx]
test ax, ax
je 0x4052a2
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404b18
mov ecx, 0x224c
lea esi, [ebp - 0x142]
lea edi, [ebp - 0x22]
mov word [ebp - 0x144], cx
jmp 0x404b78
cmp ax, 9
je 0x404d38
cmp ax, 0xa
jne 0x404cb2
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea ecx, [edx - 1]
test edx, edx
jle 0x404d50
cmp esi, edi
ja 0x404d50
movzx eax, word [ebx]
mov edx, ecx
add ebx, 2
cmp ax, 0xd
je 0x404d20
jbe 0x404b40
cmp ax, 0x22
je 0x404d08
cmp ax, 0x5c
jne 0x404ca5
mov eax, 0x5c5c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b60
test byte [0x407090], 1
je 0x4048c6
mov eax, esi
shr eax, 0x10
je 0x405261
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 0x404bee
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 0x4048cb
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 0x4048cb
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 0x4047dc
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x404d88
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 0x404b60
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b60
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b60
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404b60
mov byte [esi], 0x22
test ecx, ecx
jle 0x4052bb
mov edi, 0x2e2e
mov byte [esi + 3], 0x2e
lea eax, [esi + 4]
mov word [esi + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x144]
mov dword [esp], eax
call sym.___wine_dbg_strdup
jmp 0x404c63
mov byte [esi], al
inc esi
jmp 0x404b60
mov dword [esp], 0
lea ebx, [ebp - 0x144]
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x154]
sub esp, 4
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x40eee0
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 0x40528a
mov eax, dword [ebp - 0x144]
lea esi, [ebp - 0x158]
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 - 0x144]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test esi, esi
js 0x40528a
mov eax, dword [ebp - 0x158]
lea esi, [ebp - 0x160]
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 - 0x16c]
sub esp, 0xc
test eax, eax
js 0x405279
mov edi, dword [ebp - 0x158]
mov esi, dword [ebp - 0x160]
mov dword [esp + 4], ebx
mov dword [ebp - 0x16c], ecx
mov dword [esp], str.wscript.exe
call dword [sym.imp.oleaut32.dll_LoadTypeLib]
mov ecx, dword [ebp - 0x16c]
sub esp, 8
test eax, eax
js 0x4052cc
mov eax, dword [ebp - 0x144]
mov dword [ebp - 0x16c], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x4070c4
mov dword [esp + 4], 0x40d170
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
test eax, eax
mov eax, dword [ebp - 0x144]
mov edx, dword [eax]
js 0x4052c3
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 - 0x144]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test ebx, ebx
js 0x4052cc
mov eax, dword [edi]
mov dword [esp + 4], 0x4073c0
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x4052cc
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x4052cc
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 0x4052cc
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 0x4052cc
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x4052cc
mov eax, dword [ebp - 0x160]
mov ecx, dword [ebp - 0x16c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 1
mov dword [ebp - 0x174], 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 0x405432
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x170], 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 0x405432
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 - 0x16c], eax
mov dword [esp], ebx
call esi
mov edx, dword [ebp - 0x16c]
sub esp, 4
test edx, edx
je 0x405432
mov eax, dword [ebp - 0x170]
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 - 0x178], eax
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov edx, dword [ebp - 0x178]
sub esp, 8
mov ebx, eax
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0x16c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x170]
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 - 0x16c]
sub esp, 0x18
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
test ebx, ebx
je 0x405432
mov edx, dword [ebp - 0x174]
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 0x4054a2
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x405468
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 - 0x160]
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 0x4048cb
mov eax, str._null_
jmp 0x404c63
test byte [0x407090], 1
je 0x4048c6
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 0x4048cb
mov dword [ebp - 0x170], str.nologo
movzx eax, word [ebp - 0x170]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf_2
jmp 0x404939
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf_2
jmp 0x404bee
mov eax, dword [ebp - 0x158]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x407090], 1
jne 0x4053e0
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x4048c6
mov eax, 0x224c
mov byte [ebp - 0x142], 0x22
lea esi, [ebp - 0x142]
mov word [ebp - 0x144], ax
lea eax, [esi + 1]
jmp 0x404d6b
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x407090], 1
je 0x4051c4
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 0x4051c4
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404a80
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404a80
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x405409
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 0x404a80
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404a80
mov byte [esi], 0x22
test eax, eax
jle 0x40542a
mov edi, 0x2e2e
mov byte [esi + 3], 0x2e
lea eax, [esi + 4]
mov word [esi + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x144]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov edx, eax
jmp 0x405209
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf_2
mov edx, eax
jmp 0x405209
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 0x405297
mov byte [esi], al
inc esi
jmp 0x404a80
mov ebx, 0x224c
mov byte [ebp - 0x142], 0x22
lea esi, [ebp - 0x142]
mov word [ebp - 0x144], bx
lea eax, [esi + 1]
jmp 0x4053ae
test byte [0x407090], 1
je 0x4051a9
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 0x4051a9
test byte [0x407090], 1
je 0x4051a9
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 0x4051a9
test byte [0x407090], 1
je 0x4051a9
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 0x4051a9