Function at 0x402843
Capabilities:
Create directory
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov esi, dword [sym.imp.MSVCRT.dll_getenv]
push edi
push str.ACTIVESTATE_HOME
call esi
and dword [ebp - 8], 0
mov ebx, eax
test ebx, ebx
pop ecx
jne 0x4028d9
call fcn.00402a37
mov ebx, eax
test ebx, ebx
mov dword [ebp - 8], ebx
jne 0x4028d9
push str.HOME
call esi
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x4028d9
push str.USERPROFILE
call esi
mov ebx, eax
pop ecx
test ebx, ebx
mov dword [ebp - 4], str.Application_Data
jne 0x4028d3
push str.HOMEDRIVE
call esi
mov ebx, eax
mov dword [esp], str.HOMEPATH
call esi
test ebx, ebx
pop ecx
mov dword [ebp - 4], eax
jne 0x4028d3
push str.windir
call esi
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x4028d3
push str.Couldnt_find_HOME___USERPROFILE___HOMEDRIVEHOMEPATH___windir
call dword [sym.imp.MSVCRT.dll__strdup]
pop ecx
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
jmp 0x402a19
cmp dword [ebp - 4], 0
jne 0x4028f9
push ebx
call sub.MSVCRT.dll_strlen
cmp eax, 2
pop ecx
jne 0x4028f2
cmp byte [ebx + 1], 0x3a
mov dword [ebp - 4], 0x40e8a4
je 0x4028f9
mov dword [ebp - 4], 0x40e774
push dword [ebp - 4]
call sub.MSVCRT.dll_strlen
push ebx
mov esi, eax
call sub.MSVCRT.dll_strlen
mov edi, dword [ebp + 0xc]
add eax, esi
mov dword [edi], eax
add eax, 0x14
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, dword [ebp + 8]
add esp, 0xc
push dword [ebp - 4]
mov dword [esi], eax
push ebx
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
push eax
call sub.MSVCRT.dll_strcat
push dword [ebp - 8]
call dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [esi]
add esp, 0xc
mov cl, byte [eax]
test cl, cl
je 0x402953
cmp cl, 0x2f
jne 0x402950
mov byte [eax], 0x5c
inc eax
jmp 0x402942
mov eax, dword [edi]
cmp eax, 3
jbe 0x40296c
mov ecx, dword [esi]
cmp byte [ecx + eax - 1], 0x5c
jne 0x40296c
dec eax
mov dword [edi], eax
mov ecx, dword [esi]
and byte [ecx + eax], 0
mov ebx, dword [ebp + 0x10]
push ebx
push dword [esi]
call fcn.00402c0e
pop ecx
test eax, eax
pop ecx
je 0x402a19
mov eax, dword [esi]
mov ecx, dword [edi]
add eax, ecx
cmp byte [eax - 1], 0x5c
je 0x40299a
mov byte [eax], 0x5c
inc dword [edi]
mov eax, dword [edi]
mov ecx, dword [esi]
and byte [ecx + eax], 0
push str.ActiveState
push dword [esi]
call sub.MSVCRT.dll_strcat
add dword [edi], 0xb
lea eax, [ebp - 0x2c]
push eax
push dword [esi]
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 0x10
test eax, eax
jne 0x4029c2
test byte [ebp - 0x25], 0x40
jne 0x402a0b
cmp dword [ebp + 0x14], 0
jne 0x4029e8
push 0x800
call dword [sym.imp.MSVCRT.dll_malloc]
mov dword [ebx], eax
push dword [esi]
push str.Directory__s_does_not_exist
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x10
jmp 0x402a19
push dword [esi]
call dword [sym.imp.MSVCRT.dll__mkdir]
test eax, eax
pop ecx
je 0x402a0b
push 0x800
call dword [sym.imp.MSVCRT.dll_malloc]
mov dword [ebx], eax
push dword [esi]
push str.Could_not_create_directory__s
jmp 0x4029dc
push ebx
push dword [esi]
call fcn.00402c0e
pop ecx
test eax, eax
pop ecx
jne 0x402a1d
xor eax, eax
jmp 0x402a32
mov eax, dword [esi]
mov ecx, dword [edi]
push 1
mov byte [eax + ecx], 0x5c
inc dword [edi]
mov edi, dword [edi]
mov eax, dword [esi]
and byte [eax + edi], 0
pop eax
pop edi
pop esi
pop ebx
leave
ret