Function at 0x414310
Capabilities:
Accept command line arguments
Check if file exists
Get common file path
Get comspec environment variable
Get file attributes
Query environment variable
Query or enumerate registry value
Set console window title
Set environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
mov eax, 0x4b84
call sym.__alloca
mov dword [ebp - 0x1c], 0
lea esi, [ebp - 0xb90]
push 0x104
push esi
push str.COMSPEC
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
test eax, eax
jne 0x41437c
push 0xfb
push esi
call dword [sym.imp.kernel32.dll_GetSystemDirectoryW]
nop
cmp word [esi], 0
lea esi, [esi + 2]
jne 0x414350
movups xmm0, xmmword [str.cmd.exe]
movups xmmword [esi - 2], xmm0
mov word [esi + 0xe], 0
lea eax, [ebp - 0xb90]
push eax
push str.COMSPEC
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
push 0
call dword [sym.imp.ucrtbase.dll__time32]
add esp, 4
push eax
call dword [sym.imp.ucrtbase.dll_srand]
add esp, 4
mov dword [ebp - 0x188], 0x11c
lea eax, [ebp - 0x188]
push eax
call dword [sym.imp.ntdll.dll_RtlGetVersion]
push 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x800
push 0x42d48e
push 0x407
push eax
call dword [sym.imp.user32.dll_LoadStringW]
test eax, eax
jne 0x414410
test byte [0x41d038], 1
je 0x414402
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.LoadString_failed_with__ld_n
mov dword [esp + 8], str.WCMD_LoadMessage
mov dword [esp], 0
call dbg.wine_dbg_log
add esp, 0x14
movups xmm0, xmmword [str.Failed_]
movups xmmword [0x42d48e], xmm0
xor eax, eax
nop word cs:[eax + eax]
movzx ecx, word [eax + 0x42d48e]
mov word [eax + 0x4213b0], cx
add eax, 2
test cx, cx
jne 0x414420
mov eax, dword [ebp - 0x184]
mov ecx, dword [ebp - 0x180]
mov edx, dword [ebp - 0x17c]
sub esp, 0x14
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
lea esi, [ebp - 0x6a]
mov dword [esp], esi
call sym._sprintf
add esp, 0x14
push 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x800
push 0x42d48e
push 0x409
push eax
call dword [sym.imp.user32.dll_LoadStringW]
test eax, eax
jne 0x4144cd
test byte [0x41d038], 1
je 0x4144bf
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.LoadString_failed_with__ld_n
mov dword [esp + 8], str.WCMD_LoadMessage
mov dword [esp], 0
call dbg.wine_dbg_log
add esp, 0x14
movups xmm0, xmmword [str.Failed_]
movups xmmword [0x42d48e], xmm0
xor edi, edi
push esi
push 0x42d48e
call dbg.WCMD_format_string
add esp, 8
nop dword [eax]
movzx ecx, word [eax + edi]
mov word [edi + 0x42e494], cx
add edi, 2
test cx, cx
jne 0x4144e0
push eax
call dword [sym.imp.kernel32.dll_LocalFree]
call dword [sym.imp.kernel32.dll_GetCommandLineW]
mov edi, eax
test byte [0x41d038], 8
je 0x414538
mov ecx, edi
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Full_commandline__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x14
add edi, 4
nop dword [eax + eax]
movzx eax, word [edi - 4]
test eax, eax
je 0x414552
cmp eax, 0x2f
je 0x414552
add edi, 2
jmp 0x414540
mov byte [0x42148c], 0
mov byte [0x421488], 0
mov byte [0x421484], 0
mov dword [ebp - 0x10], 0
mov esi, dword [sym.imp.ucrtbase.dll_towlower]
xor ebx, ebx
jmp 0x414592
movzx eax, ax
test eax, eax
je 0x414670
movzx eax, word [edi - 2]
add edi, 2
cmp ax, 0x2f
jne 0x414580
movzx eax, word [edi - 2]
push eax
call esi
add esp, 4
movzx eax, ax
add eax, 0xffffff9f
cmp eax, 0x15
ja case.0x4145ad.98
jmp dword [eax*4 + 0x419440]
mov byte [0x42e55c], 0
jmp case.0x4145ad.98
cmp word [edi], 0x3a
jne case.0x4145ad.98
lea eax, [edi + 2]
push 0x10
push 0
push eax
call dword [sym.imp.ucrtbase.dll_wcstoul]
add esp, 0xc
jmp 0x414623
mov byte [0x421484], 1
jmp case.0x4145ad.98
mov byte [0x42e55c], 1
jmp case.0x4145ad.98
cmp word [edi], 0x3a
jne case.0x4145ad.98
lea eax, [edi + 2]
push 3
push 0x419ca2
push eax
call dword [sym.imp.ucrtbase.dll__wcsnicmp]
add esp, 0xc
mov dword [0x421398], eax
jmp case.0x4145ad.98
mov byte [0x421488], 1
jmp case.0x4145ad.98
mov ebx, 1
jmp case.0x4145ad.98
mov byte [0x42148c], 1
mov eax, dword [ebp - 0x10]
cmp byte [0x421484], 0
mov dword [ebp - 0x10], eax
jne 0x41463c
test byte [0x421488], 1
je 0x41458b
movzx eax, word [edi]
test ax, ax
je 0x414673
mov esi, dword [sym.imp.ucrtbase.dll_wcschr]
nop word [eax + eax]
movzx eax, ax
push eax
push str.__t__
call esi
add esp, 8
test eax, eax
je 0x414673
movzx eax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x414650
jmp 0x414673
add edi, 0xfffffffc
test ebx, ebx
je 0x414684
push 0x419ca2
call dbg.WCMD_echo
add esp, 4
mov dword [0x421480], 0
push str._P_G
push 0x419cb6
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
cmp byte [0x421484], 0
jne 0x4146c4
test byte [0x421488], 1
jne 0x4146c4
push 1
push dbg._my_event_handler@4
call dword [sym.imp.kernel32.dll_SetConsoleCtrlHandler]
xor ebx, ebx
jmp 0x414ae3
xor esi, esi
nop word cs:[eax + eax]
cmp word [edi + esi], 0
lea esi, [esi + 2]
jne 0x4146d0
push esi
call sym._malloc
add esp, 4
test eax, eax
je 0x414f90
push esi
push edi
mov dword [ebp - 0x24], eax
push eax
call sym._memcpy
add esp, 0xc
mov bl, 1
cmp byte [0x42148c], 0
jne 0x41475d
push 0x22
push edi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je case.0x414f47.38
cmp byte [0x42148c], 0
jne 0x41475d
mov edi, eax
add eax, 2
push 0x22
push eax
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je case.0x414f47.38
cmp byte [0x42148c], 0
jne 0x41475d
mov esi, eax
add eax, 2
push 0x22
push eax
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x414ed1
mov byte [0x42148c], 1
mov bl, 1
test byte [0x41d038], 8
jne 0x414773
test bl, 1
mov ebx, dword [ebp - 0x24]
je 0x4147b0
jmp 0x4149f1
mov ebx, dword [ebp - 0x24]
mov ecx, ebx
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str._c_command_line:__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x14
cmp byte [0x42148c], 0
jne 0x4149f1
sub esp, 0x14
movaps xmm0, xmmword [0x419430]
movups xmmword [esp + 4], xmm0
mov dword [esp], ebx
call sym._WCMD_parameter
add esp, 0x14
mov edi, eax
lea esi, [ebp - 0x4b90]
push 0x2000
push esi
push str.PATHEXT
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
add eax, 0xffffe000
cmp eax, 0xffffe000
ja 0x41481b
movsd xmm0, qword [0x419718]
movsd qword [ebp - 0x4b70], xmm0
movups xmm0, xmmword [0x419708]
movups xmmword [ebp - 0x4b80], xmm0
movups xmm0, xmmword [str..bat_.com_.cmd_.exe]
movups xmmword [ebp - 0x4b90], xmm0
test byte [0x41d038], 8
je 0x414851
mov ecx, edi
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.First_parameter_is__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x14
push 0x5c
push edi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x414989
lea eax, [ebp - 0x988]
push 0
push eax
push 0x400
push edi
call dbg.WCMD_get_fullpath
add esp, 0x10
test eax, eax
je 0x414dfb
test byte [0x41d038], 8
je 0x4148be
lea ecx, [ebp - 0x988]
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Full_path_name__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x14
lea edi, [ebp - 0x98a]
nop word cs:[eax + eax]
cmp word [edi + 2], 0
lea edi, [edi + 2]
jne 0x4148d0
lea eax, [ebp - 0x988]
push eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x414964
jmp 0x4148f8
test esi, esi
je 0x414aa7
push 0x3b
push esi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x414930
mov ebx, eax
sub ebx, esi
push ebx
push esi
push edi
mov esi, eax
call sym._memcpy
add esp, 0xc
mov word [edi + ebx], 0
mov ebx, dword [ebp - 0x24]
add esi, 2
jmp 0x414952
xor eax, eax
nop word cs:[eax + eax]
movzx ecx, word [esi + eax]
mov word [edi + eax], cx
add eax, 2
test cx, cx
jne 0x414940
xor esi, esi
lea eax, [ebp - 0x988]
push eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4148f0
test byte [0x41d038], 8
je 0x4149e4
lea ecx, [ebp - 0x988]
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Found_file_as__s_n
jmp 0x4149cd
lea eax, [ebp - 0x988]
push 0
push eax
push 0x400
push 0
push edi
push 0
call dword [sym.imp.kernel32.dll_SearchPathW]
test eax, eax
je 0x414a60
test byte [0x41d038], 8
je 0x4149e4
lea ecx, [ebp - 0x988]
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Found_on_path_as__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x14
cmp byte [0x42148c], 1
jne 0x414ae3
cmp word [ebx], 0x22
jne 0x414ae3
movzx ecx, word [ebx + 2]
mov word [ebx], cx
test cx, cx
je 0x414ae3
xor eax, eax
mov edx, ebx
nop
cmp cx, 0x22
cmove eax, edx
movzx ecx, word [edx + 4]
mov word [edx + 2], cx
add edx, 2
test cx, cx
jne 0x414a10
test eax, eax
je 0x414ae3
add eax, 2
nop word cs:[eax + eax]
movzx ecx, word [eax]
mov word [eax - 2], cx
add eax, 2
test cx, cx
jne 0x414a40
jmp 0x414ae3
push 0x3b
push esi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x414a7c
mov ebx, eax
mov word [eax], 0
add ebx, 2
jmp 0x414a7e
xor ebx, ebx
push 0
lea eax, [ebp - 0x988]
push eax
push 0x400
push esi
push edi
push 0
call dword [sym.imp.kernel32.dll_SearchPathW]
test eax, eax
jne 0x414e43
mov esi, ebx
test ebx, ebx
mov ebx, dword [ebp - 0x24]
jne 0x414a60
test byte [0x41d038], 8
je 0x414ad2
sub esp, 0x10
mov dword [esp + 0xc], str.Binary_not_found__dropping_back_to_old_behaviour_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x10
mov byte [0x42148c], 1
cmp word [ebx], 0x22
je 0x4149fb
lea esi, [ebp - 0x988]
push esi
push 0x400
call dword [sym.imp.kernel32.dll_GetCurrentDirectoryW]
movzx eax, word [ebp - 0x988]
push eax
call dword [sym.imp.user32.dll_IsCharAlphaW]
test eax, eax
je 0x414b7b
cmp word [ebp - 0x986], 0x3a
jne 0x414b7b
movzx eax, word [ebp - 0x988]
lea edi, [ebp - 0x38]
push eax
push str._c:
push edi
call dword [sym.imp.user32.dll_wsprintfW]
add esp, 0xc
push esi
push edi
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
test byte [0x41d038], 8
je 0x414b7b
lea ecx, [ebp - 0x38]
call dbg.wine_dbgstr_w
mov esi, eax
lea ecx, [ebp - 0x988]
call dbg.wine_dbgstr_w
sub esp, 0x18
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.Set__s_to__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x18
cmp byte [0x421484], 1
jne 0x414bc0
lea eax, [ebp - 0x1c]
push 0xffffffffffffffff
push eax
push ebx
call dbg.WCMD_ReadAndParseLine
add esp, 0xc
mov esi, dword [ebp - 0x1c]
push 0
push 0
push esi
call dbg.WCMD_process_commands
add esp, 0xc
push esi
call dbg.WCMD_free_commands
add esp, 4
push ebx
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
mov eax, dword [0x42147c]
jmp 0x414dfd
lea eax, [ebp - 0x4b90]
push eax
call dword [sym.imp.kernel32.dll_GetStartupInfoW]
mov esi, dword [ebp - 0x4b84]
test esi, esi
jne 0x414c44
push 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
mov esi, 0x42d48e
push 0x800
push 0x42d48e
push 0x408
push eax
call dword [sym.imp.user32.dll_LoadStringW]
test eax, eax
jne 0x414c44
test byte [0x41d038], 1
je 0x414c36
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.LoadString_failed_with__ld_n
mov dword [esp + 8], str.WCMD_LoadMessage
mov dword [esp], 0
call dbg.wine_dbg_log
add esp, 0x14
movups xmm0, xmmword [str.Failed_]
movups xmmword [0x42d48e], xmm0
push esi
call dword [sym.imp.kernel32.dll_SetConsoleTitleW]
mov ecx, dword [ebp - 0x10]
test ecx, ecx
je 0x414c69
mov eax, ecx
shr eax, 4
xor eax, ecx
test al, 0xf
je 0x414d2f
movzx eax, cl
jmp 0x414d1c
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x14], 4
lea esi, [ebp - 0x18]
push esi
push 0x20019
push 0
push global_regKeyW
push 0x80000001
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
test eax, eax
jne 0x414cbf
lea eax, [ebp - 0x28]
push 0
push 0
push eax
push 0
push str.DefaultColor
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
test eax, eax
je 0x414e08
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegCloseKey]
cmp dword [ebp - 0x20], 0
jne 0x414d0a
push esi
push 0x20019
push 0
push global_regKeyW
push 0x80000002
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
test eax, eax
jne 0x414d0a
lea eax, [ebp - 0x28]
push 0
push 0
push eax
push 0
push str.DefaultColor
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
test eax, eax
je 0x414e96
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegCloseKey]
mov eax, dword [ebp - 0x20]
mov ecx, eax
shr ecx, 4
xor ecx, eax
test cl, 0xf
je 0x414d2f
movzx eax, al
mov dword [0x41d030], eax
mov word [0x42548e], 0
call dbg.WCMD_color
cmp byte [0x421488], 0
lea esi, [ebp - 0x1c]
je 0x414d86
push 0xffffffffffffffff
push esi
push ebx
call dbg.WCMD_ReadAndParseLine
add esp, 0xc
mov edi, dword [ebp - 0x1c]
push 0
push 0
push edi
call dbg.WCMD_process_commands
add esp, 0xc
push edi
call dbg.WCMD_free_commands
add esp, 4
mov dword [ebp - 0x1c], 0
push ebx
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
mov dword [0x421480], 1
cmp byte [0x421488], 0
je 0x414d90
jmp 0x414d95
mov dword [0x421480], 1
call dbg.WCMD_version
mov ecx, 1
mov edi, dword [sym.imp.kernel32.dll_GetStdHandle]
cmp dword [0x41d034], 0
je 0x414db5
nop dword [eax]
call dbg.WCMD_show_prompt
push 0xfffffffffffffff6
call edi
push eax
push esi
push 0
call dbg.WCMD_ReadAndParseLine
add esp, 0xc
test eax, eax
je 0x414dfb
mov ebx, dword [ebp - 0x1c]
push 0
push 0
push ebx
call dbg.WCMD_process_commands
add esp, 0xc
push ebx
call dbg.WCMD_free_commands
add esp, 4
xor ecx, ecx
test ebx, ebx
setne cl
mov dword [ebp - 0x1c], 0
cmp dword [0x41d034], 0
jne 0x414db0
jmp 0x414db5
xor eax, eax
add esp, 0x4b84
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x28]
cmp eax, 1
je 0x414ef1
cmp eax, 4
jne 0x414cb6
mov dword [ebp - 0x14], 4
lea eax, [ebp - 0x14]
lea ecx, [ebp - 0x20]
push eax
push ecx
push 0
push 0
push str.DefaultColor
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
jmp 0x414cb6
test byte [0x41d038], 8
mov ebx, dword [ebp - 0x24]
je 0x4149e4
lea ecx, [ebp - 0x988]
call dbg.wine_dbgstr_w
mov edi, eax
mov ecx, esi
call dbg.wine_dbgstr_w
sub esp, 0x18
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.Found_on_path_as__s_with_extension__s_n
mov dword [esp + 8], str.wmain
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x18
jmp 0x4149e4
mov eax, dword [ebp - 0x28]
cmp eax, 1
je 0x414f59
cmp eax, 4
jne 0x414d01
mov dword [ebp - 0x14], 4
lea eax, [ebp - 0x14]
lea ecx, [ebp - 0x20]
push eax
push ecx
push 0
push 0
push str.DefaultColor
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
jmp 0x414d01
cmp byte [0x42148c], 0
jne 0x41475d
mov byte [0x42148c], 1
cmp edi, esi
je 0x41475d
mov bl, 1
jmp 0x414f3c
mov dword [ebp - 0x14], 8
lea eax, [ebp - 0x14]
lea edi, [ebp - 0x30]
push eax
push edi
push 0
push 0
push str.DefaultColor
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
push 0xa
push 0
push edi
call dword [sym.imp.ucrtbase.dll_wcstoul]
add esp, 0xc
mov dword [ebp - 0x20], eax
jmp 0x414cb6
cmp ecx, 0x7c
je case.0x414f47.38
add edi, 2
cmp edi, esi
je 0x41475d
movzx ecx, word [edi]
lea eax, [ecx - 9]
cmp eax, 0x55
ja case.default.0x414f47
jmp dword [eax*4 + 0x419498]
mov byte [0x42148c], 0
xor ebx, ebx
jmp case.0x414f47.10
mov dword [ebp - 0x14], 8
lea eax, [ebp - 0x14]
lea esi, [ebp - 0x30]
push eax
push esi
push 0
push 0
push str.DefaultColor
push dword [ebp - 0x18]
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
push 0xa
push 0
push esi
call dword [sym.imp.ucrtbase.dll_wcstoul]
add esp, 0xc
mov dword [ebp - 0x20], eax
jmp 0x414d01
test byte [0x41d038], 2
je 0x414fbb
sub esp, 0x10
mov dword [esp + 0xc], str.Out_of_memory_n
mov dword [esp + 8], str.xrealloc
mov dword [esp], 1
call dbg.wine_dbg_log
add esp, 0x10
push 1
call dword [sym.imp.kernel32.dll_ExitProcess]