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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xec
push edi
push esi
push ebx
mov ebx, dword [ebp + 8]
add esp, 0xfffffff4
push 0x7d0
call fcn.00417534
mov dword [ebp - 0xd4], eax
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea esi, [ebx + ecx - 0xa]
mov edi, 0x40d96b
mov ecx, 0xa
cld
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40da0d
sbb eax, eax
or al, 1
add esp, 0x10
test eax, eax
jne 0x40da28
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea edi, [ecx - 0xb]
jmp 0x40da39
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea edi, [ecx - 0xa]
add esp, 0xfffffffc
push edi
push ebx
mov eax, dword [ebp - 0xd4]
push eax
call sub.msvcrt.dll_strncpy
mov eax, dword [ebp - 0xd4]
mov byte [edi + eax], 0
add esp, 0xfffffff4
push 0x4000
call fcn.00417534
mov esi, eax
add esp, 0x20
add esp, 0xfffffff4
push 0x4000
call fcn.00417534
mov dword [ebp - 0xd8], eax
add esp, 0xfffffffc
push 0x4000
push eax
push 0x40d975
call sub.KERNEL32.dll_GetEnvironmentVariableA
add esp, 0xfffffffc
mov eax, dword [ebp - 0xd8]
push eax
push esi
call sub.msvcrt.dll_strcpy
add esp, 0x20
add esp, 0xfffffff8
push 0x40cbdd
push esi
call sub.msvcrt.dll_strcat
add esp, 0xfffffff8
mov eax, dword [ebp - 0xd4]
push eax
push esi
call sub.msvcrt.dll_strcat
add esp, 0x20
add esp, 0xfffffff8
push esi
push 0x40d975
call sub.KERNEL32.dll_SetEnvironmentVariableA
add esp, 8
test eax, eax
je 0x40dae0
add esp, 0xfffffff8
push esi
push 0x40d97a
jmp 0x40daef
add esp, 0xfffffffc
call sub.KERNEL32.dll_GetLastError
push eax
push esi
push 0x40d994
call fcn.004086f0
add esp, 0x10
add esp, 0xfffffff4
push 0x4000
call fcn.00417534
mov dword [ebp - 0xdc], eax
add esp, 0xfffffffc
push esi
push 0x40d9b9
push eax
call sub.msvcrt.dll_sprintf
add esp, 0x20
add esp, 0xfffffff4
mov eax, dword [ebp - 0xdc]
push eax
call sub.msvcrt.dll__putenv
mov dword [ebp - 0xe0], 0
add esp, 0xfffffffc
push 0xc8
lea ebx, [ebp - 0xd0]
push ebx
push 0x98
call fcn.00401aa8
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
add esp, 0x20
cmp ecx, 0xfffffffe
je 0x40db7b
add esp, 0xfffffff8
push ebx
mov eax, dword [ebp - 0xd4]
push eax
call fcn.0040d8b8
mov dword [ebp - 0xe0], eax
add esp, 0x10
xor ebx, ebx
cmp dword [ebp - 0xe0], 0
jne 0x40dc36
mov esi, esi
add esp, 0xfffffff8
push dword [ebx*4 + 0x40de64]
mov eax, dword [ebp - 0xd4]
push eax
call fcn.0040d8b8
mov dword [ebp - 0xe0], eax
add esp, 0x10
inc ebx
cmp ebx, 4
jg 0x40dbb5
test eax, eax
je 0x40db8c
cmp dword [ebp - 0xe0], 0
jne 0x40dc36
add esp, 0xfffffff8
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d975
call sub.KERNEL32.dll_SetEnvironmentVariableA
add esp, 8
test eax, eax
je 0x40dbec
add esp, 0xfffffff8
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d97a
jmp 0x40dc01
add esp, 0xfffffffc
call sub.KERNEL32.dll_GetLastError
push eax
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d994
call fcn.004086f0
add esp, 0x10
add esp, 0xfffffffc
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d9b9
mov eax, dword [ebp - 0xdc]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0xfffffff4
mov eax, dword [ebp - 0xdc]
push eax
call sub.msvcrt.dll__putenv
add esp, 0x20
add esp, 0xfffffff4
push esi
call fcn.00417650
add esp, 0xfffffff4
mov eax, dword [ebp - 0xd8]
push eax
call fcn.00417650
add esp, 0x20
add esp, 0xfffffff4
mov eax, dword [ebp - 0xdc]
push eax
call fcn.00417650
add esp, 0xfffffff4
mov eax, dword [ebp - 0xd4]
push eax
call fcn.00417650
mov eax, dword [ebp - 0xe0]
lea esp, [ebp - 0xf8]
pop ebx
pop esi
pop edi
leave
ret