Function at 0x4d57df
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x606435
mov eax, dword fs:[0]
push eax
mov eax, 0x1c58
call fcn.004db570
mov eax, dword [0x667710]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp byte [ebp + 0x10], 0
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c3c], ecx
je 0x4d5837
push 1
lea ecx, [ebp - 0x410]
push ecx
push eax
call fcn.004c648a
add esp, 0xc
jmp 0x4d5846
push eax
lea eax, [ebp - 0x410]
push eax
call fcn.00516f80
pop ecx
pop ecx
lea ecx, [ebp - 0x1c30]
call fcn.004c79a8
xor ebx, ebx
lea ecx, [ebp - 0x1c30]
mov dword [ebp - 4], ebx
cmp byte [ebp - 0x410], bl
je 0x4d589e
lea eax, [ebp - 0x410]
push ebx
cmp byte [ebp + 0x14], bl
je 0x4d5878
push eax
call fcn.004c838f
jmp 0x4d5880
push ebx
push ebx
push eax
call fcn.004c7e24
test al, al
jne 0x4d58a5
cmp byte [ebp + 0x14], bl
je 0x4d5c6f
push 6
mov ecx, 0x66d780
call fcn.004cca62
jmp 0x4d5c6f
push 1
call fcn.004c81f0
push 0x405
lea ecx, [ebp - 0x1c58]
mov esi, ebx
call fcn.004c7975
mov edi, dword [ebp - 0x1c58]
push 0x400
mov byte [ebp - 4], 1
push edi
jmp 0x4d58e6
push eax
lea ecx, [ebp - 0x1c58]
add esi, eax
call fcn.004c752b
mov edi, dword [ebp - 0x1c58]
push 0x400
lea eax, [edi + esi]
push eax
lea ecx, [ebp - 0x1c30]
call fcn.004c7fe2
test eax, eax
jne 0x4d58c9
push 5
lea eax, [edi + esi]
push ebx
push eax
call fcn.004e0bc0
add esp, 0xc
cmp dword [ebp + 0x18], 3
je 0x4d5a05
cmp dword [ebp + 0x18], 0
jne 0x4d5925
push esi
push edi
call fcn.004d57a5
pop ecx
pop ecx
test al, al
jne 0x4d5a05
cmp byte [edi], 0
je 0x4d5c62
mov al, byte [edi]
mov esi, edi
mov ecx, ebx
cmp al, 0xd
je 0x4d595b
mov dl, byte [ebp + 0x20]
cmp al, 0xa
je 0x4d595b
test al, al
je 0x4d595b
test dl, dl
je 0x4d5954
cmp al, 0x2f
jne 0x4d5954
cmp byte [esi + 1], al
jne 0x4d5954
mov byte [esi], bl
mov ecx, esi
inc esi
mov al, byte [esi]
cmp al, 0xd
jne 0x4d593b
test ecx, ecx
mov byte [esi], bl
mov eax, esi
cmovne eax, ecx
jmp 0x4d5974
mov cl, byte [eax]
cmp cl, 0x20
je 0x4d5972
cmp cl, 9
jne 0x4d5979
mov byte [eax], bl
dec eax
cmp eax, edi
jae 0x4d5966
mov al, byte [edi]
test al, al
je 0x4d59e8
cmp byte [ebp + 0x1c], 0
je 0x4d599c
cmp al, 0x22
jne 0x4d599c
push edi
call fcn.00505070
pop ecx
cmp byte [eax + edi - 1], 0x22
jne 0x4d599c
mov byte [eax + edi - 1], bl
inc edi
cmp dword [ebp + 0x18], 2
jne 0x4d59aa
push edi
push edi
call dword [sym.imp.USER32.dll_OemToCharA]
cmp byte [ebp + 0x24], 0
je 0x4d59dc
cmp byte [edi], 0x25
jne 0x4d59dc
push 0x400
lea eax, [ebp - 0x810]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x4d59dc
cmp eax, 0x400
jae 0x4d59dc
lea eax, [ebp - 0x810]
push eax
jmp 0x4d59dd
push edi
mov ecx, dword [ebp - 0x1c3c]
call fcn.004c760e
lea edi, [esi + 1]
mov al, byte [edi]
cmp al, 0xd
je 0x4d59f5
cmp al, 0xa
jne 0x4d59f8
inc edi
jmp 0x4d59eb
test al, al
jne 0x4d5930
jmp 0x4d5c62
mov esi, dword [ebp - 0x1c54]
lea ecx, [ebp - 0x1c64]
mov eax, esi
shr eax, 1
inc eax
push eax
call fcn.004c850e
lea edx, [esi - 1]
mov esi, dword [ebp - 0x1c64]
mov dword [ebp - 0x1c38], esi
cmp edx, 2
jbe 0x4d5a77
lea eax, [edi + 2]
add edx, 0xfffffffd
mov dword [ebp - 0x1c34], eax
push 0xfffffffffffffffe
pop eax
sub eax, edi
shr edx, 1
mov edi, dword [ebp - 0x1c34]
inc edx
mov dword [ebp - 0x1c40], eax
mov ebx, eax
movzx ecx, byte [edi + 1]
mov eax, 0x100
imul ecx, eax
movzx eax, byte [edi]
add cx, ax
lea eax, [ebx + edi]
shr eax, 1
lea edi, [edi + 2]
mov word [esi + eax*2], cx
sub edx, 1
jne 0x4d5a52
xor ebx, ebx
lea ecx, [ebp - 0x1c4c]
call fcn.004c7494
mov byte [ebp - 4], 3
cmp word [esi], bx
je 0x4d5c4c
movzx ecx, word [esi]
mov dword [ebp - 0x1c40], 0xd
movzx eax, cx
mov edi, esi
push 0xd
pop ecx
mov dword [ebp - 0x1c34], edi
mov edx, ebx
cmp ax, cx
je 0x4d5afb
mov bl, byte [ebp + 0x20]
mov ecx, eax
push 0xa
pop esi
cmp cx, si
je 0x4d5aed
test cx, cx
je 0x4d5aed
test bl, bl
je 0x4d5adc
push 0x2f
pop eax
cmp cx, ax
jne 0x4d5adc
cmp word [edi + 2], ax
jne 0x4d5adc
xor eax, eax
mov edx, edi
mov word [edi], ax
add edi, 2
movzx eax, word [edi]
mov ecx, eax
cmp ax, word [ebp - 0x1c40]
jne 0x4d5ab9
mov esi, dword [ebp - 0x1c38]
xor ebx, ebx
mov dword [ebp - 0x1c34], edi
xor eax, eax
test edx, edx
mov word [edi], ax
mov eax, edi
cmovne eax, edx
jmp 0x4d5b1b
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x4d5b16
cmp ecx, 9
jne 0x4d5b22
xor ecx, ecx
mov word [eax], cx
sub eax, 2
cmp eax, esi
jae 0x4d5b09
cmp word [esi], bx
je 0x4d5c1d
push esi
call fcn.004c5c65
pop ecx
mov ecx, dword [ebp - 0x1c48]
mov edi, eax
sub eax, ecx
lea eax, [eax*4 + 4]
test eax, eax
jle 0x4d5b59
push eax
lea ecx, [ebp - 0x1c4c]
call fcn.004c752b
mov ecx, dword [ebp - 0x1c48]
cmp byte [ebp + 0x1c], 0
je 0x4d5b78
push 0x22
pop eax
cmp word [esi], ax
jne 0x4d5b78
cmp word [esi + edi*2 - 2], ax
jne 0x4d5b78
xor eax, eax
mov word [esi + edi*2 - 2], ax
add esi, 2
push ecx
push dword [ebp - 0x1c4c]
push esi
call fcn.004c5931
add esp, 0xc
cmp byte [ebp + 0x24], 0
je 0x4d5c05
cmp word [esi], 0x25
jne 0x4d5c05
xor eax, eax
xor edi, edi
mov word [ebp - 0x1010], ax
inc edi
push 0x400
lea eax, [ebp - 0x810]
push eax
push dword [ebp - 0x1c4c]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
mov dword [ebp - 0x1c38], eax
test eax, eax
je 0x4d5c05
call fcn.004ce8e6
test eax, eax
je 0x4d5be0
push 0x400
lea eax, [ebp - 0x1010]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov edi, eax
mov eax, 0x400
cmp dword [ebp - 0x1c38], eax
jae 0x4d5c05
test edi, edi
je 0x4d5c05
cmp edi, eax
jae 0x4d5c05
lea eax, [ebp - 0x1010]
push eax
lea eax, [ebp - 0x810]
push eax
jmp 0x4d5c0c
push esi
push dword [ebp - 0x1c4c]
mov ecx, dword [ebp - 0x1c3c]
call fcn.004c761f
mov edi, dword [ebp - 0x1c34]
push 0xd
pop edx
push 0xa
lea esi, [edi + 2]
pop ebx
movzx eax, word [esi]
mov ecx, eax
cmp ax, dx
je 0x4d5c35
cmp ax, bx
jne 0x4d5c3a
add esi, 2
jmp 0x4d5c26
mov dword [ebp - 0x1c38], esi
push 0
pop ebx
test ax, ax
jne 0x4d5a9c
lea ecx, [ebp - 0x1c4c]
call fcn.004c74e6
lea ecx, [ebp - 0x1c64]
call fcn.004c7502
lea ecx, [ebp - 0x1c58]
call fcn.004c74e6
mov bl, 1
lea ecx, [ebp - 0x1c30]
call fcn.004c79e3
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004da623
leave
ret