Function at 0x501b60
Capabilities:
Query environment variable

Disassembly:
sub esp, 0x21c
mov eax, dword [0x6aae14]
xor eax, esp
mov dword [esp + 0x218], eax
mov eax, dword [esp + 0x220]
push ebx
push ebp
push esi
xor ebx, ebx
push 0x207
lea ecx, [esp + 0x21]
push ebx
push ecx
mov dword [esp + 0x18], eax
mov byte [esp + 0x28], bl
call fcn.005dfd60
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
add esp, 0xc
push ebx
push ebx
push 0x6486bc
call esi
mov ebp, eax
cmp ebp, ebx
je 0x501ddf
push edi
add ebp, 0xa
lea edx, [ebp + 0x10]
push 1
push edx
mov dword [esp + 0x24], ebp
call fcn.005e34ab
mov edi, eax
add esp, 8
mov dword [esp + 0x18], edi
cmp edi, ebx
je 0x501dde
push ebp
push edi
push 0x6486bc
call esi
test eax, eax
je 0x501dd5
cmp byte [edi], bl
je 0x501dd5
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x501bf6
sub eax, edx
cmp eax, ebp
jae 0x501c14
push ebp
push 0x648884
push edi
call fcn.004d9130
add esp, 0xc
jmp 0x501c19
mov byte [edi + ebp - 1], 0x3b
push 0x3b
push edi
call fcn.005e2e42
add esp, 8
mov dword [esp + 0x14], eax
cmp eax, ebx
je 0x501dd5
mov eax, dword [esp + 0x14]
push 0x208
lea ecx, [esp + 0x24]
push edi
push ecx
mov byte [eax], bl
call fcn.005e2f3c
mov eax, edi
add esp, 0xc
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x501c50
sub eax, edx
cmp eax, 0x208
jb 0x501c67
mov byte [esp + 0x227], bl
cmp byte [esp + 0x20], bl
je 0x501da2
lea edx, [esp + 0x20]
push ebx
push edx
call fcn.004e8c10
add esp, 8
test eax, eax
je 0x501da2
xor ebp, ebp
cmp byte [esp + 0x20], bl
je 0x501da2
push 1
push 0x44
call fcn.005e34ab
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x501da2
lea eax, [esp + 0x20]
push eax
mov dword [esi + 8], ebx
mov dword [esi + 4], ebx
mov dword [esi], ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 0x115
push 1
push eax
call fcn.005e34ab
add esp, 8
mov dword [esi], eax
cmp eax, ebx
jne 0x501ce0
push esi
call fcn.005e0865
add esp, 4
jmp 0x501da2
lea ecx, [esp + 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [esp + 0x10]
mov dword [esi + 0x10], ebx
mov dword [esi + 0x20], ebx
mov dword [esi + 0x18], ebx
mov dword [esi + 0x2c], ebx
mov eax, dword [ecx]
cmp eax, ebx
jne 0x501d15
mov dword [ecx], esi
mov dword [esi + 0x20], esi
mov edx, dword [ecx]
mov dword [edx + 0x30], 1
jmp 0x501da2
mov edi, dword [eax + 0x20]
cmp edi, ebx
je 0x501d41
mov eax, dword [edi]
mov ecx, dword [esi]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
cmp eax, ebx
jne 0x501d34
mov eax, edi
mov edi, dword [esp + 0x10]
jmp 0x501d79
cmp eax, 1
jl 0x501d41
mov eax, edi
mov edi, dword [esp + 0x10]
jmp 0x501d79
mov edi, dword [esp + 0x10]
mov ebp, dword [edi]
cmp ebp, ebx
je 0x501d7d
jmp 0x501d50
mov ecx, dword [esi]
cmp ecx, ebx
je 0x501d70
mov eax, dword [ebp]
cmp eax, ebx
je 0x501d70
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
cmp eax, ebx
jne 0x501d70
mov dword [esi + 0x2c], 1
mov eax, ebp
mov ebp, dword [ebp + 0x18]
cmp ebp, ebx
jne 0x501d50
cmp eax, ebx
jne 0x501df7
mov eax, dword [edi]
mov dword [eax + 0x1c], esi
mov dword [eax + 0x24], esi
mov dword [edi], esi
mov edx, dword [eax + 0x30]
inc edx
mov dword [esi + 0x30], edx
mov dword [esi + 0x18], eax
cmp ebp, ebx
jne 0x501d9e
mov edi, dword [esp + 0x10]
mov eax, dword [edi]
mov dword [eax + 0x20], esi
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
add eax, 1
je 0x501dbe
cmp byte [eax], bl
je 0x501dbe
mov ecx, dword [esp + 0x1c]
push ecx
push eax
push edi
call fcn.004d90f0
add esp, 0xc
push 0x3b
push edi
call fcn.005e2e42
add esp, 8
mov dword [esp + 0x14], eax
cmp eax, ebx
jne 0x501c30
push edi
call fcn.005e0865
add esp, 4
pop edi
mov ecx, dword [esp + 0x224]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005dfbbe
add esp, 0x21c
ret
mov dword [esi + 0x1c], eax
mov dword [esi + 0x24], eax
mov ecx, dword [eax + 0x18]
mov dword [eax + 0x18], esi
mov dword [esi + 0x18], ecx
cmp ecx, ebx
je 0x501e10
mov dword [ecx + 0x1c], esi
mov dword [ecx + 0x24], esi
mov eax, dword [edi]
inc dword [eax + 0x30]
jmp 0x501d99