{"record":{"id":"c36e4a8da5d5dcb9","repo":"peass-ng/PEASS-ng","slug":"0-is-not-a-pure-valuetype-1-2-of-3-can-no","errorCode":null,"errorMessage":"{0} is not a pure ValueType. {1} {2} of {3} can not serialize as binary.","messagePattern":"(.+?) is not a pure ValueType\\. (.+?) (.+?) of (.+?) can not serialize as binary\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectMemberAccessor.cs","lineNumber":150,"sourceCode":"            }\n            var attr1 = m.GetAttribute<YamlSerializeAttribute>();\n            if ( attr1 != null ) { // specified\n                if ( set == null ) { // read only member\n                    if ( attr1.SerializeMethod == YamlSerializeMethod.Assign ||\n                         ( mType.IsValueType && accessor.SerializeMethod == YamlSerializeMethod.Content ) )\n                        throw new ArgumentException(\"{0} {1} is not writeable by {2}.\"\n                            .DoFormat(mType.FullName, m.Name, attr1.SerializeMethod.ToString()));\n                }\n                accessor.SerializeMethod = attr1.SerializeMethod;\n            }\n            if ( accessor.SerializeMethod == YamlSerializeMethod.Never )\n                return; // no need to register\n            if ( accessor.SerializeMethod == YamlSerializeMethod.Binary ) {\n                if ( !mType.IsArray )\n                    throw new InvalidOperationException(\"{0} {1} of {2} is not an array. Can not be serialized as binary.\"\n                        .DoFormat(mType.FullName, m.Name, type.FullName));\n                if ( !TypeUtils.IsPureValueType(mType.GetElementType()) )\n                    throw new InvalidOperationException(\n                        \"{0} is not a pure ValueType. {1} {2} of {3} can not serialize as binary.\"\n                        .DoFormat(mType.GetElementType(), mType.FullName, m.Name, type.FullName));\n            }\n\n            // ShouldSerialize\n            //      YamlSerializeAttribute(Never) => false\n            //      ShouldSerializeSomeProperty => call it\n            //      DefaultValueAttribute(default) => compare to it\n            //      otherwise => true\n            var shouldSerialize = type.GetMethod(\"ShouldSerialize\" + m.Name,\n                System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic,\n                null, Type.EmptyTypes, new System.Reflection.ParameterModifier[0]);\n            if ( shouldSerialize != null && shouldSerialize.ReturnType == typeof(bool) && accessor.ShouldSeriealize == null )\n                accessor.ShouldSeriealize = obj => (bool)shouldSerialize.Invoke(obj, EmptyObjectArray);\n            var attr2 = m.GetAttribute<DefaultValueAttribute>();\n            if ( attr2 != null && accessor.ShouldSeriealize == null ) {\n                var defaultValue = attr2.Value;\n                if ( TypeUtils.IsNumeric(defaultValue) && defaultValue.GetType() != mType )","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectMemberAccessor.cs#L132-L168","documentation":"A YamlSerializer member-registration guard in ObjectMemberAccessor.RegisterMember: a member is marked for binary serialization, but binary (raw) serialization in this library is only supported for pure value types; the resolved member type contains reference components, so the {0}=type name, {1}/{2}=member kind and name, {3}=declaring type are rejected. It fires when a YamlSerializeAttribute with binary method is applied to a reference-typed member.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectMemberAccessor.cs:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the member's YamlSerializeAttribute to a non-binary method (Assign/Content)","Implement a type converter / serializer for the reference type instead of binary serialization","Apply binary serialization only to blittable/pure value-type members"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}