Function at 0x404470
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, 0x168
mov esi, dword [ecx]
mov edi, dword [ecx + 4]
mov ebx, dword [ecx + 8]
mov edx, dword [ecx + 0xc]
test byte [0x40608c], 8
jne 0x404d00
call dword [sym.imp.kernel32.dll_GetCommandLineW]
lea edx, [ebp - 0x134]
mov dword [esp], eax
mov dword [esp + 4], edx
call dword [sym.imp.shell32.dll_CommandLineToArgvW]
sub esp, 8
mov edi, eax
test eax, eax
je 0x4045a0
mov edx, dword [ebp - 0x134]
mov ebx, 1
cmp edx, 1
jg 0x40450d
jmp 0x40456a
mov dword [esp + 4], 0x407e80
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404540
mov eax, 0xffffffff
mov word [0x406018], ax
mov edx, dword [ebp - 0x134]
add ebx, 1
cmp edx, ebx
jle 0x40456a
mov ecx, dword [edi + ebx*4]
movzx eax, word [ecx]
mov esi, eax
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404650
lea esi, [ecx + 2]
cmp ax, 0x2f
jne 0x4044e0
cmp word [ecx + 2], 0x2f
jne 0x4044e0
lea esi, [ecx + 4]
jmp 0x4044e0
mov dword [esp + 4], 0x407e84
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x4045b8
mov edx, dword [ebp - 0x134]
add ebx, 1
xor eax, eax
mov word [0x406018], ax
cmp edx, ebx
jg 0x40450d
test byte [0x40608c], 1
je 0x4045a0
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 fcn.00403d40
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 0x404d90
test byte [0x40608c], 1
je 0x404500
mov eax, 0x407e88
shr eax, 0x10
test eax, eax
je 0x404eab
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 0x40461b
mov eax, 0x407e88
call fcn.00403b10
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 fcn.00403d40
jmp 0x404500
lea eax, [edi + ebx*4 + 4]
sub edx, ebx
mov dword [0x411004], eax
lea eax, [ebp - 0x138]
sub edx, 1
mov dword [section..bss], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x411040
mov dword [esp + 4], 0x104
mov dword [esp], ecx
mov dword [ebp - 0x13c], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x4045a0
mov dword [esp + 4], 0x2e
mov eax, dword [ebp - 0x138]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov edi, eax
test eax, eax
je 0x404e97
lea eax, [ebp - 0x12c]
mov esi, dword [sym.imp.advapi32.dll_RegOpenKeyW]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov dword [esp], 0x80000000
call esi
sub esp, 0xc
test eax, eax
jne 0x404e20
lea eax, [ebp - 0x130]
mov ebx, dword [sym.imp.advapi32.dll_RegQueryValueW]
mov dword [ebp - 0x130], 0x40
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x118]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x12c]
mov dword [esp], eax
call ebx
mov edx, dword [sym.imp.advapi32.dll_RegCloseKey]
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x12c]
sub esp, 0x10
mov dword [esp], eax
mov dword [ebp - 0x144], edx
call edx
mov eax, dword [ebp - 0x140]
sub esp, 4
test eax, eax
jne 0x404e20
test byte [0x40608c], 8
mov ecx, dword [ebp - 0x13c]
jne 0x404f49
cmp word [ebp - 0x118], 0
lea edx, [ebp - 0x118]
je 0x404781
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x404778
xor eax, eax
mov dword [ebp - 0x13c], ecx
lea esi, [esi]
movzx ecx, word [eax + str.ScriptEngine]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x404790
lea eax, [ebp - 0x12c]
mov dword [esp], 0x80000000
mov dword [esp + 8], eax
lea eax, [ebp - 0x118]
mov dword [esp + 4], eax
call esi
sub esp, 0xc
test eax, eax
jne 0x404e20
mov dword [ebp - 0x130], 0x40
lea eax, [ebp - 0x130]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x98]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x12c]
mov dword [esp], eax
call ebx
mov ebx, eax
mov eax, dword [ebp - 0x12c]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [ebp - 0x144]
call eax
sub esp, 4
test ebx, ebx
jne 0x404e20
test byte [0x40608c], 8
mov ecx, dword [ebp - 0x13c]
jne 0x405034
lea eax, [ebp - 0x98]
mov dword [ebp - 0x13c], ecx
lea esi, [ebp - 0x128]
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [sym.imp.ole32.dll_CLSIDFromProgID]
mov ecx, dword [ebp - 0x13c]
sub esp, 8
test eax, eax
js 0x404e20
mov dword [ebp - 0x13c], ecx
mov dword [esp], 0
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x98]
sub esp, 4
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40ea38
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [esp], esi
call dword [sym.imp.ole32.dll_CoCreateInstance]
sub esp, 0x14
test eax, eax
js 0x404eea
mov eax, dword [ebp - 0x98]
lea edi, [ebp - 0x118]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40b758
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 0x404eea
mov eax, dword [ebp - 0x118]
lea edi, [ebp - 0x12c]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40b748
mov dword [esp], eax
call dword [edx]
mov ecx, dword [ebp - 0x13c]
sub esp, 0xc
test eax, eax
js 0x404ed9
mov eax, dword [ebp - 0x12c]
mov dword [ebp - 0x13c], ecx
mov esi, dword [ebp - 0x118]
mov dword [ebp - 0x140], eax
lea eax, [ebp - 0x98]
mov dword [esp + 4], eax
mov dword [esp], str.wscript.exe
call dword [sym.imp.oleaut32.dll_LoadTypeLib]
mov ecx, dword [ebp - 0x13c]
sub esp, 8
test eax, eax
js 0x404f13
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x13c], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x411024
mov dword [esp + 4], 0x4081fc
mov dword [esp], eax
call dword [edx + 0x18]
mov ecx, dword [ebp - 0x13c]
sub esp, 0xc
test eax, eax
js 0x404f02
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x13c], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x411020
mov dword [esp + 4], 0x40821c
mov dword [esp], eax
call dword [edx + 0x18]
mov edi, 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 edi, edi
js 0x404f13
mov eax, dword [esi]
mov dword [esp + 4], 0x406044
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x404f13
mov edi, dword [ebp - 0x140]
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x404f13
mov eax, dword [esi]
mov dword [esp + 8], 2
mov dword [esp + 4], str.WScript
mov dword [esp], esi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x404f13
mov eax, dword [esi]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x407e58
mov dword [esp], esi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x404f13
mov eax, dword [esi]
mov dword [esp + 4], 5
mov dword [esp], esi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404f13
mov eax, dword [ebp - 0x12c]
mov dword [ebp - 0x148], 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 ecx, dword [ebp - 0x13c]
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov edi, eax
cmp eax, 0xffffffff
je 0x4050c0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x144], eax
mov dword [esp], edi
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 dword [ebp - 0x140], eax
mov dword [esp], edi
mov edi, dword [sym.imp.kernel32.dll_CloseHandle]
call edi
mov edx, dword [ebp - 0x140]
sub esp, 4
cmp edx, 0xffffffff
je 0x4050c0
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 - 0x140]
sub esp, 0x14
mov dword [ebp - 0x13c], eax
mov dword [esp], edx
call edi
mov edi, dword [ebp - 0x13c]
sub esp, 4
test edi, edi
je 0x4050c0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [ebp - 0x144]
mov dword [esp + 8], edi
mov edi, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [esp + 0xc], eax
call edi
sub esp, 0x18
mov dword [esp + 4], eax
mov dword [ebp - 0x140], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov edx, dword [ebp - 0x140]
sub esp, 8
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x144]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x13c]
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [esp + 8], eax
call edi
mov edi, dword [ebp - 0x13c]
sub esp, 0x18
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x140]
sub esp, 4
test ecx, ecx
je 0x4050c0
mov edi, dword [ebp - 0x148]
mov eax, dword [edi]
mov dword [esp + 4], ecx
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 [ebp - 0x13c], ecx
mov dword [esp], edi
call dword [eax + 0x14]
mov ecx, dword [ebp - 0x13c]
sub esp, 0x28
mov edi, eax
mov dword [esp], ecx
call dword [sym.imp.oleaut32.dll_SysFreeString]
sub esp, 4
test edi, edi
js 0x40512c
mov eax, dword [esi]
mov dword [esp + 4], 1
mov dword [esp], esi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x4050f4
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0x1c]
mov eax, dword [0x411024]
sub esp, 4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [esi]
mov dword [esp], esi
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 dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x4045a5
test ebx, ebx
je 0x404e8d
mov eax, ebx
mov dword [ebp - 0x13c], edx
shr eax, 0x10
test eax, eax
je 0x404e00
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 0x404d4d
mov eax, ebx
call fcn.00403b10
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 fcn.00403d40
jmp 0x40449f
test byte [0x40608c], 1
je 0x4045a0
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x404ec4
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 0x404dd0
mov eax, esi
call fcn.00403b10
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 fcn.00403d40
jmp 0x4045a0
mov dword [esp + 4], ebx
mov dword [esp], str._04x
call fcn.00403ab0
mov edx, dword [ebp - 0x13c]
jmp 0x404d4d
test byte [0x40608c], 1
je 0x4045a0
mov eax, edi
shr eax, 0x10
test eax, eax
je 0x404fd5
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404e60
mov eax, edi
call fcn.00403b10
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 fcn.00403d40
jmp 0x4045a0
mov eax, str._null_
jmp 0x404d4d
test byte [0x40608c], 1
je 0x4045a0
mov eax, str._null_
jmp 0x404e60
mov dword [esp + 4], 0x407e88
mov dword [esp], str._04x
call fcn.00403ab0
jmp 0x40461b
mov dword [esp + 4], esi
mov dword [esp], str._04x
call fcn.00403ab0
jmp 0x404dd0
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 0x404fea
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x4045a0
mov eax, dword [ebp - 0x98]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
je 0x404cd8
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 fcn.00403d40
jmp 0x404cd8
lea eax, [ebp - 0x118]
shr eax, 0x10
test eax, eax
je 0x405013
lea eax, [ebp - 0x118]
mov dword [ebp - 0x13c], ecx
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, dword [ebp - 0x13c]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404f9c
lea eax, [ebp - 0x118]
call fcn.00403b10
mov ecx, dword [ebp - 0x13c]
mov dword [ebp - 0x13c], ecx
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 fcn.00403d40
mov ecx, dword [ebp - 0x13c]
jmp 0x404762
mov dword [esp + 4], edi
mov dword [esp], str._04x
call fcn.00403ab0
jmp 0x404e60
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 fcn.00403d40
jmp 0x404ef7
lea eax, [ebp - 0x118]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00403ab0
mov ecx, dword [ebp - 0x13c]
jmp 0x404f9c
lea eax, [ebp - 0x98]
shr eax, 0x10
test eax, eax
je 0x405164
lea eax, [ebp - 0x98]
mov dword [ebp - 0x13c], ecx
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, dword [ebp - 0x13c]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x405087
lea eax, [ebp - 0x98]
call fcn.00403b10
mov ecx, dword [ebp - 0x13c]
mov dword [ebp - 0x13c], ecx
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 fcn.00403d40
mov ecx, dword [ebp - 0x13c]
jmp 0x404830
test byte [0x40608c], 1
je 0x404cbd
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 fcn.00403d40
jmp 0x404cbd
test byte [0x40608c], 1
je 0x404cbd
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 fcn.00403d40
jmp 0x404cbd
test byte [0x40608c], 1
je 0x404cbd
xor edx, edx
mov dword [esp + 0x10], edi
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 fcn.00403d40
jmp 0x404cbd
lea eax, [ebp - 0x98]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00403ab0
mov ecx, dword [ebp - 0x13c]
jmp 0x405087