Function at 0x404360
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 0x404b90
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 0x404470
mov edx, dword [ebp - 0x128]
mov ebx, 1
cmp edx, 1
jg 0x4043e5
jmp 0x40443a
mov dword [esp + 4], 0x408e80
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404410
mov eax, 0xffffffff
mov word [0x412008], ax
mov edx, dword [ebp - 0x128]
add ebx, 1
cmp edx, ebx
jle 0x40443a
mov eax, dword [edi + ebx*4]
movzx ecx, word [eax]
mov esi, ecx
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404520
lea esi, [eax + 2]
cmp cx, 0x2f
jne 0x4043b8
cmp word [eax + 2], 0x2f
jne 0x4043b8
lea esi, [eax + 4]
jmp 0x4043b8
mov dword [esp + 4], 0x408e84
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404488
mov edx, dword [ebp - 0x128]
add ebx, 1
xor eax, eax
mov word [0x412008], ax
cmp edx, ebx
jg 0x4043e5
test byte [0x40608c], 1
je 0x404470
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.00403c60
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]
mov edx, eax
movzx eax, byte [0x40608c]
and eax, 1
test edx, edx
jne 0x404c18
test al, al
je 0x4043d8
mov eax, 0x408e88
shr eax, 0x10
test eax, eax
je 0x404d2b
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 0x4044f2
mov eax, 0x408e88
call fcn.00403a20
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.00403c60
jmp 0x4043d8
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 0x404470
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 0x404d17
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 0x404ca0
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 ecx, 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], ecx
call ecx
mov eax, dword [ebp - 0x134]
sub esp, 4
test eax, eax
jne 0x404ca0
test byte [0x40608c], 8
jne 0x404dbb
cmp word [ebp - 0x10c], 0
lea edx, [ebp - 0x10c]
je 0x404649
nop
add edx, 2
cmp word [edx], 0
jne 0x404640
xor eax, eax
lea esi, cs:[esi]
movzx ecx, word [eax + str.ScriptEngine]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x404650
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 0x404ca0
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 0x404ca0
test byte [0x40608c], 8
jne 0x404e82
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 0x404ca0
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 0x404d64
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 0x404d64
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 0x404d59
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 0x404d85
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 0x404d7c
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 0x404d85
mov eax, dword [edi]
mov dword [esp + 4], 0x406044
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x404d85
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x404d85
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 0x404d85
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 0x404d85
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404d85
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 0x404ef0
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 0x404ef0
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 0x404ef0
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 0x404ef0
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 0x404f5c
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x404f24
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 0x404475
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x404d0d
mov eax, dword [ebp + 0x10]
shr eax, 0x10
test eax, eax
je 0x404c80
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 0x404bd3
mov eax, dword [ebp + 0x10]
call fcn.00403a20
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.00403c60
jmp 0x404379
test al, al
je 0x404470
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x404d44
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 0x404c53
mov eax, esi
call fcn.00403a20
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.00403c60
jmp 0x404470
mov eax, dword [ebp + 0x10]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039c0
jmp 0x404bd3
test byte [0x40608c], 1
je 0x404470
mov eax, edi
shr eax, 0x10
test eax, eax
je 0x404e29
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 0x404ce0
mov eax, edi
call fcn.00403a20
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.00403c60
jmp 0x404470
mov eax, str._null_
jmp 0x404bd3
test byte [0x40608c], 1
je 0x404470
mov eax, str._null_
jmp 0x404ce0
mov dword [esp + 4], 0x408e88
mov dword [esp], str._04x
call fcn.004039c0
jmp 0x4044f2
mov dword [esp + 4], esi
mov dword [esp], str._04x
call fcn.004039c0
jmp 0x404c53
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 8]
sub esp, 4
test byte [0x40608c], 1
jne 0x404e3e
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x404470
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40608c], 1
je 0x404b64
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.00403c60
jmp 0x404b64
lea eax, [ebp - 0x10c]
shr eax, 0x10
test eax, eax
je 0x404e67
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 0x404dfc
lea eax, [ebp - 0x10c]
call fcn.00403a20
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.00403c60
jmp 0x40462e
mov dword [esp + 4], edi
mov dword [esp], str._04x
call fcn.004039c0
jmp 0x404ce0
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.00403c60
jmp 0x404d71
lea eax, [ebp - 0x10c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039c0
jmp 0x404dfc
lea eax, [ebp - 0x8c]
shr eax, 0x10
test eax, eax
je 0x404f94
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 0x404ec3
lea eax, [ebp - 0x8c]
call fcn.00403a20
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.00403c60
jmp 0x4046ea
test byte [0x40608c], 1
je 0x404b49
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.00403c60
jmp 0x404b49
test byte [0x40608c], 1
je 0x404b49
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.00403c60
jmp 0x404b49
test byte [0x40608c], 1
je 0x404b49
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.00403c60
jmp 0x404b49
lea eax, [ebp - 0x8c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.004039c0
jmp 0x404ec3