Function at 0x404380
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 0x404bc0
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 0x404490
mov edx, dword [ebp - 0x128]
mov ebx, 1
cmp edx, 1
jg 0x404405
jmp 0x40445a
mov dword [esp + 4], 0x408e80
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404430
mov eax, 0xffffffff
mov word [0x406018], ax
mov edx, dword [ebp - 0x128]
add ebx, 1
cmp edx, ebx
jle 0x40445a
mov eax, dword [edi + ebx*4]
movzx ecx, word [eax]
mov esi, ecx
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404540
lea esi, [eax + 2]
cmp cx, 0x2f
jne 0x4043d8
cmp word [eax + 2], 0x2f
jne 0x4043d8
lea esi, [eax + 4]
jmp 0x4043d8
mov dword [esp + 4], 0x408e84
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x4044a8
mov edx, dword [ebp - 0x128]
add ebx, 1
xor eax, eax
mov word [0x406018], ax
cmp edx, ebx
jg 0x404405
test byte [0x40608c], 1
je 0x404490
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.00403c80
lea esi, cs:[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], 0x408e88
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404c48
test byte [0x40608c], 1
je 0x4043f8
mov eax, 0x408e88
shr eax, 0x10
test eax, eax
je 0x404dbf
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x408e88
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x40450b
mov eax, 0x408e88
call fcn.00403a40
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.ignored__s_switch_n
mov dword [esp + 8], 0x4091c8
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call fcn.00403c80
jmp 0x4043f8
mov dword [ebp - 0x130], eax
mov ecx, eax
sub edx, ebx
lea eax, [edi + ebx*4 + 4]
sub edx, 1
mov dword [0x412004], eax
lea eax, [ebp - 0x12c]
mov dword [section..bss], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x412040
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 0x404490
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 0x404dd8
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 0x404d48
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]
sub esp, 0x10
mov dword [ebp - 0x134], eax
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
mov dword [ebp - 0x138], edx
call edx
mov eax, dword [ebp - 0x134]
sub esp, 4
test eax, eax
jne 0x404d48
test byte [0x40608c], 8
jne 0x404ecf
cmp word [ebp - 0x10c], 0
lea edx, [ebp - 0x10c]
je 0x404669
nop
add edx, 2
cmp word [edx], 0
jne 0x404660
xor eax, eax
lea esi, cs:[esi]
lea esi, cs:[esi]
lea esi, cs:[esi]
movzx ecx, word [eax + str.ScriptEngine]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x404680
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 0x404d48
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 0x404d48
test byte [0x40608c], 8
jne 0x404f94
lea eax, [ebp - 0x8c]
lea esi, [ebp - 0x11c]
mov dword [esp], eax
mov dword [esp + 4], esi
call dword [sym.imp.ole32.dll_CLSIDFromProgID]
sub esp, 8
test eax, eax
js 0x404d48
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], 0x40fad8
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 0x404e10
mov eax, dword [ebp - 0x8c]
lea edi, [ebp - 0x10c]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40c7d8
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 0x404e10
mov eax, dword [ebp - 0x10c]
lea edi, [ebp - 0x120]
mov edx, dword [eax]
mov dword [esp + 8], edi
mov dword [esp + 4], 0x40c7c8
mov dword [esp], eax
call dword [edx]
mov edi, dword [ebp - 0x10c]
sub esp, 0xc
test eax, eax
js 0x404e05
lea eax, [ebp - 0x8c]
mov esi, dword [ebp - 0x120]
mov dword [esp], str.wscript.exe
mov dword [esp + 4], eax
call dword [sym.imp.oleaut32.dll_LoadTypeLib]
sub esp, 8
test eax, eax
js 0x404e99
mov eax, dword [ebp - 0x8c]
mov edx, dword [eax]
mov dword [esp + 8], 0x412024
mov dword [esp + 4], 0x4091fc
mov dword [esp], eax
call dword [edx + 0x18]
mov ecx, eax
mov eax, dword [ebp - 0x8c]
sub esp, 0xc
test ecx, ecx
mov edx, dword [eax]
js 0x404e90
mov dword [esp + 8], 0x412020
mov dword [esp + 4], 0x40921c
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
mov dword [ebp - 0x134], eax
mov eax, dword [ebp - 0x8c]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov eax, dword [ebp - 0x134]
sub esp, 4
test eax, eax
js 0x404e99
mov eax, dword [edi]
mov dword [esp + 4], 0x406044
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x404e99
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x404e99
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 0x404e99
mov eax, dword [edi]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x408e58
mov dword [esp], edi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x404e99
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404e99
mov eax, dword [ebp - 0x120]
mov dword [ebp - 0x13c], 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 - 0x130]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x40501d
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 edx, dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 0x18
mov dword [ebp - 0x130], eax
mov dword [esp], esi
mov dword [ebp - 0x138], edx
call edx
mov ecx, dword [ebp - 0x130]
sub esp, 4
cmp ecx, 0xffffffff
je 0x40501d
mov dword [esp], ecx
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 ecx, dword [ebp - 0x130]
sub esp, 0x14
mov esi, eax
mov dword [esp], ecx
mov edx, dword [ebp - 0x138]
call edx
sub esp, 4
test esi, esi
je 0x40501d
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 - 0x138], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov ecx, dword [ebp - 0x138]
sub esp, 8
mov esi, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp - 0x134]
mov dword [esp + 0xc], ecx
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 0x40501d
mov ecx, dword [ebp - 0x13c]
mov eax, dword [ecx]
mov dword [esp], 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 [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 0x40509e
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x405066
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 0x1c]
mov eax, dword [0x412024]
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 0x404495
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x404db5
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 0x404c03
mov eax, dword [ebp + 0x10]
call fcn.00403a40
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.00403c80
jmp 0x404399
mov dword [esp + 4], 0x408eaa
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404cd0
test byte [0x40608c], 1
je 0x4043f8
mov eax, 0x408eaa
shr eax, 0x10
test eax, eax
je 0x404dec
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x408eaa
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x40450b
mov eax, 0x408eaa
call fcn.00403a40
jmp 0x40450b
mov eax, dword [ebp + 0x10]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039e0
jmp 0x404c03
mov dword [esp + 4], 0x408eae
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
mov edx, eax
movzx eax, byte [0x40608c]
and eax, 1
test edx, edx
jne 0x404e28
test al, al
je 0x4043f8
mov eax, 0x408eae
shr eax, 0x10
test eax, eax
je 0x404f7b
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0x408eae
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x40450b
mov eax, 0x408eae
call fcn.00403a40
jmp 0x40450b
test byte [0x40608c], 1
je 0x404490
mov eax, edi
shr eax, 0x10
test eax, eax
je 0x404f3d
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 0x404d88
mov eax, edi
call fcn.00403a40
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.00403c80
jmp 0x404490
mov eax, str._null_
jmp 0x404c03
mov dword [esp + 4], 0x408e88
mov dword [esp], str._04x
call fcn.004039e0
jmp 0x40450b
test byte [0x40608c], 1
je 0x404490
mov eax, str._null_
jmp 0x404d88
mov dword [esp + 4], 0x408eaa
mov dword [esp], str._04x
call fcn.004039e0
jmp 0x40450b
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 8]
sub esp, 4
test byte [0x40608c], 1
jne 0x404f52
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x404490
test al, al
je 0x404490
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x405051
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 0x404e63
mov eax, esi
call fcn.00403a40
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.unsupported_switch__s_n
mov dword [esp + 8], 0x4091c8
mov dword [esp + 4], 0x40608c
mov dword [esp], 0
call fcn.00403c80
jmp 0x404490
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
je 0x404b94
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.00403c80
jmp 0x404b94
lea eax, [ebp - 0x10c]
shr eax, 0x10
test eax, eax
je 0x405002
lea eax, [ebp - 0x10c]
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 0x404f10
lea eax, [ebp - 0x10c]
call fcn.00403a40
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.00403c80
jmp 0x40464e
mov dword [esp + 4], edi
mov dword [esp], str._04x
call fcn.004039e0
jmp 0x404d88
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.00403c80
jmp 0x404e1d
mov dword [esp + 4], 0x408eae
mov dword [esp], str._04x
call fcn.004039e0
jmp 0x40450b
lea eax, [ebp - 0x8c]
shr eax, 0x10
test eax, eax
je 0x4050d6
lea eax, [ebp - 0x8c]
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 0x404fd5
lea eax, [ebp - 0x8c]
call fcn.00403a40
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.00403c80
jmp 0x40471a
lea eax, [ebp - 0x10c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039e0
jmp 0x404f10
test byte [0x40608c], 1
je 0x404b79
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.00403c80
jmp 0x404b79
mov dword [esp + 4], esi
mov dword [esp], str._04x
call fcn.004039e0
jmp 0x404e63
test byte [0x40608c], 1
je 0x404b79
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.00403c80
jmp 0x404b79
test byte [0x40608c], 1
je 0x404b79
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.00403c80
jmp 0x404b79
lea eax, [ebp - 0x8c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039e0
jmp 0x404fd5