Function at 0x409650
Capabilities:
Query environment variable
Set environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
mov eax, 0x4008
call sym.__alloca
mov eax, dword [0x4162c8]
movzx eax, word [eax]
mov ecx, dword [0x418754]
or ax, word [ecx]
jne 0x40968c
call dword [sym.imp.kernel32.dll_GetEnvironmentStringsW]
mov ecx, eax
xor edx, edx
add esp, 0x4008
pop esi
pop edi
pop ebx
pop ebp
jmp dbg.WCMD_setshow_sortenv
mov esi, dword [ebp + 8]
push 0xffffffffffffffff
push 0x417ac8
push 2
push esi
push 0x1001
push 0x400
call dword [sym.imp.kernel32.dll_CompareStringW]
cmp eax, 2
jne 0x4097fd
add esi, 4
jmp 0x4096c3
add esi, 2
movzx eax, word [esi]
cmp eax, 9
je 0x4096c0
cmp eax, 0x20
je 0x4096c0
cmp eax, 0x22
jne 0x409720
push esi
call sym._WCMD_strip_quotes
add esp, 4
test eax, eax
je 0x4096e7
mov word [eax], 0
test byte [0x41d010], 8
je 0x40971d
mov ecx, esi
call dbg.wine_dbgstr_wn
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.set:_Stripped_command_line__s_n
mov dword [esp + 8], str.WCMD_setshow_env
mov dword [esp], 3
call sym._wine_dbg_log_1
add esp, 0x14
movzx eax, word [esi]
test ax, ax
je 0x40986d
push 0x3d
push esi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x40986d
mov word [eax], 0
cmp word [eax + 2], 0
je 0x409755
add eax, 2
push eax
call sym._WCMD_output_asis
add esp, 4
push 0xfffffffffffffff6
call dword [sym.imp.kernel32.dll_GetStdHandle]
lea ecx, [ebp - 0x10]
lea ebx, [ebp - 0x4014]
push ecx
push 0x2000
push ebx
push eax
call dbg.WCMD_ReadFile
add esp, 0x10
test eax, eax
je 0x4098b2
mov eax, dword [ebp - 0x10]
cmp eax, 2
jb 0x4098b2
mov word [ebp + eax*2 - 0x4016], 0
cmp word [ebp + eax*2 - 0x4018], 0xd
jne 0x4097a9
mov word [ebp + eax*2 - 0x4018], 0
test byte [0x41d010], 8
je 0x4097f0
mov ecx, esi
call dbg.wine_dbgstr_wn
mov edi, eax
lea ecx, [ebp - 0x4014]
call dbg.wine_dbgstr_wn
sub esp, 0x18
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], str.set__p:_Setting_var__s_to__s_n
mov dword [esp + 8], str.WCMD_setshow_env
mov dword [esp], 3
call sym._wine_dbg_log_1
add esp, 0x18
push ebx
push esi
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
jmp 0x4098b2
push 0xffffffffffffffff
push 0x417b22
push 2
push esi
push 0x1001
push 0x400
call dword [sym.imp.kernel32.dll_CompareStringW]
cmp eax, 2
jne 0x4098bd
mov dword [ebp - 0x10], 0
add esi, 4
push esi
call dword [sym.imp.ucrtbase.dll_wcslen]
add esp, 4
lea eax, [eax*2 + 2]
push eax
push 0
call sym._xrealloc
add esp, 8
mov edi, eax
jmp 0x409853
add esi, 2
mov dword [ebp - 0x14], esi
movzx ecx, word [esi]
cmp ecx, 0x22
je 0x409850
test ecx, ecx
je 0x409874
mov word [eax], cx
add eax, 2
mov esi, dword [ebp - 0x14]
jmp 0x409850
push 0x3f2
jmp 0x4098a1
mov word [eax], 0
mov dword [ebp - 0x14], edi
lea ecx, [ebp - 0x14]
lea edx, [ebp - 0x10]
push 0
call dbg.WCMD_handleExpression
add esp, 4
mov esi, eax
push edi
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
test esi, esi
jle 0x4099bc
push esi
call sym._WCMD_LoadMessage
add esp, 4
push eax
call dbg.WCMD_output_stderr
add esp, 4
add esp, 0x4008
pop esi
pop edi
pop ebx
pop ebp
ret
cmp word [esi], 0x22
jne 0x40990b
push esi
call sym._WCMD_strip_quotes
add esp, 4
test eax, eax
je 0x4098d5
mov word [eax], 0
test byte [0x41d010], 8
je 0x40990b
mov ecx, esi
call dbg.wine_dbgstr_wn
sub esp, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.set:_Stripped_command_line__s_n
mov dword [esp + 8], str.WCMD_setshow_env
mov dword [esp], 3
call sym._wine_dbg_log_1
add esp, 0x14
push 0x3d
push esi
call dword [sym.imp.ucrtbase.dll_wcschr]
add esp, 8
test eax, eax
je 0x4099fb
mov ecx, eax
add ecx, 2
mov word [eax], 0
xor edi, edi
cmp word [eax + 2], 0
cmovne edi, ecx
test byte [0x41d010], 8
je 0x409976
mov ecx, esi
call dbg.wine_dbgstr_wn
mov ebx, eax
mov ecx, edi
call dbg.wine_dbgstr_wn
sub esp, 0x18
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.set:_Setting_var__s_to__s_n
mov dword [esp + 8], str.WCMD_setshow_env
mov dword [esp], 3
call sym._wine_dbg_log_1
add esp, 0x18
push edi
push esi
call dword [sym.imp.kernel32.dll_SetEnvironmentVariableW]
mov ecx, dword fs:[0x18]
test eax, eax
jne 0x409996
cmp dword [ecx + 0x34], 0xcb
je 0x409a29
test eax, eax
je 0x409a39
mov eax, dword [0x41874c]
cmp dword [eax], 0
jne 0x4098b2
mov eax, dword [0x4162c0]
mov dword [eax], 0
jmp 0x4098b2
mov eax, dword [0x4162bc]
cmp dword [eax], 0
jne 0x4098b2
mov eax, dword [ebp - 0x10]
sub esp, 0x10
mov dword [esp + 0xc], eax
lea esi, [ebp - 0x4014]
mov dword [esp], esi
mov dword [esp + 4], 0x2000
call sym._swprintf
add esp, 0x10
push esi
call sym._WCMD_output_asis
add esp, 4
jmp 0x4098b2
call dword [sym.imp.kernel32.dll_GetEnvironmentStringsW]
mov ecx, eax
mov edx, esi
call dbg.WCMD_setshow_sortenv
test eax, eax
jne 0x4098b2
push 0x3fb
call sym._WCMD_LoadMessage
add esp, 4
push esi
push eax
call dbg.WCMD_output_stderr
add esp, 8
mov eax, dword [0x4162c0]
mov dword [eax], 1
jmp 0x4098b2
add esp, 0x4008
pop esi
pop edi
pop ebx
pop ebp
jmp dbg.WCMD_print_error