2

I want to create Peach DataModel which would fuzzy XML (To be precise, the [Content_Types].xml from .docx). But when I create a XmlElement attribute xmlns, then peach crashes with Unhandled Exception: System.ArgumentException

It works:

<DataModel name="TestTemplate">
        <XmlElement elementName="Types">
                <XmlAttribute attributeName="xmlnsSOMELETTERS">
                        <String value="http://schemas.openxmlformats.org/package/2006/content-types">
                        <Analyzer class="StringToken"/>
                        </String>
                </XmlAttribute>
.......
</DataModel>

It not works:

<XmlElement elementName="Types">
                <XmlAttribute attributeName="xmlns">
                        <String value="http://schemas.openxmlformats.org/package/2006/content-types">
                        <Analyzer class="StringToken"/>
                        </String>
                </XmlAttribute>

Can you help me with this?

Full xml

Khurshid Ansari
  • 4,638
  • 2
  • 33
  • 52
  • `xmlns` are not attributes. The are namespace declarations. You can't create them with `XmlAttribute`. (BTW, read through the tag description of [fuzzing], I am pretty sure that's not what your meant.) – Tomalak Mar 20 '16 at 16:23
  • I have to think of something to fazzer "Peach" generated element that looks like ... Types> – Александр Mar 20 '16 at 16:43
  • @Tomalak: A tag for [Peach](http://community.peachfuzzer.com/WhatIsPeach.html) would probably be better, but 'fuzzing' isn't that far off. – kjhughes Mar 20 '16 at 17:30
  • @kjhughes Tag stub created. – Tomalak Mar 20 '16 at 17:43

1 Answers1

1

As @Tomalak mentioned in comments, xmlns isn't an attribute but a namespace declaration, so you have to handle it differently.

In Peach, there is a special attribute (ns) on XmlElement to use for namespace declarations.

kjhughes
  • 106,133
  • 27
  • 181
  • 240