Function at 0x40c2a0
Capabilities:
Query environment variable
Set current directory
Set environment variable

Disassembly:
mov eax, dword [0x4231c8]
test eax, eax
je 0x40c4b0
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x25c
mov ecx, dword [0x434424]
mov dword [ebp - 0x234], ecx
test ecx, ecx
je 0x40c2d1
mov eax, dword [eax + 4]
cmp dword [ecx + 0xc], eax
je 0x40c2e0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ecx]
mov dword [0x434424], eax
call dword [sym.imp.kernel32.dll_GetEnvironmentStringsW]
mov dword [ebp - 0x238], eax
test eax, eax
je sym._WCMD_endlocal.cold
call sym._WCMD_dupenv.part.0
cmp word [eax], 0
mov dword [ebp - 0x22c], eax
je 0x40c38b
mov edx, dword [sym.imp.ucrtbase.dll_wcschr]
mov edi, dword [ebp - 0x22c]
xor esi, esi
xor eax, eax
mov dword [ebp - 0x230], edx
lea esi, [esi]
mov ebx, edi
lea esi, [esi]
add ebx, 2
cmp word [ebx], 0
jne 0x40c330
mov ecx, dword [ebp - 0x22c]
sub ebx, edi
mov dword [esp + 4], 0x3d
sar ebx, 1
lea eax, [ecx + eax*2 + 2]
inc ebx
mov dword [esp], eax
mov eax, dword [ebp - 0x230]
call eax
test eax, eax
je 0x40c378
xor ecx, ecx
mov word [eax], cx
mov dword [esp + 4], 0
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
sub esp, 8
mov edx, dword [ebp - 0x22c]
add esi, ebx
mov eax, esi
lea edi, [edx + esi*2]
cmp word [edi], 0
jne 0x40c328
mov eax, dword [ebp - 0x22c]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_LocalFree]
mov dword [ebp - 0x23c], eax
call eax
mov eax, dword [ebp - 0x238]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FreeEnvironmentStringsW]
mov eax, dword [ebp - 0x234]
sub esp, 4
mov edx, dword [eax + 8]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x22c], edx
mov dword [0x4231d8], eax
test byte [0x423010], 8
jne 0x40c4b1
mov eax, dword [ebp - 0x22c]
cmp word [eax], 0
je 0x40c463
mov edx, dword [sym.imp.ucrtbase.dll_wcschr]
mov edi, dword [ebp - 0x22c]
xor esi, esi
xor eax, eax
mov dword [ebp - 0x230], edx
lea esi, [esi]
mov ebx, edi
lea esi, [esi]
add ebx, 2
cmp word [ebx], 0
jne 0x40c408
mov ecx, dword [ebp - 0x22c]
sub ebx, edi
mov dword [esp + 4], 0x3d
sar ebx, 1
lea eax, [ecx + eax*2 + 2]
inc ebx
mov dword [esp], eax
mov eax, dword [ebp - 0x230]
call eax
test eax, eax
je 0x40c450
xor edx, edx
add eax, 2
mov word [eax - 2], dx
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
sub esp, 8
mov edx, dword [ebp - 0x22c]
add esi, ebx
mov eax, esi
lea edi, [edx + esi*2]
cmp word [edi], 0
jne 0x40c400
mov eax, dword [ebp - 0x234]
movzx eax, word [eax + 4]
mov dword [esp], eax
call dword [sym.imp.user32.dll_IsCharAlphaW]
sub esp, 4
test eax, eax
jne 0x40c4de
mov eax, dword [ebp - 0x22c]
mov esi, dword [ebp - 0x23c]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x234]
sub esp, 4
mov dword [esp], eax
call esi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
ret
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Delayed_expansion_now__d_n
mov dword [esp + 8], str.WCMD_endlocal
mov dword [esp + 4], 0x423010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x40c3da
mov eax, dword [ebp - 0x234]
lea edx, [ebp - 0x228]
lea ebx, [ebp - 0x220]
movzx eax, word [eax + 4]
mov dword [esp], edx
mov dword [esp + 4], 0x4366a0
mov dword [esp + 8], eax
call dword [sym.imp.user32.dll_wsprintfW]
lea edx, [ebp - 0x228]
mov dword [esp + 4], ebx
mov dword [esp + 8], 0x104
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
sub esp, 0xc
test eax, eax
je 0x40c47d
test byte [0x423010], 8
jne 0x40c549
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_SetCurrentDirectoryW]
sub esp, 4
jmp 0x40c47d
mov eax, ebx
shr eax, 0x10
je 0x40c5a0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, 0x4350cb
test edx, edx
jne 0x40c576
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Resetting_cwd_to__s_n
mov dword [esp + 8], str.WCMD_endlocal
mov dword [esp + 4], 0x423010
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x40c538
movzx eax, bx
mov dword [esp], 0x4350be
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x40c576