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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push 0xffffffffffffffff
push 0x436bb3
mov eax, dword fs:[0]
push eax
sub esp, 0x1bc
mov eax, dword [0x45e4c0]
xor eax, esp
mov dword [esp + 0x1b4], eax
push esi
push edi
mov eax, dword [0x45e4c0]
xor eax, esp
push eax
lea eax, [esp + 0x1c8]
mov dword fs:[0], eax
sub esp, 8
call fcn.00401e70
mov dword [esp + 0x1d0], 0
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x4023d7
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401fd0
sub ecx, edx
sar ecx, 1
je 0x4023d7
mov dword [esp + 0x1c], 0
mov byte [esp + 0x1d0], 1
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov esi, eax
mov dword [esp + 0x1c], esi
test esi, esi
jne 0x40200f
lea edi, [eax + 1]
jmp 0x4023ba
mov edx, esi
lea ecx, [esp + 0x9c]
call fcn.0041ac60
mov byte [esp + 0x1d0], 2
xor ecx, ecx
mov word [esp + 0xb4], cx
lea ecx, [esp + 0xb4]
mov dword [esp + 0xc4], 0
mov dword [esp + 0xc8], 0
push eax
mov dword [esp + 0xcc], 7
mov dword [esp + 0xc8], 0
call fcn.00402970
mov byte [esp + 0x1d0], 4
cmp dword [esp + 0xb0], 8
jb 0x402089
push dword [esp + 0x9c]
call fcn.00421a46
add esp, 4
push 1
push 0xffffffffffffffff
xor eax, eax
mov dword [esp + 0xb8], 7
push 0x452078
lea ecx, [esp + 0xc0]
mov dword [esp + 0xb8], 0
mov word [esp + 0xa8], ax
call fcn.00403260
push eax
push 0
lea eax, [esp + 0xd4]
push eax
lea ecx, [esp + 0xc0]
call fcn.004025d0
mov byte [esp + 0x1d0], 6
lea ecx, [esp + 0xb4]
push eax
call fcn.004024b0
mov byte [esp + 0x1d0], 4
cmp dword [esp + 0xe0], 8
jb 0x40210b
push dword [esp + 0xcc]
call fcn.00421a46
add esp, 4
xor eax, eax
mov dword [esp + 0xe0], 7
mov dword [esp + 0x9c], eax
mov dword [esp + 0xdc], 0
mov word [esp + 0xcc], ax
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
mov byte [esp + 0x1d0], 7
push eax
push eax
push 0x4520c8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
jne 0x402161
lea edi, [eax + 1]
jmp 0x40233c
inc eax
lea ecx, [esp + 0x9c]
push eax
call fcn.004026e0
mov eax, dword [esp + 0xa0]
mov edi, dword [esp + 0x9c]
sub eax, edi
sar eax, 1
push eax
push edi
push 0x4520c8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push edi
lea ecx, [esp + 0xe8]
call fcn.00402450
mov byte [esp + 0x1d0], 8
lea edx, [esp + 0xe4]
push ecx
lea ecx, [esp + 0x100]
call fcn.00404200
add esp, 4
mov byte [esp + 0x1d0], 9
lea ecx, [esp + 0xb4]
push ecx
mov edx, eax
lea ecx, [esp + 0xd0]
call fcn.00404180
add esp, 4
mov byte [esp + 0x1d0], 0xa
cmp dword [eax + 0x14], 8
jb 0x4021eb
mov eax, dword [eax]
push eax
push 0x4520c8
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
sete byte [esp + 0x1b]
mov byte [esp + 0x1d0], 9
lea ecx, [esp + 0xcc]
call fcn.004024f0
mov byte [esp + 0x1d0], 8
lea ecx, [esp + 0xfc]
call fcn.004024f0
cmp byte [esp + 0x1b], 0
je 0x402237
mov edi, 1
jmp 0x402328
push 0x44
lea eax, [esp + 0x58]
push 0
push eax
call fcn.00425a40
add esp, 0xc
mov dword [esp + 0x54], 0x44
lea eax, [esp + 0x54]
mov dword [esp + 0x24], 0
mov dword [esp + 0x40], eax
lea ecx, [esp + 0x114]
lea eax, [esp + 0x44]
mov dword [esp + 0x20], 0
mov dword [esp + 0x38], eax
xorps xmm0, xmm0
lea eax, [esp + 0x38]
movdqa xmmword [esp + 0x44], xmm0
push eax
lea eax, [esp + 0x44]
mov dword [esp + 0x2c], 0
push eax
lea eax, [esp + 0x3c]
mov dword [esp + 0x44], 0
push eax
lea eax, [esp + 0x38]
mov dword [esp + 0x3c], 0
push eax
lea eax, [esp + 0x40]
mov dword [esp + 0x3c], 0
push eax
lea eax, [esp + 0x50]
mov dword [esp + 0x48], 0
push eax
lea eax, [esp + 0x40]
push eax
lea eax, [esp + 0x3c]
push eax
lea eax, [ebp + 0x10]
push eax
lea eax, [esp + 0x48]
push eax
call fcn.00407d20
mov byte [esp + 0x1d0], 0xb
lea ecx, [esp + 0x114]
call fcn.00408a60
test eax, eax
je 0x40230c
push dword [esp + 0x44]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [esp + 0x48]
call edi
xor edi, edi
jmp 0x402314
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov byte [esp + 0x1d0], 8
lea ecx, [esp + 0x114]
call fcn.00407ed0
mov byte [esp + 0x1d0], 7
lea ecx, [esp + 0xe4]
call fcn.004024f0
mov byte [esp + 0x1d0], 4
mov eax, dword [esp + 0x9c]
test eax, eax
je 0x402379
push eax
call fcn.00421a46
add esp, 4
mov dword [esp + 0x9c], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0xa4], 0
mov byte [esp + 0x1d0], 1
cmp dword [esp + 0xc8], 8
jb 0x40239a
push dword [esp + 0xb4]
call fcn.00421a46
add esp, 4
xor eax, eax
mov dword [esp + 0xc8], 7
mov dword [esp + 0xc4], 0
mov word [esp + 0xb4], ax
mov byte [esp + 0x1d0], 0
test esi, esi
je 0x4023dc
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [esp + 0x1c], 0
jmp 0x4023dc
mov edi, 1
mov dword [esp + 0x1d0], 0xffffffff
call fcn.00401ea0
mov eax, edi
mov ecx, dword [esp + 0x1c8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x1b4]
xor ecx, esp
call fcn.004210ea
mov esp, ebp
pop ebp
ret 0x10