Function at 0x40e870
Capabilities:
Check if file exists
Enumerate files on windows
Get file attributes
Move file
Query environment variable

Disassembly:
push ebp
mov eax, 0x50ec
mov ebp, esp
push edi
push esi
push ebx
call fcn.004240d8
sub esp, eax
cmp word [0x4331e0], 0
je 0x40f280
cmp word [0x42f1e0], 0
jne 0x40e8b9
xor eax, eax
mov edx, 0x2e
jmp 0x40e8aa
movzx edx, word [eax + 0x426a6e]
mov word [eax + 0x42f1e0], dx
add eax, 2
test dx, dx
jne 0x40e8a3
lea ebx, [ebp - 0x50a0]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], 0x104
mov dword [esp], 0x4331e0
call sym._WCMD_get_fullpath
test eax, eax
jne 0x40e8f0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp - 0x4e98]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0x104
mov dword [esp], 0x42f1e0
call sym._WCMD_get_fullpath
test eax, eax
je 0x40e8e3
test byte [0x425010], 8
jne 0x40f2ca
lea eax, [ebp - 0x4880]
mov dword [esp], ebx
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x4a88]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x4c90]
mov dword [esp + 8], eax
lea eax, [ebp - 0x50b4]
mov dword [esp + 4], eax
call dword [sym.imp.ucrtbase.dll__wsplitpath]
lea eax, [ebp - 0x4268]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_FindFirstFileW]
sub esp, 8
mov dword [ebp - 0x50c4], eax
cmp eax, 0xffffffff
je 0x40e8e3
lea esi, [ebp - 0x423c]
lea ebx, [ebp - 0x4678]
mov eax, esi
shr eax, 0x10
mov dword [ebp - 0x50c8], eax
lea eax, [ebp - 0x4470]
shr eax, 0x10
mov dword [ebp - 0x50cc], eax
mov eax, ebx
shr eax, 0x10
mov dword [ebp - 0x50d0], eax
nop
test byte [0x425010], 8
jne 0x40ebe0
xor eax, eax
nop
movzx edx, word [ebp + eax - 0x50b4]
mov word [ebp + eax - 0x4470], dx
add eax, 2
test dx, dx
jne 0x40e9c0
cmp word [ebp - 0x4470], 0
lea edx, [ebp - 0x4470]
je 0x40e9f9
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x40e9f0
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [ebp + eax - 0x4c90]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40ea00
lea eax, [ebp - 0x4e98]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x40ebc3
and eax, 0x10
je 0x40ebc5
xor eax, eax
lea esi, [esi]
movzx edx, word [ebp + eax - 0x4e98]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x40ea40
cmp word [ebp - 0x4678], 0
mov edx, ebx
je 0x40ea69
add edx, 2
cmp word [edx], 0
jne 0x40ea60
xor eax, eax
mov ecx, 0x5c
jmp 0x40ea79
movzx ecx, word [eax + 0x426a96]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40ea72
cmp word [ebp - 0x4678], 0
mov edx, ebx
je 0x40ea9a
add edx, 2
cmp word [edx], 0
jne 0x40ea91
xor eax, eax
lea esi, [esi]
movzx ecx, word [esi + eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40eaa0
cmp word [ebp - 0x4470], 0
lea edx, [ebp - 0x4470]
je 0x40eac9
add edx, 2
cmp word [edx], 0
jne 0x40eac0
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [esi + eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x40ead0
test byte [0x425010], 8
jne 0x40ed40
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x40ecd0
mov dword [esp + 4], 0x426dfe
mov edi, dword [sym.imp.ucrtbase.dll_wcsstr]
mov dword [esp], 0x437480
call edi
test eax, eax
je 0x40f1a2
mov dword [esp], 0x3ee
call sym._WCMD_LoadMessage
mov dword [esp + 4], ebx
mov dword [esp], eax
call dbg.WCMD_format_string
xor edx, edx
mov edi, eax
call sym._WCMD_ask_confirm.constprop.4
mov dword [esp], edi
mov dword [ebp - 0x50bc], eax
call dword [sym.imp.kernel32.dll_LocalFree]
mov edx, dword [ebp - 0x50bc]
sub esp, 4
test edx, edx
je 0x40eb85
mov eax, 1
mov dword [esp + 8], eax
lea eax, [ebp - 0x4470]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MoveFileExW]
sub esp, 0xc
test eax, eax
je 0x40efd0
lea eax, [ebp - 0x4268]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x50c4]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindNextFileW]
sub esp, 8
test eax, eax
jne 0x40e9b0
mov eax, dword [ebp - 0x50c4]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindClose]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
xor eax, eax
movzx edx, word [ebp + eax - 0x4e98]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x40ebc5
jmp 0x40eab0
mov edx, dword [ebp - 0x50c8]
test edx, edx
je 0x40f260
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, 0x42613d
test edi, edi
jne 0x40ed11
cmp word [ebp - 0x423c], 0
je 0x40ec2e
lea esi, [esi]
nop
add edi, 1
cmp word [ebp + edi*2 - 0x423c], 0
jne 0x40ec20
mov eax, 0x224c
lea edx, [ebp - 0x4016]
mov dword [ebp - 0x50bc], esi
mov word [ebp - 0x4018], ax
jmp 0x40ec76
cmp ax, 9
je 0x40f180
cmp ax, 0xa
jne 0x40f121
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
mov edi, dword [ebp - 0x50c0]
lea eax, [edi - 1]
mov dword [ebp - 0x50c0], eax
lea eax, [ebp - 0x3ef6]
cmp edx, eax
ja 0x40ece0
test edi, edi
jle 0x40ece0
add dword [ebp - 0x50bc], 2
mov eax, dword [ebp - 0x50bc]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x40f075
jbe 0x40ec50
cmp ax, 0x22
je 0x40f090
cmp ax, 0x5c
jne 0x40f121
mov eax, 0x5c5c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ec70
xor eax, eax
jmp 0x40eb63
mov edi, dword [ebp - 0x50c0]
mov byte [edx], 0x22
lea eax, [edx + 1]
test edi, edi
jle 0x40ed00
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x4018]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Processing_file__s_n
mov dword [esp + 8], str.WCMD_move
mov dword [esp + 4], 0x425010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.9
jmp 0x40e9bd
mov edx, dword [ebp - 0x50cc]
test edx, edx
je 0x40f210
lea eax, [ebp - 0x4470]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, 0x42613d
test edi, edi
jne 0x40ee61
cmp word [ebp - 0x4470], 0
je 0x40ed8f
add edi, 1
cmp word [ebp + edi*2 - 0x4470], 0
jne 0x40ed81
mov eax, 0x224c
lea ecx, [ebp - 0x4470]
lea edx, [ebp - 0x4016]
mov word [ebp - 0x4018], ax
mov dword [ebp - 0x50bc], ecx
jmp 0x40edd6
cmp ax, 9
je 0x40f110
cmp ax, 0xa
jne 0x40f0b2
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
mov edi, dword [ebp - 0x50c0]
lea eax, [edi - 1]
mov dword [ebp - 0x50c0], eax
test edi, edi
jle 0x40ee30
lea eax, [ebp - 0x3ef6]
cmp edx, eax
ja 0x40ee30
add dword [ebp - 0x50bc], 2
mov eax, dword [ebp - 0x50bc]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x40f0a1
jbe 0x40edb0
cmp ax, 0x22
je 0x40f191
cmp ax, 0x5c
jne 0x40f0b2
mov eax, 0x5c5c
add edx, 2
mov word [edx - 2], ax
jmp 0x40edd0
mov edi, dword [ebp - 0x50c0]
mov byte [edx], 0x22
lea eax, [edx + 1]
test edi, edi
jle 0x40ee50
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x4018]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Source__s_n
mov dword [esp + 8], str.WCMD_move
mov dword [esp + 4], 0x425010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.9
test byte [0x425010], 8
je 0x40eaed
mov edx, dword [ebp - 0x50d0]
test edx, edx
je 0x40f240
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, 0x42613d
test edi, edi
jne 0x40efa2
cmp word [ebp - 0x4678], 0
je 0x40eedb
add edi, 1
cmp word [ebx + edi*2], 0
jne 0x40eed1
mov eax, 0x224c
lea edx, [ebp - 0x4016]
mov dword [ebp - 0x50bc], ebx
mov word [ebp - 0x4018], ax
jmp 0x40ef1b
cmp ax, 9
je 0x40f042
cmp ax, 0xa
jne 0x40efe4
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
mov edi, dword [ebp - 0x50c0]
lea eax, [edi - 1]
mov dword [ebp - 0x50c0], eax
test edi, edi
jle 0x40ef71
lea eax, [ebp - 0x3ef6]
cmp edx, eax
ja 0x40ef71
add dword [ebp - 0x50bc], 2
mov eax, dword [ebp - 0x50bc]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x40f064
jbe 0x40eef5
cmp ax, 0x22
je 0x40f053
cmp ax, 0x5c
jne 0x40efe4
mov eax, 0x5c5c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ef15
mov edi, dword [ebp - 0x50c0]
mov byte [edx], 0x22
lea eax, [edx + 1]
test edi, edi
jle 0x40ef91
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x4018]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Dest____s_n
mov dword [esp + 8], str.WCMD_move
mov dword [esp + 4], 0x425010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.9
jmp 0x40eaed
call dbg.WCMD_print_error
mov dword [0x437470], 1
jmp 0x40eb85
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x40f2c0
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov byte [edx - 2], cl
jmp 0x40ef15
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ef15
mov eax, 0x225c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ef15
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ef15
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ec70
mov eax, 0x225c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ec70
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
jmp 0x40edd0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x40f2b0
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov byte [edx - 2], cl
jmp 0x40edd0
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
jmp 0x40edd0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x40f2a0
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefWCMD_choice]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdefWCMD_choice]
mov byte [edx - 1], al
mov byte [edx - 2], cl
jmp 0x40ec70
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
jmp 0x40ec70
mov eax, 0x225c
add edx, 2
mov word [edx - 2], ax
jmp 0x40edd0
mov dword [esp + 4], 0x426df8
mov dword [esp], 0x437480
call edi
test eax, eax
jne 0x40eb5e
mov eax, dword [0x4372a8]
lea edi, [ebp - 0x4018]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], edi
mov dword [ebp - 0x50bc], eax
mov dword [esp], str.COPYCMD
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
sub eax, 1
sub esp, 0xc
cmp eax, 0x1ffe
jbe 0x40f31f
mov eax, dword [ebp - 0x50bc]
test eax, eax
jne 0x40eb21
jmp 0x40eb5e
lea eax, [ebp - 0x4470]
mov dword [esp], 0x426130
mov dword [ebp - 0x50bc], eax
movzx eax, word [ebp - 0x50bc]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
jmp 0x40ee61
movzx eax, bx
mov dword [esp], 0x426130
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
jmp 0x40efa2
movzx eax, si
mov dword [esp], 0x426130
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.7
jmp 0x40ed11
mov dword [esp], 0x3f2
call sym._WCMD_LoadMessage
mov dword [esp], eax
call dbg.WCMD_output_stderr
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov byte [edx], al
add edx, 1
jmp 0x40ec70
mov byte [edx], al
add edx, 1
jmp 0x40edd0
mov byte [edx], al
add edx, 1
jmp 0x40ef15
lea eax, [ebp - 0x4e98]
call sym._wine_dbgstr_wn.constprop.5
mov edi, eax
mov eax, 0x4331e0
call sym._wine_dbgstr_wn.constprop.5
mov esi, eax
mov eax, ebx
call sym._wine_dbgstr_wn.constprop.5
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Move_from__s__s__to__s_n
mov dword [esp + 8], str.WCMD_move
mov dword [esp + 4], 0x425010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.9
jmp 0x40e927
mov ecx, dword [sym.imp.kernel32.dll_lstrcmpiW]
mov dword [esp + 4], 0x426df8
mov dword [esp], edi
mov dword [ebp - 0x50c0], ecx
call ecx
mov ecx, dword [ebp - 0x50c0]
sub esp, 8
test eax, eax
je 0x40eb5e
mov dword [esp + 4], 0x426dfe
mov dword [esp], edi
call ecx
sub esp, 8
test eax, eax
jne 0x40f1f6
jmp 0x40eb21