Function at 0x40d344
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.00416eb4
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, 0x40d2eb
mov ecx, 0xa
cld
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40d38d
sbb eax, eax
or al, 1
add esp, 0x10
test eax, eax
jne 0x40d3a8
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea edi, [ecx - 0xb]
jmp 0x40d3b9
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.00416eb4
mov esi, eax
add esp, 0x20
add esp, 0xfffffff4
push 0x4000
call fcn.00416eb4
mov dword [ebp - 0xd8], eax
add esp, 0xfffffffc
push 0x4000
push eax
push 0x40d2f5
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 0x40c55d
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 0x40d2f5
call sub.KERNEL32.dll_SetEnvironmentVariableA
add esp, 8
test eax, eax
je 0x40d460
add esp, 0xfffffff8
push esi
push 0x40d2fa
jmp 0x40d46f
add esp, 0xfffffffc
call sub.KERNEL32.dll_GetLastError
push eax
push esi
push 0x40d314
call fcn.00408090
add esp, 0x10
add esp, 0xfffffff4
push 0x4000
call fcn.00416eb4
mov dword [ebp - 0xdc], eax
add esp, 0xfffffffc
push esi
push 0x40d339
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 0x40d4fb
add esp, 0xfffffff8
push ebx
mov eax, dword [ebp - 0xd4]
push eax
call fcn.0040d238
mov dword [ebp - 0xe0], eax
add esp, 0x10
xor ebx, ebx
cmp dword [ebp - 0xe0], 0
jne 0x40d5b6
mov esi, esi
add esp, 0xfffffff8
push dword [ebx*4 + 0x40d7e4]
mov eax, dword [ebp - 0xd4]
push eax
call fcn.0040d238
mov dword [ebp - 0xe0], eax
add esp, 0x10
inc ebx
cmp ebx, 4
jg 0x40d535
test eax, eax
je 0x40d50c
cmp dword [ebp - 0xe0], 0
jne 0x40d5b6
add esp, 0xfffffff8
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d2f5
call sub.KERNEL32.dll_SetEnvironmentVariableA
add esp, 8
test eax, eax
je 0x40d56c
add esp, 0xfffffff8
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d2fa
jmp 0x40d581
add esp, 0xfffffffc
call sub.KERNEL32.dll_GetLastError
push eax
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d314
call fcn.00408090
add esp, 0x10
add esp, 0xfffffffc
mov eax, dword [ebp - 0xd8]
push eax
push 0x40d339
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.00416fd0
add esp, 0xfffffff4
mov eax, dword [ebp - 0xd8]
push eax
call fcn.00416fd0
add esp, 0x20
add esp, 0xfffffff4
mov eax, dword [ebp - 0xdc]
push eax
call fcn.00416fd0
add esp, 0xfffffff4
mov eax, dword [ebp - 0xd4]
push eax
call fcn.00416fd0
mov eax, dword [ebp - 0xe0]
lea esp, [ebp - 0xf8]
pop ebx
pop esi
pop edi
leave
ret