Skip to content

Commit

Permalink
improvement: added starting bytes for microsoft files
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarvinmueller committed Mar 15, 2024
1 parent d038031 commit 160bbe7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions MagicBytesValidator/Formats/Docx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ public Docx() : base(
["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
["docx"])
{
Anywhere([
0x77, 0x6F, 0x72, 0x64, 0x2F, 0x5F, 0x72, 0x65, 0x6C, 0x73, 0x2F, 0x64, 0x6F,
0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E, 0x78, 0x6D, 0x6C, 0x2E, 0x72, 0x65, 0x6C, 0x73
]);
StartsWith([0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00])
.Anywhere([
0x77, 0x6F, 0x72, 0x64, 0x2F, 0x5F, 0x72, 0x65, 0x6C, 0x73, 0x2F, 0x64, 0x6F,
0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E, 0x78, 0x6D, 0x6C, 0x2E, 0x72, 0x65, 0x6C, 0x73
]);
}
}
9 changes: 5 additions & 4 deletions MagicBytesValidator/Formats/Pptx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public Pptx() : base(
["pptx"]
)
{
Anywhere([
0x70, 0x70, 0x74, 0x2f, 0x5f, 0x72, 0x65, 0x6c, 0x73, 0x2f, 0x70, 0x72, 0x65,
0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x72, 0x65, 0x6c, 0x73
]);
StartsWith([0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00])
.Anywhere([
0x70, 0x70, 0x74, 0x2f, 0x5f, 0x72, 0x65, 0x6c, 0x73, 0x2f, 0x70, 0x72, 0x65,
0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x72, 0x65, 0x6c, 0x73
]);
}
}
9 changes: 5 additions & 4 deletions MagicBytesValidator/Formats/Xlsx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public Xlsx() : base(
["xlsx"]
)
{
Anywhere([
0x78, 0x6c, 0x2f, 0x5f, 0x72, 0x65, 0x6c, 0x73, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x62, 0x6f, 0x6f, 0x6b, 0x2e,
0x78, 0x6d, 0x6c, 0x2e, 0x72, 0x65, 0x6c, 0x73
]);
StartsWith([0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00])
.Anywhere([
0x78, 0x6c, 0x2f, 0x5f, 0x72, 0x65, 0x6c, 0x73, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x62, 0x6f, 0x6f, 0x6b, 0x2e,
0x78, 0x6d, 0x6c, 0x2e, 0x72, 0x65, 0x6c, 0x73
]);
}
}

0 comments on commit 160bbe7

Please sign in to comment.