Function at 0x404a40
Capabilities:
Accept command line arguments
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x184
mov ebx, dword [ebp + 0x10]
test byte [0x40708c], 8
jne 0x404d50
call dword [sym.imp.kernel32.dll_GetCommandLineW]
lea edx, [ebp - 0x150]
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.shell32.dll_CommandLineToArgvW]
sub esp, 8
mov edi, eax
test eax, eax
je 0x404b48
mov edx, dword [ebp - 0x150]
cmp edx, 1
jle 0x404b3b
mov eax, str.nologo
mov ebx, 1
shr eax, 0x10
mov dword [ebp - 0x15c], eax
jmp 0x404ade
mov dword [esp + 4], 0x409ea6
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404b10
mov esi, 0xffffffff
mov word [0x407018], si
mov edx, dword [ebp - 0x150]
add ebx, 1
cmp edx, ebx
jle 0x404b3b
mov ecx, dword [edi + ebx*4]
movzx eax, word [ecx]
mov esi, eax
and esi, 0xfffffffd
cmp si, 0x2d
jne 0x404bf0
lea esi, [ecx + 2]
cmp ax, 0x2f
jne 0x404ab0
cmp word [ecx + 2], 0x2f
jne 0x404ab0
lea esi, [ecx + 4]
jmp 0x404ab0
mov dword [esp + 4], 0x409eaa
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404b60
mov edx, dword [ebp - 0x150]
xor ecx, ecx
add ebx, 1
mov word [0x407018], cx
cmp edx, ebx
jg 0x404ade
test byte [0x40708c], 1
jne 0x404ea0
mov eax, 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 4], str.nologo
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x404e30
test byte [0x40708c], 1
je 0x404ad1
mov edx, dword [ebp - 0x15c]
test edx, edx
je 0x4054b9
mov dword [esp + 4], 0xffffffff
mov dword [esp], str.nologo
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x404bc1
mov eax, str.nologo
call fcn.00403ae0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.ignored__s_switch_n
mov dword [esp + 8], 0x40a1a8
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
jmp 0x404ad1
lea eax, [edi + ebx*4 + 4]
sub edx, ebx
mov dword [esp], ecx
mov dword [0x414004], eax
sub edx, 1
lea eax, [ebp - 0x158]
mov dword [section..bss], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x414040
mov dword [esp + 4], 0x104
mov dword [ebp - 0x15c], ecx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x404b48
mov eax, dword [ebp - 0x158]
mov dword [esp + 4], 0x2e
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov ebx, eax
test eax, eax
je 0x405475
lea edx, [ebp - 0x148]
call fcn.00404430
test eax, eax
jne 0x405012
test byte [0x40708c], 1
je 0x404b48
mov eax, ebx
shr eax, 0x10
je 0x405644
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x405487
cmp word [ebx], 0
je 0x405691
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404cb8
mov esi, 0x224c
lea edi, [ebp - 0x16]
mov word [ebp - 0x138], si
lea esi, [ebp - 0x136]
jmp 0x404d15
cmp ax, 9
je 0x405591
cmp ax, 0xa
jne 0x4055af
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
lea eax, [edx - 1]
cmp esi, edi
ja 0x405611
test edx, edx
jle 0x405611
mov edx, eax
movzx eax, word [ebx]
add ebx, 2
cmp ax, 0xd
je 0x405580
jbe 0x404cdc
cmp ax, 0x22
je 0x405600
cmp ax, 0x5c
jne 0x4055a2
mov eax, 0x5c5c
add esi, 2
mov word [esi - 2], ax
jmp 0x404d00
test ebx, ebx
je 0x40546b
mov eax, ebx
shr eax, 0x10
je 0x404ed0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x404ee3
movzx eax, word [ebx]
test ax, ax
je 0x405520
lea esi, [esi]
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x404d98
mov ecx, 0x224c
lea esi, [ebp - 0x136]
lea edi, [ebp - 0x16]
mov word [ebp - 0x138], cx
jmp 0x404df8
cmp ax, 9
je 0x404fb8
cmp ax, 0xa
jne 0x404f32
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea ecx, [edx - 1]
test edx, edx
jle 0x404fd0
cmp esi, edi
ja 0x404fd0
movzx eax, word [ebx]
mov edx, ecx
add ebx, 2
cmp ax, 0xd
je 0x404fa0
jbe 0x404dc0
cmp ax, 0x22
je 0x404f88
cmp ax, 0x5c
jne 0x404f25
mov eax, 0x5c5c
add esi, 2
mov word [esi - 2], ax
jmp 0x404de0
test byte [0x40708c], 1
je 0x404b48
mov eax, esi
shr eax, 0x10
je 0x4054df
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 0x404e6e
mov eax, esi
call fcn.00403ae0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.unsupported_switch__s_n
mov dword [esp + 8], 0x40a1a8
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
mov eax, 1
jmp 0x404b4d
mov dword [esp + 0xc], str.No_file_name_specified_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
mov eax, 1
jmp 0x404b4d
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00403a80
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x14]
mov dword [esp + 0xc], str.__p__p__s__x__n
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 3
call fcn.00403d40
jmp 0x404a5c
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x405008
mov ecx, eax
mov byte [esi], 0x5c
add esi, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 4], cl
mov ecx, eax
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 3], cl
mov ecx, eax
and eax, 0xf
shr cx, 4
movzx eax, byte [eax + str.0123456789abcdefset_host_properties]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 1], al
mov byte [esi - 2], cl
jmp 0x404de0
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404de0
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404de0
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404de0
mov byte [esi], 0x22
test ecx, ecx
jle 0x405539
mov edi, 0x2e2e
mov byte [esi + 3], 0x2e
lea eax, [esi + 4]
mov word [esi + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x138]
mov dword [esp], eax
call fcn.00405fc0
jmp 0x404ee3
mov byte [esi], al
add esi, 1
jmp 0x404de0
mov dword [esp], 0
lea ebx, [ebp - 0x138]
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x148]
sub esp, 4
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x410ab8
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ole32.dll_CoCreateInstance]
sub esp, 0x14
test eax, eax
js 0x405508
mov eax, dword [ebp - 0x138]
lea esi, [ebp - 0x14c]
mov edx, dword [eax]
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40d7b8
mov dword [esp], eax
call dword [edx]
mov esi, eax
mov eax, dword [ebp - 0x138]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test esi, esi
js 0x405508
mov eax, dword [ebp - 0x14c]
lea esi, [ebp - 0x154]
mov edx, dword [eax]
mov dword [esp + 8], esi
mov dword [esp + 4], 0x40d7a8
mov dword [esp], eax
call dword [edx]
mov ecx, dword [ebp - 0x15c]
sub esp, 0xc
test eax, eax
js 0x4054f7
mov edi, dword [ebp - 0x14c]
mov esi, dword [ebp - 0x154]
mov dword [esp + 4], ebx
mov dword [ebp - 0x15c], ecx
mov dword [esp], str.wscript.exe
call dword [sym.imp.oleaut32.dll_LoadTypeLib]
mov ecx, dword [ebp - 0x15c]
sub esp, 8
test eax, eax
js 0x40554a
mov eax, dword [ebp - 0x138]
mov dword [ebp - 0x15c], ecx
mov edx, dword [eax]
mov dword [esp + 8], 0x414024
mov dword [esp + 4], 0x40a1dc
mov dword [esp], eax
call dword [edx + 0x18]
sub esp, 0xc
test eax, eax
mov eax, dword [ebp - 0x138]
mov edx, dword [eax]
js 0x405541
mov dword [esp + 8], 0x414020
mov dword [esp + 4], 0x40a1fc
mov dword [esp], eax
call dword [edx + 0x18]
mov ebx, eax
mov eax, dword [ebp - 0x138]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test ebx, ebx
js 0x40554a
mov eax, dword [edi]
mov dword [esp + 4], 0x407044
mov dword [esp], edi
call dword [eax + 0xc]
sub esp, 8
test eax, eax
js 0x40554a
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 0xc]
sub esp, 4
test eax, eax
js 0x40554a
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 0x40554a
mov eax, dword [edi]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x409e38
mov dword [esp], edi
call dword [eax + 0x20]
sub esp, 0xc
test eax, eax
js 0x40554a
mov eax, dword [edi]
mov dword [esp + 4], 5
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x40554a
mov eax, dword [ebp - 0x154]
mov ecx, dword [ebp - 0x15c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 1
mov dword [ebp - 0x164], eax
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x4056b2
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
sub esp, 8
mov dword [ebp - 0x160], eax
mov dword [esp], esi
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 ebx, eax
mov dword [esp], esi
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
call esi
sub esp, 4
cmp ebx, 0xffffffff
je 0x4056b2
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_MapViewOfFile]
sub esp, 0x14
mov dword [ebp - 0x15c], eax
mov dword [esp], ebx
call esi
mov esi, dword [ebp - 0x15c]
sub esp, 4
test esi, esi
je 0x4056b2
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], esi
mov dword [esp + 0x14], 0
mov dword [ebp - 0x168], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
mov esi, eax
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov edx, dword [ebp - 0x168]
sub esp, 8
mov ebx, eax
mov dword [esp + 0x14], esi
mov esi, dword [ebp - 0x15c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x160]
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_UnmapViewOfFile]
sub esp, 4
test ebx, ebx
je 0x4056b2
mov edx, dword [ebp - 0x164]
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], ebx
call dword [eax + 0x14]
sub esp, 0x28
mov esi, eax
mov dword [esp], ebx
call dword [sym.imp.oleaut32.dll_SysFreeString]
sub esp, 4
test esi, esi
js 0x405722
mov eax, dword [edi]
mov dword [esp + 4], 1
mov dword [esp], edi
call dword [eax + 0x14]
sub esp, 8
test eax, eax
js 0x4056e8
mov eax, dword [edi]
mov dword [esp], edi
call dword [eax + 0x1c]
mov eax, dword [0x414024]
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 - 0x154]
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]
xor eax, eax
jmp 0x404b4d
mov eax, str._null_
jmp 0x404ee3
test byte [0x40708c], 1
je 0x404b48
mov edx, str._null_
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], str.Could_not_find_engine_for__s_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
mov eax, 1
jmp 0x404b4d
mov dword [ebp - 0x160], str.nologo
movzx eax, word [ebp - 0x160]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00403a80
jmp 0x404bc1
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.00403a80
jmp 0x404e6e
mov eax, dword [ebp - 0x14c]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40708c], 1
jne 0x40565e
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x404b48
mov eax, 0x224c
mov byte [ebp - 0x136], 0x22
lea esi, [ebp - 0x136]
mov word [ebp - 0x138], ax
lea eax, [esi + 1]
jmp 0x404feb
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test byte [0x40708c], 1
je 0x405442
mov dword [esp + 0xc], str.Script_initialization_failed_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
jmp 0x405442
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x404d00
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x404d00
lea ecx, [eax - 0x20]
cmp cx, 0x5e
jbe 0x405687
mov ecx, eax
mov byte [esi], 0x5c
add esi, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 4], cl
mov ecx, eax
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 3], cl
mov ecx, eax
and eax, 0xf
shr cx, 4
movzx eax, byte [eax + str.0123456789abcdefset_host_properties]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefset_host_properties]
mov byte [esi - 1], al
mov byte [esi - 2], cl
jmp 0x404d00
mov eax, 0x225c
add esi, 2
mov word [esi - 2], ax
jmp 0x404d00
mov byte [esi], 0x22
test eax, eax
jle 0x4056aa
mov edi, 0x2e2e
mov byte [esi + 3], 0x2e
lea eax, [esi + 4]
mov word [esi + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x138]
mov dword [esp], eax
call fcn.00405fc0
mov edx, eax
jmp 0x405487
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.00403a80
mov edx, eax
jmp 0x405487
mov dword [esp + 0xc], str.Could_not_create_script_engine_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
jmp 0x405515
mov byte [esi], al
add esi, 1
jmp 0x404d00
mov ebx, 0x224c
mov byte [ebp - 0x136], 0x22
lea esi, [ebp - 0x136]
mov word [ebp - 0x138], bx
lea eax, [esi + 1]
jmp 0x40562c
test byte [0x40708c], 1
je 0x405427
mov dword [esp + 0xc], str.Could_not_get_script_text_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
jmp 0x405427
test byte [0x40708c], 1
je 0x405427
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.SetScriptState_failed:__08lx_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
jmp 0x405427
test byte [0x40708c], 1
je 0x405427
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.ParseScriptText_failed:__08lx_n
mov dword [esp + 8], str.run_script
mov dword [esp + 4], 0x40708c
mov dword [esp], 0
call fcn.00403d40
jmp 0x405427