Function at 0x4ca590
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50c5e8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x220
push 0
lea ecx, [ebp - 0x24]
call fcn.004c5df0
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 4], 0
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4ca5c5
push ebx
sub ecx, edx
push esi
sar ecx, 1
push edi
push 2
lea edi, [ecx + 1]
push edi
call fcn.004d7d24
mov ebx, eax
add esp, 8
mov dword [ebp - 0x10], ebx
test ebx, ebx
jne 0x4ca5fd
mov eax, dword [ebp + 8]
xor ecx, ecx
xor esi, esi
mov word [eax], cx
jmp 0x4ca931
push dword [ebp + 0x10]
mov esi, 1
push edi
push ebx
call fcn.004d1327
push edi
push ebx
call fcn.004d162c
mov ebx, dword [ebp + 0x14]
add esp, 0x14
test ebx, ebx
je 0x4ca911
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4ca626
sub ecx, edx
sar ecx, 1
je 0x4ca911
push ebx
push dword [ebp + 0x10]
call fcn.004d299d
add esp, 8
test eax, eax
je 0x4ca911
push str.http:__
push dword [ebp - 0x10]
call fcn.004d299d
add esp, 8
test eax, eax
jne 0x4ca911
push str.https:__
push dword [ebp - 0x10]
call fcn.004d299d
add esp, 8
test eax, eax
jne 0x4ca911
push str.ftp:__
push dword [ebp - 0x10]
call fcn.004d299d
add esp, 8
test eax, eax
jne 0x4ca911
push dword [ebp + 0x10]
push edi
push dword [ebp - 0x10]
call fcn.004d1327
mov eax, dword [ebp - 0x10]
mov edi, eax
push ebx
push eax
call fcn.004d299d
mov ebx, dword [ebp + 8]
add esp, 0x14
mov ecx, eax
xor eax, eax
mov word [ebx], ax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x4ca8ec
push edi
push eax
xor edx, edx
push ebx
mov word [ecx], dx
call fcn.004d261a
add esp, 0xc
mov esi, eax
neg esi
sbb esi, esi
inc esi
je 0x4ca904
mov edx, dword [ebp + 0x14]
mov ecx, edx
lea edi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4ca6f0
mov eax, dword [ebp - 0x14]
sub ecx, edi
sar ecx, 1
push edx
lea edi, [eax + ecx*2]
push edi
mov dword [ebp - 0x14], edi
call fcn.004d299d
add esp, 8
mov dword [ebp - 0x18], eax
test eax, eax
je 0x4ca8aa
xor ecx, ecx
mov word [eax], cx
xor eax, eax
mov word [ebp - 0x22c], ax
lea eax, [ebp - 0x22c]
push 0x104
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea edi, [eax + 1]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp edi, 1
jne 0x4ca7cb
cmp eax, 0xcb
jne 0x4ca7cb
test byte [0x652fc0], 2
mov edi, dword [ebp - 0x14]
je 0x4ca777
push dword [ebp + 0x10]
push edi
push str.Cannot_find_environment_variable_name__s_in_string__s._n
push 2
push str.ReplaceEnvVariables
call fcn.004cb410
add esp, 0x14
push dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
push eax
push ebx
call fcn.004d261a
add esp, 0xc
mov esi, eax
neg esi
sbb esi, esi
inc esi
je 0x4ca904
push edi
mov edi, dword [ebp + 0xc]
push edi
push ebx
call fcn.004d261a
add esp, 0xc
mov esi, eax
neg esi
sbb esi, esi
inc esi
je 0x4ca904
push dword [ebp + 0x14]
push edi
push ebx
call fcn.004d261a
add esp, 0xc
mov esi, eax
neg esi
sbb esi, esi
inc esi
je 0x4ca904
jmp 0x4ca845
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4ca7d0
sub ecx, edx
sar ecx, 1
lea eax, [ecx + 1]
mov ecx, dword [ebp + 0xc]
add eax, edi
cmp eax, ecx
ja 0x4ca876
cmp edi, 1
jbe 0x4ca845
cmp edi, 0x104
ja 0x4ca80f
lea eax, [ebp - 0x22c]
push eax
push ecx
push ebx
call fcn.004d261a
add esp, 0xc
jmp 0x4ca845
push 2
push edi
call fcn.004d7d24
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x4ca898
push edi
mov edi, dword [ebp - 0x14]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov eax, dword [ebp + 0xc]
push ebx
push eax
push dword [ebp + 8]
call fcn.004d261a
push ebx
call fcn.004d17d8
mov ebx, dword [ebp + 8]
add esp, 0x10
mov edx, dword [ebp + 0x14]
mov ecx, edx
lea edi, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4ca850
mov eax, dword [ebp - 0x18]
sub ecx, edi
sar ecx, 1
push edx
lea edi, [eax + ecx*2]
push edi
call fcn.004d299d
add esp, 8
mov ecx, eax
jmp 0x4ca6bc
test byte [0x652fc0], 1
je 0x4ca898
push edi
mov edi, dword [ebp - 0x14]
push edi
push str.Lenght_of_environment_variable_string__s_is_too_big__d._n
push 1
push str.ReplaceEnvVariables
call fcn.004cb410
add esp, 0x14
push dword [ebp - 0x10]
xor esi, esi
call fcn.004d17d8
add esp, 4
jmp 0x4ca931
test byte [0x652fc0], 2
je 0x4ca8cd
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push str.String__s_mismatched_delimiter__s._n
push 2
push str.ReplaceEnvVariables
call fcn.004cb410
add esp, 0x14
push dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
push eax
push ebx
call fcn.004d261a
add esp, 0xc
mov esi, eax
neg esi
sbb esi, esi
inc esi
je 0x4ca904
push edi
push dword [ebp + 0xc]
jmp 0x4ca8f4
cmp word [edi], 0
je 0x4ca904
push edi
push eax
push ebx
call fcn.004d261a
add esp, 0xc
mov esi, eax
neg esi
sbb esi, esi
inc esi
push dword [ebp - 0x10]
call fcn.004d17d8
add esp, 4
jmp 0x4ca931
push dword [ebp - 0x10]
call fcn.004d17d8
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004d1327
add esp, 0x10
mov esi, eax
neg esi
sbb esi, esi
inc esi
lea ecx, [ebp - 0x24]
call fcn.004c5e20
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret