-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for obj, dll, and coff object file formats #36
Conversation
/// Returns whether a buffer is a Common Object File Format for i386 architecture. | ||
pub fn is_coff_i386(buf: &[u8]) -> bool { | ||
buf.len() > 2 && buf[0] == 0x4C && buf[1] == 0x01 | ||
} | ||
|
||
/// Returns whether a buffer is a Common Object File Format for x64 architecture. | ||
pub fn is_coff_x64(buf: &[u8]) -> bool { | ||
buf.len() > 2 && buf[0] == 0x64 && buf[1] == 0x86 | ||
} | ||
|
||
/// Returns whether a buffer is a Common Object File Format for Itanium architecture. | ||
pub fn is_coff_ia64(buf: &[u8]) -> bool { | ||
buf.len() > 2 && buf[0] == 0x00 && buf[1] == 0x02 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also have a generic is_coff
function, and register that as a matcher instead of all of the specific ones
src/matchers/app.rs
Outdated
/// Returns whether a buffer is a DLL. | ||
pub fn is_dll(buf: &[u8]) -> bool { | ||
is_exe(buf) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that we can't distinguish between dll
and exe
should also be documented here.
Fixes #33.
exe
anddll
have the same magic number