Class OlePayload
Reads the native content out of an embedded OLE object's payload part.
public sealed class OlePayload : IDisposable
- Inheritance
-
OlePayload
- Implements
- Inherited Members
Remarks
A .docx keeps an embedded object's payload as an opaque package part, which
DocWright preserves and re-emits verbatim (see DocWright.Dom.OleObject). That part
is itself a compound file, so getting at the embedded spreadsheet or PDF means opening a
second container inside the first. This type does that and nothing more.
It does not interpret or execute a payload, and it never will — extraction hands back bytes, and what those bytes mean is the caller's business. Extraction is bounded by ResourceLimits and inherits the container reader's cycle detection, because an embedded object is attacker-controlled content arriving inside another file.
Properties
- EmbeddedFileName
Gets the file name the payload had when it was embedded, or null. Only a PackagedFile records one.
- EmbeddedLabel
Gets the display label recorded beside EmbeddedFileName, or null. The same untrusted-text caveat applies.
- Kind
Gets how the payload stores its native content.
- StreamNames
Gets the payload's stream names, in the container's directory order.
Methods
- LooksLikeCompoundFile(Stream)
Determines whether a stream begins with the compound-file signature, which is what an OLE payload part normally is.
- Open(Stream, ResourceLimits?)
Opens an embedded object's payload part.
- OpenStream(string)
Opens one of the payload's streams by name.
- TryOpenNativeContent(out Stream?)
Opens the payload's native content when it has a single identifiable one.