Skip to content
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

refactor: multiple changes in macho module #76

Merged
merged 13 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- build: no-default-features
os: ubuntu-latest
rust: stable
args: "--package yara-x --no-default-features --features=test_proto2-module,test_proto3-module,time-module,hash-module,macho-module,math-module,lnk-module,elf-module,pe-module,dotnet-module,console-module"
args: "--package yara-x --no-default-features --features=test_proto2-module,test_proto3-module,string-module,time-module,hash-module,macho-module,math-module,lnk-module,elf-module,pe-module,dotnet-module,console-module"

steps:
- name: Checkout sources
Expand Down
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ aho-corasick = "1.1.2"
anyhow = "1.0.75"
ariadne = "0.3.0"
array-bytes = "6.2.0"
arrayref = "0.3.7"
ascii_tree = "0.1.1"
authenticode-parser = "0.3.2"
base64 = "0.21.0"
Expand Down
4 changes: 3 additions & 1 deletion yara-x-cli/src/commands/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ pub fn exec_dump(args: &ArgMatches) -> anyhow::Result<()> {
if !module_output.lnk.is_lnk() {
module_output.lnk = MessageField::none()
}
if !module_output.macho.has_magic() {
if !module_output.macho.has_magic()
&& !module_output.macho.has_fat_magic()
{
module_output.macho = MessageField::none()
}
if !module_output.pe.is_pe() {
Expand Down
11 changes: 7 additions & 4 deletions yara-x/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ console-module = []

# The `dotnet` module parsers .NET files.
dotnet-module = [
"pe-module"
"pe-module",
"dep:nom",
]

# The `elf` module parses ELF files.
elf-module = [
"dep:tlsh-fixed"
"dep:tlsh-fixed",
"dep:nom",
]

# The `hash` module provides functions for computing md5, sha1, sha-256,
Expand All @@ -70,13 +72,13 @@ hash-module = [
# The `lnk` module parses LNK files.
lnk-module = [
"dep:uuid",
"dep:nom",
]

# The `macho` module parses Mach-O files.
macho-module = [
"dep:byteorder",
"dep:nom",
"dep:arrayref",
]

# The `math` module.
Expand All @@ -85,6 +87,7 @@ math-module = []
# The `pe` module parses PE files.
pe-module = [
"dep:authenticode-parser",
"dep:nom",
]

# The `string` modules offer some functions for parsing strings as integers,
Expand Down Expand Up @@ -118,6 +121,7 @@ default = [
"math-module",
"hash-module",
"pe-module",
"string-module",
"time-module",
"lnk-module",
"test_proto2-module",
Expand All @@ -129,7 +133,6 @@ aho-corasick = { workspace = true, features=["logging"] }
anyhow = { workspace = true }
ariadne = { workspace = true }
array-bytes = { workspace = true }
arrayref = { workspace = true, optional = true }
ascii_tree = { workspace = true}
authenticode-parser = { workspace = true, optional = true }
base64 = { workspace = true }
Expand Down
Loading
Loading