Skip to content

Commit

Permalink
Merge pull request #148 from vthib/update-yara-4.5.1
Browse files Browse the repository at this point in the history
Update yara to 4.5.1
  • Loading branch information
Hugal31 authored Jun 3, 2024
2 parents 839524e + 264ba85 commit 2888091
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
override: true
- uses: katyo/publish-crates@v1
with:
args: "--features bundled-4_5_0"
args: "--features bundled-4_5_1"
dry-run: ${{ github.event.inputs.dry_run }}
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --features bindgen,bundled-4_5_0,vendored -- -D warnings
run: cargo clippy --features bindgen,bundled-4_5_1,vendored -- -D warnings

test-posix:
strategy:
matrix:
os: [ ubuntu-latest ]
target: ["x86_64-unknown-linux-musl", "x86_64-unknown-linux-gnu"]
features: [ "vendored,bindgen", "vendored,bundled-4_5_0" ]
features: [ "vendored,bindgen", "vendored,bundled-4_5_1" ]
rust: [ stable, nightly ]

runs-on: ${{ matrix.os }}
Expand All @@ -54,7 +54,7 @@ jobs:
strategy:
matrix:
os: [ windows-2019 ]
features: [ "vendored,bundled-4_5_0" ]
features: [ "vendored,bundled-4_5_1" ]
rust: [ stable ]
cryptolib: [ "WinCrypt", "disabled" ]

Expand All @@ -81,7 +81,7 @@ jobs:
strategy:
matrix:
os: [ macos-13 ]
features: [ "vendored,bindgen", "vendored,bundled-4_5_0" ]
features: [ "vendored,bindgen", "vendored,bundled-4_5_1" ]
rust: [ stable, nightly ]
cryptolib: [ "OpenSSL", "CommonCrypto", "disabled" ]
openssl_dir: [ "/usr/local/opt/[email protected]" ]
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rust-version = "1.63"
[features]
default = ["bindgen", 'module-dotnet', 'module-dex', 'module-macho', 'module-hash', 'ndebug']
bindgen = ["yara-sys/bindgen"]
bundled-4_5_0 = ["yara-sys/bundled-4_5_0"]
bundled-4_5_1 = ["yara-sys/bundled-4_5_1"]
vendored = ["yara-sys/vendored"]
module-cuckoo = ["yara-sys/module-cuckoo"]
module-magic = ["yara-sys/module-magic"]
Expand Down Expand Up @@ -48,4 +48,4 @@ default-features = false

[package.metadata.docs.rs]
no-default-features = true
features = ["bundled-4_5_0"]
features = ["bundled-4_5_1"]
4 changes: 2 additions & 2 deletions yara-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2018"

[features]
default = ["bindgen", 'module-dotnet', 'module-dex', 'module-macho', 'module-hash', 'ndebug']
bundled-4_5_0 = []
bundled-4_5_1 = []
vendored = ["cc", "glob", "fs_extra"]
module-cuckoo = []
module-magic = []
Expand All @@ -35,4 +35,4 @@ fs_extra = { version = "1.2", optional = true }

[package.metadata.docs.rs]
no-default-features = true
features = ["bundled-4_5_0"]
features = ["bundled-4_5_1"]
6 changes: 3 additions & 3 deletions yara-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ version of Yara. Just make sure the version you specify is the same that the
version on your system!

- `bindgen`: **recommended**: this is the default feature, to use generated bindings.
- `vendored`: automatically compile and link libyara v4.5.0.
- `bundled-4_5_0`: use pre-generated bindings for Yara 4.5.0. Useful if you do not
- `vendored`: automatically compile and link libyara v4.5.1.
- `bundled-4_5_1`: use pre-generated bindings for Yara 4.5.1. Useful if you do not
want to install LLVM to run bindgen. However, you'll have to make sure you use
a version of Yara with the same major and minor version number. List of supported targets:
- x86_64-apple-darwin
Expand All @@ -38,7 +38,7 @@ You can specify the following environment variables:
You can also specify the `yara-static` feature to link Yara statically
rather than dynamically.

## Compile options for libyara v4.5.0
## Compile options for libyara v4.5.1

When using the `vendored` feature, Yara will be automatically built and linked
statically with yara-sys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub const OBJECT_TYPE_ARRAY: u32 = 4;
pub const OBJECT_TYPE_FUNCTION: u32 = 5;
pub const OBJECT_TYPE_DICTIONARY: u32 = 6;
pub const OBJECT_TYPE_FLOAT: u32 = 7;
pub type jmp_buf = [::std::os::raw::c_int; 37usize];
pub type jmp_buf = [::std::os::raw::c_int; 48usize];
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __darwin_size_t = ::std::os::raw::c_ulong;
pub type __darwin_off_t = __int64_t;
Expand Down Expand Up @@ -1443,6 +1443,7 @@ pub struct YR_RULE {
pub flags: i32,
pub num_atoms: i32,
pub required_strings: u32,
pub unused: u32,
pub __bindgen_anon_1: YR_RULE__bindgen_ty_1,
pub __bindgen_anon_2: YR_RULE__bindgen_ty_2,
pub __bindgen_anon_3: YR_RULE__bindgen_ty_3,
Expand Down Expand Up @@ -1703,6 +1704,16 @@ fn bindgen_test_layout_YR_RULE() {
stringify!(required_strings)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).unused) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(YR_RULE),
"::",
stringify!(unused)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
Expand Down Expand Up @@ -4755,7 +4766,7 @@ fn bindgen_test_layout__YR_COMPILER() {
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_YR_COMPILER>(),
10408usize,
10456usize,
concat!("Size of: ", stringify!(_YR_COMPILER))
);
assert_eq!(
Expand Down Expand Up @@ -4895,7 +4906,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).automaton) as usize - ptr as usize },
208usize,
256usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4905,7 +4916,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).rules_table) as usize - ptr as usize },
216usize,
264usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4915,7 +4926,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).objects_table) as usize - ptr as usize },
224usize,
272usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4925,7 +4936,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).strings_table) as usize - ptr as usize },
232usize,
280usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4935,7 +4946,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).wildcard_identifiers_table) as usize - ptr as usize },
240usize,
288usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4945,7 +4956,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sz_table) as usize - ptr as usize },
248usize,
296usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4955,7 +4966,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).fixup_stack_head) as usize - ptr as usize },
256usize,
304usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4965,7 +4976,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).num_namespaces) as usize - ptr as usize },
264usize,
312usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4975,7 +4986,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).loop_) as usize - ptr as usize },
272usize,
320usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4985,7 +4996,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).loop_index) as usize - ptr as usize },
688usize,
736usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -4995,7 +5006,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).loop_for_of_var_index) as usize - ptr as usize },
692usize,
740usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5005,7 +5016,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file_name_stack) as usize - ptr as usize },
696usize,
744usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5015,7 +5026,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).file_name_stack_ptr) as usize - ptr as usize },
824usize,
872usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5025,7 +5036,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).last_error_extra_info) as usize - ptr as usize },
828usize,
876usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5035,7 +5046,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lex_buf) as usize - ptr as usize },
1084usize,
1132usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5045,7 +5056,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lex_buf_ptr) as usize - ptr as usize },
9280usize,
9328usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5055,7 +5066,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lex_buf_len) as usize - ptr as usize },
9288usize,
9336usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5065,7 +5076,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).include_base_dir) as usize - ptr as usize },
9290usize,
9338usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5075,7 +5086,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
10320usize,
10368usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5085,7 +5096,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).incl_clbk_user_data) as usize - ptr as usize },
10328usize,
10376usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5095,7 +5106,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).re_ast_clbk_user_data) as usize - ptr as usize },
10336usize,
10384usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5105,7 +5116,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).callback) as usize - ptr as usize },
10344usize,
10392usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5115,7 +5126,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).include_callback) as usize - ptr as usize },
10352usize,
10400usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5125,7 +5136,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).include_free) as usize - ptr as usize },
10360usize,
10408usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5135,7 +5146,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).re_ast_callback) as usize - ptr as usize },
10368usize,
10416usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand All @@ -5145,7 +5156,7 @@ fn bindgen_test_layout__YR_COMPILER() {
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).atoms_config) as usize - ptr as usize },
10376usize,
10424usize,
concat!(
"Offset of field: ",
stringify!(_YR_COMPILER),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4052,6 +4052,7 @@ pub struct YR_RULE {
pub flags: i32,
pub num_atoms: i32,
pub required_strings: u32,
pub unused: u32,
pub __bindgen_anon_1: YR_RULE__bindgen_ty_1,
pub __bindgen_anon_2: YR_RULE__bindgen_ty_2,
pub __bindgen_anon_3: YR_RULE__bindgen_ty_3,
Expand Down Expand Up @@ -4312,6 +4313,16 @@ fn bindgen_test_layout_YR_RULE() {
stringify!(required_strings)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).unused) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(YR_RULE),
"::",
stringify!(unused)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
Expand Down
Loading

0 comments on commit 2888091

Please sign in to comment.