Function at 0x404490
Capabilities:
Accept command line arguments
Get file size
Query or enumerate registry value
Read file via mapping

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, 0x178
mov esi, dword [ecx]
mov edi, dword [ecx + 4]
mov ebx, dword [ecx + 8]
mov edx, dword [ecx + 0xc]
test byte [0x40608c], 8
jne 0x404cc0
call dword [sym.imp.kernel32.dll_GetCommandLineW]
lea edx, [ebp - 0x134]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._CommandLineToArgvW_8
sub esp, 8
mov edi, eax
test eax, eax
je 0x4045c0
mov edx, dword [ebp - 0x134]
mov ebx, 1
cmp edx, 1
jg 0x40452d
jmp 0x40458b
mov dword [esp + 4], 0x407e80
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404560
mov eax, 0xffffffff
mov word [0x40f008], ax
mov edx, dword [ebp - 0x134]
add ebx, 1
cmp edx, ebx
jle 0x40458b
mov eax, dword [edi + ebx*4]
movzx ecx, word [eax]
mov esi, ecx
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404670
lea esi, [eax + 2]
cmp cx, 0x2f
jne 0x404500
cmp word [eax + 2], 0x2f
jne 0x404500
lea esi, [eax + 4]
jmp 0x404500
mov dword [esp + 4], 0x407e84
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x4045d8
mov edx, dword [ebp - 0x134]
xor esi, esi
add ebx, 1
mov word [0x40f008], si
cmp edx, ebx
jg 0x40452d
test byte [0x40608c], 1
je 0x4045c0
mov dword [esp + 0xc], str.No_file_name_specified_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
lea esi, [esi]
nop
mov ebx, 1
lea esp, [ebp - 0x10]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov dword [esp + 4], 0x407e88
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404d48
test byte [0x40608c], 1
je 0x404520
mov eax, 0x407e88
shr eax, 0x10
je 0x404e61
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x407e88
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404639
mov eax, 0x407e88
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], 0x4081c8
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404520
mov dword [ebp - 0x13c], eax
mov ecx, eax
sub edx, ebx
lea eax, [edi + ebx*4 + 4]
mov dword [0x40f004], eax
sub edx, 1
lea eax, [ebp - 0x138]
mov dword [section..bss], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x40f040
mov dword [esp + 4], 0x104
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x4045c0
mov dword [esp + 4], 0x2e
mov eax, dword [ebp - 0x138]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov esi, eax
test eax, eax
je 0x404e4d
lea edi, [ebp - 0x12c]
mov dword [esp + 4], eax
mov dword [esp + 8], edi
mov dword [esp], 0x80000000
call sym._RegOpenKeyW_12
sub esp, 0xc
test eax, eax
jne 0x404dd8
lea eax, [ebp - 0x118]
lea ebx, [ebp - 0x130]
mov dword [ebp - 0x130], 0x40
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x12c]
mov dword [esp], eax
call sym._RegQueryValueW_16
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x12c]
sub esp, 0x10
mov dword [esp], eax
call sym._RegCloseKey_4
mov edx, dword [ebp - 0x140]
sub esp, 4
test edx, edx
jne 0x404dd8
test byte [0x40608c], 8
jne 0x404ef6
cmp word [ebp - 0x118], 0
lea edx, [ebp - 0x118]
je 0x404789
nop
add edx, 2
cmp word [edx], 0
jne 0x404780
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [eax + str.ScriptEngine]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x404790
lea eax, [ebp - 0x118]
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov dword [esp], 0x80000000
call sym._RegOpenKeyW_12
sub esp, 0xc
test eax, eax
jne 0x404dd8
mov dword [ebp - 0x130], 0x40
lea eax, [ebp - 0x98]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x12c]
mov dword [esp], eax
call sym._RegQueryValueW_16
mov ebx, eax
mov eax, dword [ebp - 0x12c]
sub esp, 0x10
mov dword [esp], eax
call sym._RegCloseKey_4
sub esp, 4
test ebx, ebx
jne 0x404dd8
test byte [0x40608c], 8
jne 0x404fbb
lea eax, [ebp - 0x128]
mov dword [esp + 4], eax
lea eax, [ebp - 0x98]
mov dword [esp], eax
call sym._CLSIDFromProgID_8
sub esp, 8
test eax, eax
js 0x404dd8
mov dword [esp], 0
call sym._CoInitialize_4
lea eax, [ebp - 0x98]
sub esp, 4
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x128]
mov dword [esp + 0xc], 0x40e2d8
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CoCreateInstance_20
sub esp, 0x14
test eax, eax
js 0x404ea0
mov eax, dword [ebp - 0x98]
lea ecx, [ebp - 0x118]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0x40b048
mov dword [esp], eax
call dword [edx]
mov esi, eax
mov eax, dword [ebp - 0x98]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test esi, esi
js 0x404ea0
mov eax, dword [ebp - 0x118]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40b038
mov dword [esp], eax
call dword [edx]
sub esp, 0xc
test eax, eax
js 0x404e8f
lea eax, [ebp - 0x98]
mov edi, dword [ebp - 0x118]
mov esi, dword [ebp - 0x12c]
mov dword [esp], str.wscript.exe
mov dword [esp + 4], eax
call sym._LoadTypeLib_8
sub esp, 8
test eax, eax
js 0x404ec0
mov eax, dword [ebp - 0x98]
mov edx, dword [eax]
mov dword [esp + 8], 0x40f024
mov dword [esp + 4], 0x4081fc
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
test eax, eax
mov eax, dword [ebp - 0x98]
mov edx, dword [eax]
js 0x404eb7
mov dword [esp + 8], 0x40f020
mov dword [esp + 4], 0x40821c
mov dword [esp], eax
call dword [edx + 0x18]
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x98]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov ecx, dword [ebp - 0x140]
sub esp, 4
test ecx, ecx
js 0x404ec0
mov eax, dword [edi]
mov dword [esp + 4], 0x406044
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x404ec0
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x404ec0
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 0x404ec0
mov eax, dword [edi]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x407e58
mov dword [esp], edi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x404ec0
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404ec0
mov eax, dword [ebp - 0x12c]
mov dword [ebp - 0x144], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov eax, dword [ebp - 0x13c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x405027
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x140], eax
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
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
mov ecx, dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 0x18
mov dword [ebp - 0x13c], eax
mov dword [esp], esi
mov dword [ebp - 0x148], ecx
call ecx
mov edx, dword [ebp - 0x13c]
sub esp, 4
cmp edx, 0xffffffff
je 0x405027
mov dword [esp], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
call dword [sym.imp.kernel32.dll_MapViewOfFile]
mov edx, dword [ebp - 0x13c]
sub esp, 0x14
mov esi, eax
mov dword [esp], edx
mov ecx, dword [ebp - 0x148]
call ecx
sub esp, 4
test esi, esi
je 0x405027
mov dword [esp + 0x14], 0
mov ecx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x10], 0
mov eax, dword [ebp - 0x140]
mov dword [esp + 0xc], eax
mov dword [ebp - 0x13c], esi
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [ebp - 0x14c], ecx
call ecx
sub esp, 0x18
mov dword [esp + 4], eax
mov dword [ebp - 0x148], eax
mov dword [esp], 0
call sym._SysAllocStringLen_8
mov edx, dword [ebp - 0x148]
sub esp, 8
mov esi, eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov edx, dword [ebp - 0x140]
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0x13c]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov dword [esp], 0
mov ecx, dword [ebp - 0x14c]
call ecx
mov eax, dword [ebp - 0x13c]
sub esp, 0x18
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
test esi, esi
je 0x405027
mov edx, dword [ebp - 0x144]
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], esi
call dword [eax + 0x14]
sub esp, 0x28
mov dword [ebp - 0x13c], eax
mov dword [esp], esi
call sym._SysFreeString_4
mov eax, dword [ebp - 0x13c]
sub esp, 4
test eax, eax
js 0x405093
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x40505b
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 0x1c]
mov eax, dword [0x40f024]
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 - 0x12c]
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
call sym._CoUninitialize_0
jmp 0x4045c5
test ebx, ebx
je 0x404e43
mov eax, ebx
mov dword [ebp - 0x13c], edx
shr eax, 0x10
je 0x404db8
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, dword [ebp - 0x13c]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x404d0b
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov edx, dword [ebp - 0x13c]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.__p__p__s__x__n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40608c
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_2
jmp 0x4044bf
test byte [0x40608c], 1
je 0x4045c0
mov eax, esi
shr eax, 0x10
je 0x404e7a
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 0x404d86
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], 0x4081c8
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4045c0
mov dword [esp + 4], ebx
mov dword [esp], str._04x
call dbg.wine_dbg_sprintf
mov edx, dword [ebp - 0x13c]
jmp 0x404d0b
test byte [0x40608c], 1
je 0x4045c0
mov eax, esi
shr eax, 0x10
je 0x404f62
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 0x404e16
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Could_not_find_engine_for__s_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x4045c0
mov eax, str._null_
jmp 0x404d0b
test byte [0x40608c], 1
je 0x4045c0
mov eax, str._null_
jmp 0x404e16
mov dword [esp + 4], 0x407e88
mov dword [esp], str._04x
call dbg.wine_dbg_sprintf
jmp 0x404639
mov dword [esp + 4], esi
mov dword [esp], str._04x
call dbg.wine_dbg_sprintf
jmp 0x404d86
mov eax, dword [ebp - 0x118]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
jne 0x404f77
call sym._CoUninitialize_0
jmp 0x4045c0
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
je 0x404c93
mov dword [esp + 0xc], str.Script_initialization_failed_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404c93
lea eax, [ebp - 0x118]
shr eax, 0x10
je 0x404fa0
lea eax, [ebp - 0x118]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404f35
lea eax, [ebp - 0x118]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.fileid_is__s_n
mov dword [esp + 8], str.get_engine_clsid
mov dword [esp + 4], 0x40608c
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_2
jmp 0x40476f
mov dword [esp + 4], esi
mov dword [esp], str._04x
call dbg.wine_dbg_sprintf
jmp 0x404e16
mov dword [esp + 0xc], str.Could_not_create_script_engine_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0_2
jmp 0x404ead
lea eax, [ebp - 0x118]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call dbg.wine_dbg_sprintf
jmp 0x404f35
lea eax, [ebp - 0x98]
shr eax, 0x10
je 0x4050cb
lea eax, [ebp - 0x98]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404ffa
lea eax, [ebp - 0x98]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.ProgID_is__s_n
mov dword [esp + 8], str.get_engine_clsid
mov dword [esp + 4], 0x40608c
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_2
jmp 0x404821
test byte [0x40608c], 1
je 0x404c78
xor ecx, ecx
mov dword [esp + 0xc], str.Could_not_get_script_text_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40608c
mov dword [esp], ecx
call sym._wine_dbg_log.constprop.0_2
jmp 0x404c78
test byte [0x40608c], 1
je 0x404c78
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], str.SetScriptState_failed:__08lx_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40608c
mov dword [esp], eax
call sym._wine_dbg_log.constprop.0_2
jmp 0x404c78
test byte [0x40608c], 1
je 0x404c78
xor edx, edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.ParseScriptText_failed:__08lx_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40608c
mov dword [esp], edx
call sym._wine_dbg_log.constprop.0_2
jmp 0x404c78
lea eax, [ebp - 0x98]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call dbg.wine_dbg_sprintf
jmp 0x404ffa