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

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, dword [0x43bbd0]
mov eax, dword [ecx + 4]
test eax, eax
je 0x401856
cmp dword [ecx + 0x10], 0
je 0x401856
push eax
call fcn.0041f3e5
mov ecx, dword [0x43bbd0]
add esp, 4
mov eax, dword [ecx + 0x220]
test eax, eax
je 0x40186f
push eax
call fcn.0041f3e5
mov ecx, dword [0x43bbd0]
add esp, 4
mov eax, dword [ecx + 0x21c]
test eax, eax
je 0x401888
push eax
call fcn.0041f3e5
mov ecx, dword [0x43bbd0]
add esp, 4
mov ecx, dword [ecx + 0x250]
xor edx, edx
push esi
push edi
call fcn.00416820
mov edx, dword [0x43bbd0]
mov eax, dword [edx + 0x250]
test eax, eax
je 0x4018be
mov esi, dword [eax]
push eax
call fcn.0041f3e5
add esp, 4
mov eax, esi
test esi, esi
jne 0x4018a7
mov edx, dword [0x43bbd0]
mov eax, dword [edx + 0x24c]
lea ecx, [edx + 0x258]
mov dword [0x43a8f0], eax
mov edi, dword [ecx]
mov dword [ebp - 4], edi
test edi, edi
je 0x401a52
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov eax, dword [edi]
mov dword [ecx], eax
mov eax, dword [edi + 4]
mov dword [0x43a948], eax
mov eax, dword [edi + 8]
mov dword [0x43bbf0], eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov edi, eax
test edi, edi
je 0x4019c2
cmp word [edi], 0
mov esi, edi
je 0x40192f
nop
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401915
sub ecx, edx
sar ecx, 1
lea esi, [esi + ecx*2]
add esi, 2
cmp word [esi], ax
jne 0x401910
sub esi, edi
add esi, 2
and esi, 0xfffffffe
push esi
call fcn.0041f424
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4019b5
push esi
push edi
push ebx
call fcn.0041ec00
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
cmp word [ebx], 0
mov esi, ebx
je 0x4019aa
lea eax, [esi + 2]
push 0x3d
push eax
call fcn.0041de51
mov edi, eax
add esp, 8
test edi, edi
je 0x401984
xor eax, eax
push eax
push esi
mov word [edi], ax
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea esi, [edi + 2]
mov ecx, esi
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401990
sub ecx, edx
sar ecx, 1
lea esi, [esi + ecx*2]
add esi, 2
cmp word [esi], ax
jne 0x401960
push ebx
call fcn.0041f3e5
add esp, 4
jmp 0x4019bc
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov ebx, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov edi, dword [ebp - 4]
mov edi, dword [edi + 0xc]
cmp word [edi], 0
je 0x401a17
nop
lea eax, [edi + 2]
push 0x3d
push eax
call fcn.0041de51
mov esi, eax
add esp, 8
test esi, esi
je 0x4019f2
xor eax, eax
mov word [esi], ax
add esi, 2
push esi
push edi
call ebx
mov edi, esi
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4019f7
sub eax, edx
sar eax, 1
lea edi, [edi + eax*2]
add edi, 2
cmp word [edi], cx
jne 0x4019d0
mov eax, dword [ebp - 4]
mov edi, dword [eax + 0xc]
push edi
call fcn.0041f3e5
push dword [ebp - 4]
call fcn.0041f3e5
mov eax, dword [0x43bbd0]
add esp, 8
mov edi, dword [eax + 0x258]
lea ecx, [eax + 0x258]
mov dword [ebp - 4], edi
test edi, edi
jne 0x4018e3
mov eax, dword [eax]
pop ebx
pop edi
mov dword [0x43bbd0], eax
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [edx]
pop edi
mov dword [0x43bbd0], eax
pop esi
mov esp, ebp
pop ebp
ret