Function at 0x40ff80
Capabilities:
Check if file exists
Create process on windows
Get file attributes
Get file system object information
Query environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
mov eax, 0x8974
call sym.__alloca
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
test byte [0x41d038], 8
je 0x40ffd0
mov ecx, esi
call dbg.wine_dbgstr_w
sub esp, 0x18
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Running__s___d__n
mov dword [esp + 8], str.WCMD_run_program
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x18
sub esp, 0x14
movaps xmm0, xmmword [0x418f80]
movups xmmword [esp + 4], xmm0
mov dword [esp], esi
call sym._WCMD_parameter
add esp, 0x14
test eax, eax
je 0x4109b0
mov ebx, eax
cmp word [eax], 0
je 0x41009b
push 0x4196d0
push ebx
call dword [sym.imp.ucrtbase.dll_wcspbrk]
add esp, 8
mov edi, eax
test eax, eax
je 0x4100aa
lea esi, [ebp - 0x4980]
push 0
push esi
push 0x2000
push ebx
call dbg.WCMD_get_fullpath
add esp, 0x10
test eax, eax
je 0x4109b0
push 0x5c
push esi
call dword [sym.imp.ucrtbase.dll_wcsrchr]
add esp, 8
mov ebx, eax
xor esi, esi
mov ecx, 0
test eax, eax
je 0x410070
push 0x2e
push ebx
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
xor ecx, ecx
test eax, eax
setne cl
nop word cs:[eax + eax]
movzx eax, word [ebx + esi + 2]
mov word [ebp + esi - 0x6cc], ax
add esi, 2
test ax, ax
jne 0x410070
mov dword [ebp - 0x1c], ecx
test ebx, ebx
je 0x4101b4
mov word [ebx + 2], 0
jmp 0x4101b4
mov dword [0x42147c], 0
jmp 0x4109b0
mov word [ebp - 0x497c], 0
mov dword [ebp - 0x4980], 0x3b002e
lea eax, [ebp - 0x497c]
push 0x1ffe
push eax
push 0x4196de
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
add eax, 0xffffe002
cmp eax, 0xffffe002
ja 0x4100ea
mov dword [ebp - 0x4980], 0x2e
mov esi, 0xfffffffe
push 0x2e
push ebx
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
nop dword [eax + eax]
cmp word [ebx + esi + 2], 0
lea esi, [esi + 2]
jne 0x410100
xor ecx, ecx
test eax, eax
setne al
cmp esi, 0x206
jle 0x410196
push 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x800
push 0x42d48e
push 0x40b
push eax
call dword [sym.imp.user32.dll_LoadStringW]
test eax, eax
jne 0x410182
test byte [0x41d038], 1
je 0x410174
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
mov ecx, 0xfffffff4
mov edx, 0x42d48e
call dbg.WCMD_output_asis_handle
jmp 0x4109b0
mov cl, al
mov dword [ebp - 0x1c], ecx
xor eax, eax
nop dword [eax]
movzx ecx, word [ebx + eax]
mov word [ebp + eax - 0x6cc], cx
add eax, 2
test cx, cx
jne 0x4101a0
lea eax, [ebp - 0x8980]
push 0x2000
push eax
push str.PATHEXT
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
add eax, 0xffffe000
cmp eax, 0xffffe000
ja 0x410203
movsd xmm0, qword [0x419718]
movsd qword [ebp - 0x8960], xmm0
movups xmm0, xmmword [0x419708]
movups xmmword [ebp - 0x8970], xmm0
movups xmm0, xmmword [str..bat_.com_.cmd_.exe]
movups xmmword [ebp - 0x8980], xmm0
test byte [0x41d038], 8
je 0x41024e
lea ecx, [ebp - 0x4980]
call dbg.wine_dbgstr_w
mov ebx, eax
lea ecx, [ebp - 0x6cc]
call dbg.wine_dbgstr_w
sub esp, 0x18
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.Searching_in__s_for__s_n
mov dword [esp + 8], str.WCMD_run_program
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x18
lea ebx, [ebp - 0x4980]
mov dword [ebp - 0x10], edi
jmp 0x410278
test ebx, ebx
mov edi, dword [ebp - 0x10]
jne 0x4105c9
mov eax, dword [ebp - 0x18]
mov ebx, eax
test eax, eax
je 0x4108e8
push 0x208
push 0
lea eax, [ebp - 0x2bc]
push eax
call sym._memset
add esp, 0xc
test edi, edi
je 0x4102c0
xor edx, edx
xor eax, eax
nop word cs:[eax + eax]
movzx ecx, word [ebx + eax]
mov word [ebp + eax - 0x2bc], cx
add eax, 2
test cx, cx
jne 0x4102a0
jmp 0x410420
movzx ecx, word [ebx]
mov esi, ebx
cmp cx, 0x3b
je 0x410320
xor eax, eax
mov byte [ebp - 0x14], 1
mov edx, ebx
nop word cs:[eax + eax]
cmp cx, 0x22
je 0x410300
movzx ecx, cx
test ecx, ecx
jne 0x410307
jmp 0x4105a5
movzx eax, byte [ebp - 0x14]
and eax, 1
lea esi, [edx + 2]
movzx ecx, word [edx + 2]
mov edx, esi
test eax, eax
sete byte [ebp - 0x14]
jne 0x4102e0
mov edx, esi
cmp cx, 0x3b
jne 0x4102e0
mov edi, esi
sub esi, ebx
push esi
push ebx
lea eax, [ebp - 0x2bc]
push eax
call sym._memcpy
add esp, 0xc
mov word [ebp + esi - 0x2bc], 0
add edi, 2
mov eax, 0xfffffffe
nop word [eax + eax]
cmp word [ebp + eax - 0x2ba], 0
lea eax, [eax + 2]
jne 0x410350
lea ecx, [ebp - 0x2bc]
cmp word [eax + ecx - 2], 0x22
jne 0x410378
sar eax, 1
mov word [ebp + eax*2 - 0x2be], 0
movzx eax, word [ebp - 0x2bc]
cmp ax, 0x22
mov dword [ebp - 0x18], edi
jne 0x4103ba
xor eax, eax
nop word [eax + eax]
movzx ecx, word [ebp + eax - 0x2ba]
mov word [ebp + eax - 0x4c4], cx
add eax, 2
test cx, cx
jne 0x410390
cmp word [ebp - 0x4c4], 0
mov edi, dword [ebp - 0x10]
jne 0x4103f8
jmp 0x41026b
mov word [ebp - 0x4c4], ax
test ax, ax
je 0x41059d
mov eax, 2
mov edi, dword [ebp - 0x10]
nop word cs:[eax + eax]
movzx ecx, word [ebp + eax - 0x2bc]
mov word [ebp + eax - 0x4c4], cx
add eax, 2
test cx, cx
jne 0x4103e0
push 0
lea eax, [ebp - 0x2bc]
push eax
push 0x104
lea eax, [ebp - 0x4c4]
push eax
call dbg.WCMD_get_fullpath
add esp, 0x10
test eax, eax
mov edx, dword [ebp - 0x18]
je 0x4109b0
lea eax, [ebp - 0x2bc]
nop word cs:[eax + eax]
cmp word [eax], 0
lea eax, [eax + 2]
jne 0x410430
mov dword [eax - 2], 0x5c
lea eax, [ebp - 0x2be]
nop word cs:[eax + eax]
cmp word [eax + 2], 0
lea eax, [eax + 2]
jne 0x410450
mov dword [ebp - 0x18], edx
xor ecx, ecx
nop
movzx edx, word [ebp + ecx - 0x6cc]
mov word [eax + ecx], dx
add ecx, 2
test dx, dx
jne 0x410460
mov esi, 0xfffffffe
nop dword [eax]
cmp word [ebp + esi - 0x2ba], 0
lea esi, [esi + 2]
jne 0x410480
cmp dword [ebp - 0x1c], 0
je 0x4104aa
lea eax, [ebp - 0x2bc]
push eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4105c9
add esi, ebp
add esi, 0xfffffd44
lea eax, [ebp - 0x2bc]
nop dword [eax + eax]
cmp word [eax], 0
lea eax, [eax + 2]
jne 0x4104c0
mov word [eax + 2], 0
mov dword [eax - 2], 0x2a002e
lea eax, [ebp - 0x980]
push eax
lea eax, [ebp - 0x2bc]
push eax
call dword [sym.imp.kernel32.dll_FindFirstFileW]
mov ebx, eax
push eax
call dword [sym.imp.kernel32.dll_FindClose]
cmp ebx, 0xffffffff
je 0x41026b
xor ebx, ebx
lea edi, [ebp - 0x8980]
nop word cs:[eax + eax]
push 0x3b
push edi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x410550
mov dword [ebp - 0x14], ebx
mov ebx, eax
sub ebx, edi
push ebx
push edi
push esi
mov edi, eax
call sym._memcpy
add esp, 0xc
mov word [esi + ebx], 0
mov ebx, dword [ebp - 0x14]
add edi, 2
jmp 0x410572
xor eax, eax
nop word cs:[eax + eax]
movzx ecx, word [edi + eax]
mov word [esi + eax], cx
add eax, 2
test cx, cx
jne 0x410560
xor edi, edi
lea eax, [ebp - 0x2bc]
push eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
mov eax, 1
cmovne ebx, eax
jne 0x410260
test edi, edi
jne 0x410510
jmp 0x410260
mov edi, dword [ebp - 0x10]
jmp 0x41026b
xor edi, edi
xor eax, eax
nop dword [eax]
movzx ecx, word [ebx + eax]
mov word [ebp + eax - 0x2bc], cx
add eax, 2
test cx, cx
jne 0x4105b0
jmp 0x410342
lea eax, [ebp - 0x2bc]
push 0x2e
push eax
call dword [sym.imp.ucrtbase.dll_wcsrchr]
add esp, 8
mov edi, eax
test byte [0x41d038], 8
mov ebx, dword [ebp + 8]
je 0x41061a
lea ecx, [ebp - 0x2bc]
call dbg.wine_dbgstr_w
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Found_as__s_n
mov dword [esp + 8], str.WCMD_run_program
mov dword [esp], 3
call dbg.wine_dbg_log
add esp, 0x14
test edi, edi
je 0x41064c
push str..bat
push edi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x41085a
push str..cmd
push edi
call dword [sym.imp.ucrtbase.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x41085a
lea esi, [ebp - 0x4c4]
push esi
push 0
lea eax, [ebp - 0x2bc]
push eax
call dword [sym.imp.shell32.dll_FindExecutableW]
xor ecx, ecx
cmp eax, 0x20
jl 0x410685
push 0x2000
push 0x2b4
lea eax, [ebp - 0x980]
push eax
push 0
push esi
call dword [sym.imp.shell32.dll_SHGetFileInfoW]
mov ecx, eax
mov dword [ebp - 0x14], ecx
xorps xmm0, xmm0
movups xmmword [ebp - 0x3c], xmm0
movups xmmword [ebp - 0x4c], xmm0
movups xmmword [ebp - 0x5c], xmm0
movups xmmword [ebp - 0x6c], xmm0
mov dword [ebp - 0x70], 0x44
mov dword [ebp - 0xb4], 0x44
lea eax, [ebp - 0xb4]
push eax
call dword [sym.imp.kernel32.dll_GetStartupInfoW]
movzx esi, word [ebp - 0x82]
mov word [ebp - 0x3e], si
mov edi, dword [ebp - 0x80]
mov dword [ebp - 0x3c], edi
test esi, esi
je 0x410769
test edi, edi
je 0x410769
mov eax, dword [edi]
mov dword [ebp - 0x18], eax
cmp si, 0x14
mov eax, 0x13
cmovae eax, esi
mov dword [ebp - 0x10], eax
push eax
call sym._malloc
add esp, 4
test eax, eax
je 0x4109bb
mov ebx, eax
push esi
push edi
push eax
call sym._memcpy
add esp, 0xc
mov eax, dword [ebp - 0x10]
mov word [ebp - 0x3e], ax
mov dword [ebp - 0x3c], ebx
mov esi, dword [ebp - 0x18]
test esi, esi
je 0x410723
test byte [ebx + 4], 1
je 0x410733
push 0xfffffffffffffff6
call dword [sym.imp.kernel32.dll_GetStdHandle]
mov dword [ebx + esi + 4], eax
or byte [ebx + 4], 1
cmp esi, 2
jb 0x41073e
test byte [ebx + 5], 1
je 0x41074e
push 0xfffffffffffffff5
call dword [sym.imp.kernel32.dll_GetStdHandle]
mov dword [ebx + esi + 8], eax
or byte [ebx + 5], 1
cmp esi, 3
jb 0x410759
test byte [ebx + 6], 1
je 0x410769
push 0xfffffffffffffff4
call dword [sym.imp.kernel32.dll_GetStdHandle]
mov dword [ebx + esi + 0xc], eax
or byte [ebx + 6], 1
sub esp, 0x28
lea eax, [ebp - 0x2c]
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x70]
mov dword [esp + 0x20], eax
movaps xmm0, xmmword [0x418f90]
movups xmmword [esp + 8], xmm0
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
lea eax, [ebp - 0x2bc]
mov dword [esp], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
call dword [sym.imp.kernel32.dll_CreateProcessW]
mov ebx, eax
push dword [ebp - 0x3c]
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
movzx eax, byte [0x421484]
or al, byte [0x421488]
test al, 1
je 0x41088c
test byte [0x42148c], 1
jne 0x41088c
test ebx, ebx
jne 0x41088c
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 2
jne 0x4108e8
mov eax, dword [ebp + 8]
cmp word [eax], 0x22
jne 0x4108e8
mov esi, dword [ebp + 8]
movzx ecx, word [esi + 2]
mov word [esi], cx
test cx, cx
mov edi, dword [ebp + 0xc]
je 0x410844
xor eax, eax
mov edx, esi
cmp cx, 0x22
cmove eax, edx
movzx ecx, word [edx + 4]
mov word [edx + 2], cx
add edx, 2
test cx, cx
jne 0x410817
test eax, eax
je 0x410844
add eax, 2
movzx ecx, word [eax]
mov word [eax - 2], cx
add eax, 2
test cx, cx
jne 0x410835
mov byte [0x42148c], 1
push edi
push esi
call dbg.WCMD_run_program
add esp, 8
jmp 0x4109b0
mov esi, dword [0x421480]
mov dword [0x421480], 0
push 0xffffffffffffffff
push 0
push dword [ebp + 0xc]
push ebx
lea eax, [ebp - 0x2bc]
push eax
call dbg.WCMD_batch
add esp, 0x14
mov dword [0x421480], esi
jmp 0x4109b0
test ebx, ebx
je 0x4108e8
cmp dword [0x421480], 0
je 0x4108a4
mov eax, dword [ebp - 0x14]
dec eax
cmp eax, 0xfffe
ja 0x4108af
push 0xffffffffffffffff
push dword [ebp - 0x2c]
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
push 0x42147c
push dword [ebp - 0x2c]
call dword [sym.imp.kernel32.dll_GetExitCodeProcess]
cmp dword [0x42147c], 0x103
jne 0x4108d3
mov dword [0x42147c], 0
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
push dword [ebp - 0x2c]
call esi
push dword [ebp - 0x28]
call esi
jmp 0x4109b0
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x41092d
mov dword [ebp - 0x980], 0
push 0xffffffffffffffff
lea eax, [ebp - 0x980]
push eax
push dword [ebp + 8]
call dbg.WCMD_ReadAndParseLine
add esp, 0xc
mov esi, dword [ebp - 0x980]
push edi
push 0
push esi
call dbg.WCMD_process_commands
add esp, 0xc
push esi
call dbg.WCMD_free_commands
add esp, 4
jmp 0x4109b0
push 0
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
push 0x800
push 0x42d48e
push 0x410
push eax
call dword [sym.imp.user32.dll_LoadStringW]
test eax, eax
mov esi, dword [ebp + 8]
jne 0x410998
test byte [0x41d038], 1
je 0x41098a
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
push 0x42d48e
call dbg.WCMD_output_stderr
add esp, 8
mov dword [0x42147c], 0x2331
add esp, 0x8974
pop esi
pop edi
pop ebx
pop ebp
ret
test byte [0x41d038], 2
je 0x4109e6
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]