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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x15c
test byte [0x40608c], 8
jne 0x404bb8
call dword [sym.imp.kernel32.dll_GetCommandLineW]
lea edx, [ebp - 0x128]
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 0x404450
mov edx, dword [ebp - 0x128]
mov ebx, 1
cmp edx, 1
jg 0x4043c5
jmp 0x40441a
mov dword [esp + 4], 0x407e80
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x4043f0
mov eax, 0xffffffff
mov word [0x406018], ax
mov edx, dword [ebp - 0x128]
add ebx, 1
cmp edx, ebx
jle 0x40441a
mov ecx, dword [edi + ebx*4]
movzx eax, word [ecx]
mov esi, eax
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404500
lea esi, [ecx + 2]
cmp ax, 0x2f
jne 0x404398
cmp word [ecx + 2], 0x2f
jne 0x404398
lea esi, [ecx + 4]
jmp 0x404398
mov dword [esp + 4], 0x407e84
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404468
mov edx, dword [ebp - 0x128]
add ebx, 1
xor eax, eax
mov word [0x406018], ax
cmp edx, ebx
jg 0x4043c5
test byte [0x40608c], 1
je 0x404450
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.00403c50
lea esi, [esi]
nop
mov ebx, 1
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 4], 0x407e88
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404c40
test byte [0x40608c], 1
je 0x4043b8
mov eax, 0x407e88
shr eax, 0x10
test eax, eax
je 0x404d5b
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 0x4044cb
mov eax, 0x407e88
call fcn.00403a10
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.00403c50
jmp 0x4043b8
lea eax, [edi + ebx*4 + 4]
sub edx, ebx
mov dword [0x411004], eax
lea eax, [ebp - 0x12c]
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 - 0x130], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x404450
mov dword [esp + 4], 0x2e
mov eax, dword [ebp - 0x12c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov edi, eax
test eax, eax
je 0x404d47
lea eax, [ebp - 0x120]
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 0x404cd0
lea eax, [ebp - 0x124]
mov ebx, dword [sym.imp.advapi32.dll_RegQueryValueW]
mov dword [ebp - 0x124], 0x40
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x10c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
call ebx
mov edx, dword [sym.imp.advapi32.dll_RegCloseKey]
mov dword [ebp - 0x134], eax
mov eax, dword [ebp - 0x120]
sub esp, 0x10
mov dword [esp], eax
mov dword [ebp - 0x138], edx
call edx
mov eax, dword [ebp - 0x134]
sub esp, 4
test eax, eax
jne 0x404cd0
test byte [0x40608c], 8
mov ecx, dword [ebp - 0x130]
jne 0x404df9
cmp word [ebp - 0x10c], 0
lea edx, [ebp - 0x10c]
je 0x404631
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x404628
xor eax, eax
mov dword [ebp - 0x130], ecx
lea esi, [esi]
movzx ecx, word [eax + str.ScriptEngine]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x404640
lea eax, [ebp - 0x120]
mov dword [esp], 0x80000000
mov dword [esp + 8], eax
lea eax, [ebp - 0x10c]
mov dword [esp + 4], eax
call esi
sub esp, 0xc
test eax, eax
jne 0x404cd0
mov dword [ebp - 0x124], 0x40
lea eax, [ebp - 0x124]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x8c]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
call ebx
mov ebx, eax
mov eax, dword [ebp - 0x120]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [ebp - 0x138]
call eax
sub esp, 4
test ebx, ebx
jne 0x404cd0
test byte [0x40608c], 8
mov ecx, dword [ebp - 0x130]
jne 0x404ee4
lea eax, [ebp - 0x8c]
mov dword [ebp - 0x130], ecx
lea esi, [ebp - 0x11c]
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [sym.imp.ole32.dll_CLSIDFromProgID]
mov ecx, dword [ebp - 0x130]
sub esp, 8
test eax, eax
js 0x404cd0
mov dword [ebp - 0x130], ecx
mov dword [esp], 0
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x8c]
sub esp, 4
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40eab8
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 0x404d9a
mov eax, dword [ebp - 0x8c]
lea edi, [ebp - 0x10c]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40b7d8
mov dword [esp], eax
call dword [edx]
mov esi, eax
mov eax, dword [ebp - 0x8c]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test esi, esi
js 0x404d9a
mov eax, dword [ebp - 0x10c]
lea edi, [ebp - 0x120]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40b7c8
mov dword [esp], eax
call dword [edx]
mov ecx, dword [ebp - 0x130]
sub esp, 0xc
test eax, eax
js 0x404d89
lea eax, [ebp - 0x8c]
mov dword [ebp - 0x130], ecx
mov edi, dword [ebp - 0x10c]
mov esi, dword [ebp - 0x120]
mov dword [esp + 4], eax
mov dword [esp], str.wscript.exe
call dword [sym.imp.oleaut32.dll_LoadTypeLib]
mov ecx, dword [ebp - 0x130]
sub esp, 8
test eax, eax
js 0x404dc3
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x130], 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 - 0x130]
sub esp, 0xc
test eax, eax
js 0x404db2
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x134], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x411020
mov dword [esp + 4], 0x40821c
mov dword [esp], eax
call dword [edx + 0x18]
mov dword [ebp - 0x130], eax
mov eax, dword [ebp - 0x8c]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov eax, dword [ebp - 0x130]
sub esp, 4
test eax, eax
js 0x404dc3
mov eax, dword [edi]
mov dword [esp + 4], 0x406044
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x404dc3
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x404dc3
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 0x404dc3
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 0x404dc3
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404dc3
mov eax, dword [ebp - 0x120]
mov dword [ebp - 0x138], 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 - 0x134]
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x404f70
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x134], 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 - 0x130], eax
mov dword [esp], esi
mov dword [ebp - 0x13c], ecx
call ecx
mov edx, dword [ebp - 0x130]
sub esp, 4
cmp edx, 0xffffffff
je 0x404f70
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 - 0x130]
sub esp, 0x14
mov esi, eax
mov dword [esp], edx
mov ecx, dword [ebp - 0x13c]
call ecx
sub esp, 4
test esi, esi
je 0x404f70
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [ebp - 0x134]
mov dword [esp + 0xc], eax
mov dword [ebp - 0x130], esi
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [ebp - 0x140], edx
call edx
sub esp, 0x18
mov dword [esp + 4], eax
mov dword [ebp - 0x13c], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov ecx, dword [ebp - 0x13c]
sub esp, 8
mov esi, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
mov edx, dword [ebp - 0x134]
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0x130]
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x140]
call edx
mov eax, dword [ebp - 0x130]
sub esp, 0x18
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
test esi, esi
je 0x404f70
mov edx, dword [ebp - 0x138]
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 - 0x130], eax
mov dword [esp], esi
call dword [sym.imp.oleaut32.dll_SysFreeString]
mov eax, dword [ebp - 0x130]
sub esp, 4
test eax, eax
js 0x404fdc
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404fa4
mov eax, dword [edi]
mov dword [esp], edi
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 [edi]
mov dword [esp], edi
call dword [eax + 8]
mov eax, dword [ebp - 0x120]
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 0x404455
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x404d3d
mov eax, dword [ebp + 0x10]
shr eax, 0x10
test eax, eax
je 0x404cb0
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp + 0x10]
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 0x404bfb
mov eax, dword [ebp + 0x10]
call fcn.00403a10
mov edx, dword [ebp + 0x14]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], str.__p__p__s__x__n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40608c
mov dword [esp + 0x10], eax
mov dword [esp], 3
call fcn.00403c50
jmp 0x404359
test byte [0x40608c], 1
je 0x404450
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x404d74
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 0x404c80
mov eax, esi
call fcn.00403a10
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.00403c50
jmp 0x404450
mov eax, dword [ebp + 0x10]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039b0
jmp 0x404bfb
test byte [0x40608c], 1
je 0x404450
mov eax, edi
shr eax, 0x10
test eax, eax
je 0x404e85
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 0x404d10
mov eax, edi
call fcn.00403a10
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.00403c50
jmp 0x404450
mov eax, str._null_
jmp 0x404bfb
test byte [0x40608c], 1
je 0x404450
mov eax, str._null_
jmp 0x404d10
mov dword [esp + 4], 0x407e88
mov dword [esp], str._04x
call fcn.004039b0
jmp 0x4044cb
mov dword [esp + 4], esi
mov dword [esp], str._04x
call fcn.004039b0
jmp 0x404c80
mov eax, dword [ebp - 0x10c]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
jne 0x404e9a
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x404450
mov eax, dword [ebp - 0x8c]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
je 0x404b8e
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.00403c50
jmp 0x404b8e
lea eax, [ebp - 0x10c]
shr eax, 0x10
test eax, eax
je 0x404ec3
lea eax, [ebp - 0x10c]
mov dword [ebp - 0x130], ecx
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, dword [ebp - 0x130]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404e4c
lea eax, [ebp - 0x10c]
call fcn.00403a10
mov ecx, dword [ebp - 0x130]
mov dword [ebp - 0x130], 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.00403c50
mov ecx, dword [ebp - 0x130]
jmp 0x404612
mov dword [esp + 4], edi
mov dword [esp], str._04x
call fcn.004039b0
jmp 0x404d10
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.00403c50
jmp 0x404da7
lea eax, [ebp - 0x10c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039b0
mov ecx, dword [ebp - 0x130]
jmp 0x404e4c
lea eax, [ebp - 0x8c]
shr eax, 0x10
test eax, eax
je 0x405014
lea eax, [ebp - 0x8c]
mov dword [ebp - 0x130], ecx
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, dword [ebp - 0x130]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404f37
lea eax, [ebp - 0x8c]
call fcn.00403a10
mov ecx, dword [ebp - 0x130]
mov dword [ebp - 0x130], 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.00403c50
mov ecx, dword [ebp - 0x130]
jmp 0x4046e0
test byte [0x40608c], 1
je 0x404b73
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.00403c50
jmp 0x404b73
test byte [0x40608c], 1
je 0x404b73
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.00403c50
jmp 0x404b73
test byte [0x40608c], 1
je 0x404b73
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 fcn.00403c50
jmp 0x404b73
lea eax, [ebp - 0x8c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039b0
mov ecx, dword [ebp - 0x130]
jmp 0x404f37