-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patterns: Adding IPS pattern and fixed PE magic file (#153)
* Update pe.hexpat New improvement * Add ips.hexpat via upload * Add ips.hexpat.ips via upload * Added IPS to README * Mentioned Windows in portable_executable_magic
- Loading branch information
1 parent
86f93df
commit ba14dd0
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <std/mem.pat> | ||
#include <std/string.pat> | ||
|
||
#pragma endian big | ||
|
||
u8 eofOffset = 3; | ||
|
||
struct Hunk { | ||
u24 offset; | ||
u16 length; | ||
if (length == 0) { | ||
u16 runCount; | ||
u8 payload; | ||
} | ||
else { | ||
u8 payload[length]; | ||
} | ||
}; | ||
|
||
struct IPS { | ||
char signature[5]; | ||
if (std::mem::read_string(std::mem::size()-3, 3) != "EOF") { | ||
eofOffset += 3; | ||
} | ||
Hunk hunks[while($ < std::mem::size()-eofOffset)]; | ||
char eof[3]; | ||
u24 truncatedSize[eofOffset>3]; | ||
}; | ||
|
||
IPS ips @ 0x00; |
Binary file not shown.