peass-ng/PEASS-ng · error · ArgumentException

Key not exist.

Error message

Key not exist.

What it means

The getter of RehashableDictionary's indexer: TryGetValueCore returned false for the requested key, so no entry exists and the getter throws ArgumentException with the sentinel text 'Key not exist.' (a lookup-miss guard, despite the exception type). It fires on any read of this[key] for an absent key.

Source

Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs:543

            }

            public override IEnumerator<V> GetEnumerator()
            {
                foreach ( var item in Dictionary ) {
                    CheckValid();
                    yield return item.Value;
                }
            }
        }

        public V this[K key]
        {
            get
            {
                V value;
                if ( TryGetValueCore(key, out value) )
                    return value;
                throw new ArgumentException("Key not exist.");
            }
            set
            {
                AddCore(key, value, false);
            }
        }

        #endregion

        #region ICollection<KeyValuePair<K,V>> メンバ

        public void Add(KeyValuePair<K, V> item)
        {
            AddCore(item.Key, item.Value, true);
        }

        public void Clear()
        {

View on GitHub (pinned to 53fb989abc)

Solutions

  1. Use TryGetValue instead of the indexer when the key may be absent
  2. Verify key presence (ContainsKey) before indexing
  3. Normalize keys (case, whitespace, type equality) so lookups match stored keys
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs:543 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02). Data as JSON: /api/errors/8d63d5ee5504c81b. Report an issue: GitHub.