Skip to content

Commit 2888091

Browse files
authored
Merge pull request #148 from vthib/update-yara-4.5.1
Update yara to 4.5.1
2 parents 839524e + 264ba85 commit 2888091

12 files changed

+99
-44
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
override: true
3434
- uses: katyo/publish-crates@v1
3535
with:
36-
args: "--features bundled-4_5_0"
36+
args: "--features bundled-4_5_1"
3737
dry-run: ${{ github.event.inputs.dry_run }}
3838
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3939

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
- name: Cargo fmt
2727
run: cargo fmt --all -- --check
2828
- name: Cargo clippy
29-
run: cargo clippy --features bindgen,bundled-4_5_0,vendored -- -D warnings
29+
run: cargo clippy --features bindgen,bundled-4_5_1,vendored -- -D warnings
3030

3131
test-posix:
3232
strategy:
3333
matrix:
3434
os: [ ubuntu-latest ]
3535
target: ["x86_64-unknown-linux-musl", "x86_64-unknown-linux-gnu"]
36-
features: [ "vendored,bindgen", "vendored,bundled-4_5_0" ]
36+
features: [ "vendored,bindgen", "vendored,bundled-4_5_1" ]
3737
rust: [ stable, nightly ]
3838

3939
runs-on: ${{ matrix.os }}
@@ -54,7 +54,7 @@ jobs:
5454
strategy:
5555
matrix:
5656
os: [ windows-2019 ]
57-
features: [ "vendored,bundled-4_5_0" ]
57+
features: [ "vendored,bundled-4_5_1" ]
5858
rust: [ stable ]
5959
cryptolib: [ "WinCrypt", "disabled" ]
6060

@@ -81,7 +81,7 @@ jobs:
8181
strategy:
8282
matrix:
8383
os: [ macos-13 ]
84-
features: [ "vendored,bindgen", "vendored,bundled-4_5_0" ]
84+
features: [ "vendored,bindgen", "vendored,bundled-4_5_1" ]
8585
rust: [ stable, nightly ]
8686
cryptolib: [ "OpenSSL", "CommonCrypto", "disabled" ]
8787
openssl_dir: [ "/usr/local/opt/[email protected]" ]

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rust-version = "1.63"
1717
[features]
1818
default = ["bindgen", 'module-dotnet', 'module-dex', 'module-macho', 'module-hash', 'ndebug']
1919
bindgen = ["yara-sys/bindgen"]
20-
bundled-4_5_0 = ["yara-sys/bundled-4_5_0"]
20+
bundled-4_5_1 = ["yara-sys/bundled-4_5_1"]
2121
vendored = ["yara-sys/vendored"]
2222
module-cuckoo = ["yara-sys/module-cuckoo"]
2323
module-magic = ["yara-sys/module-magic"]
@@ -48,4 +48,4 @@ default-features = false
4848

4949
[package.metadata.docs.rs]
5050
no-default-features = true
51-
features = ["bundled-4_5_0"]
51+
features = ["bundled-4_5_1"]

yara-sys/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ edition = "2018"
1313

1414
[features]
1515
default = ["bindgen", 'module-dotnet', 'module-dex', 'module-macho', 'module-hash', 'ndebug']
16-
bundled-4_5_0 = []
16+
bundled-4_5_1 = []
1717
vendored = ["cc", "glob", "fs_extra"]
1818
module-cuckoo = []
1919
module-magic = []
@@ -35,4 +35,4 @@ fs_extra = { version = "1.2", optional = true }
3535

3636
[package.metadata.docs.rs]
3737
no-default-features = true
38-
features = ["bundled-4_5_0"]
38+
features = ["bundled-4_5_1"]

yara-sys/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ version of Yara. Just make sure the version you specify is the same that the
1616
version on your system!
1717

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

41-
## Compile options for libyara v4.5.0
41+
## Compile options for libyara v4.5.1
4242

4343
When using the `vendored` feature, Yara will be automatically built and linked
4444
statically with yara-sys.

yara-sys/bindings/yara-4.5.0-x86_64-apple-darwin.rs renamed to yara-sys/bindings/yara-4.5.1-x86_64-apple-darwin.rs

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub const OBJECT_TYPE_ARRAY: u32 = 4;
129129
pub const OBJECT_TYPE_FUNCTION: u32 = 5;
130130
pub const OBJECT_TYPE_DICTIONARY: u32 = 6;
131131
pub const OBJECT_TYPE_FLOAT: u32 = 7;
132-
pub type jmp_buf = [::std::os::raw::c_int; 37usize];
132+
pub type jmp_buf = [::std::os::raw::c_int; 48usize];
133133
pub type __int64_t = ::std::os::raw::c_longlong;
134134
pub type __darwin_size_t = ::std::os::raw::c_ulong;
135135
pub type __darwin_off_t = __int64_t;
@@ -1443,6 +1443,7 @@ pub struct YR_RULE {
14431443
pub flags: i32,
14441444
pub num_atoms: i32,
14451445
pub required_strings: u32,
1446+
pub unused: u32,
14461447
pub __bindgen_anon_1: YR_RULE__bindgen_ty_1,
14471448
pub __bindgen_anon_2: YR_RULE__bindgen_ty_2,
14481449
pub __bindgen_anon_3: YR_RULE__bindgen_ty_3,
@@ -1703,6 +1704,16 @@ fn bindgen_test_layout_YR_RULE() {
17031704
stringify!(required_strings)
17041705
)
17051706
);
1707+
assert_eq!(
1708+
unsafe { ::std::ptr::addr_of!((*ptr).unused) as usize - ptr as usize },
1709+
12usize,
1710+
concat!(
1711+
"Offset of field: ",
1712+
stringify!(YR_RULE),
1713+
"::",
1714+
stringify!(unused)
1715+
)
1716+
);
17061717
}
17071718
#[repr(C)]
17081719
#[derive(Copy, Clone)]
@@ -4755,7 +4766,7 @@ fn bindgen_test_layout__YR_COMPILER() {
47554766
let ptr = UNINIT.as_ptr();
47564767
assert_eq!(
47574768
::std::mem::size_of::<_YR_COMPILER>(),
4758-
10408usize,
4769+
10456usize,
47594770
concat!("Size of: ", stringify!(_YR_COMPILER))
47604771
);
47614772
assert_eq!(
@@ -4895,7 +4906,7 @@ fn bindgen_test_layout__YR_COMPILER() {
48954906
);
48964907
assert_eq!(
48974908
unsafe { ::std::ptr::addr_of!((*ptr).automaton) as usize - ptr as usize },
4898-
208usize,
4909+
256usize,
48994910
concat!(
49004911
"Offset of field: ",
49014912
stringify!(_YR_COMPILER),
@@ -4905,7 +4916,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49054916
);
49064917
assert_eq!(
49074918
unsafe { ::std::ptr::addr_of!((*ptr).rules_table) as usize - ptr as usize },
4908-
216usize,
4919+
264usize,
49094920
concat!(
49104921
"Offset of field: ",
49114922
stringify!(_YR_COMPILER),
@@ -4915,7 +4926,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49154926
);
49164927
assert_eq!(
49174928
unsafe { ::std::ptr::addr_of!((*ptr).objects_table) as usize - ptr as usize },
4918-
224usize,
4929+
272usize,
49194930
concat!(
49204931
"Offset of field: ",
49214932
stringify!(_YR_COMPILER),
@@ -4925,7 +4936,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49254936
);
49264937
assert_eq!(
49274938
unsafe { ::std::ptr::addr_of!((*ptr).strings_table) as usize - ptr as usize },
4928-
232usize,
4939+
280usize,
49294940
concat!(
49304941
"Offset of field: ",
49314942
stringify!(_YR_COMPILER),
@@ -4935,7 +4946,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49354946
);
49364947
assert_eq!(
49374948
unsafe { ::std::ptr::addr_of!((*ptr).wildcard_identifiers_table) as usize - ptr as usize },
4938-
240usize,
4949+
288usize,
49394950
concat!(
49404951
"Offset of field: ",
49414952
stringify!(_YR_COMPILER),
@@ -4945,7 +4956,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49454956
);
49464957
assert_eq!(
49474958
unsafe { ::std::ptr::addr_of!((*ptr).sz_table) as usize - ptr as usize },
4948-
248usize,
4959+
296usize,
49494960
concat!(
49504961
"Offset of field: ",
49514962
stringify!(_YR_COMPILER),
@@ -4955,7 +4966,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49554966
);
49564967
assert_eq!(
49574968
unsafe { ::std::ptr::addr_of!((*ptr).fixup_stack_head) as usize - ptr as usize },
4958-
256usize,
4969+
304usize,
49594970
concat!(
49604971
"Offset of field: ",
49614972
stringify!(_YR_COMPILER),
@@ -4965,7 +4976,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49654976
);
49664977
assert_eq!(
49674978
unsafe { ::std::ptr::addr_of!((*ptr).num_namespaces) as usize - ptr as usize },
4968-
264usize,
4979+
312usize,
49694980
concat!(
49704981
"Offset of field: ",
49714982
stringify!(_YR_COMPILER),
@@ -4975,7 +4986,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49754986
);
49764987
assert_eq!(
49774988
unsafe { ::std::ptr::addr_of!((*ptr).loop_) as usize - ptr as usize },
4978-
272usize,
4989+
320usize,
49794990
concat!(
49804991
"Offset of field: ",
49814992
stringify!(_YR_COMPILER),
@@ -4985,7 +4996,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49854996
);
49864997
assert_eq!(
49874998
unsafe { ::std::ptr::addr_of!((*ptr).loop_index) as usize - ptr as usize },
4988-
688usize,
4999+
736usize,
49895000
concat!(
49905001
"Offset of field: ",
49915002
stringify!(_YR_COMPILER),
@@ -4995,7 +5006,7 @@ fn bindgen_test_layout__YR_COMPILER() {
49955006
);
49965007
assert_eq!(
49975008
unsafe { ::std::ptr::addr_of!((*ptr).loop_for_of_var_index) as usize - ptr as usize },
4998-
692usize,
5009+
740usize,
49995010
concat!(
50005011
"Offset of field: ",
50015012
stringify!(_YR_COMPILER),
@@ -5005,7 +5016,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50055016
);
50065017
assert_eq!(
50075018
unsafe { ::std::ptr::addr_of!((*ptr).file_name_stack) as usize - ptr as usize },
5008-
696usize,
5019+
744usize,
50095020
concat!(
50105021
"Offset of field: ",
50115022
stringify!(_YR_COMPILER),
@@ -5015,7 +5026,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50155026
);
50165027
assert_eq!(
50175028
unsafe { ::std::ptr::addr_of!((*ptr).file_name_stack_ptr) as usize - ptr as usize },
5018-
824usize,
5029+
872usize,
50195030
concat!(
50205031
"Offset of field: ",
50215032
stringify!(_YR_COMPILER),
@@ -5025,7 +5036,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50255036
);
50265037
assert_eq!(
50275038
unsafe { ::std::ptr::addr_of!((*ptr).last_error_extra_info) as usize - ptr as usize },
5028-
828usize,
5039+
876usize,
50295040
concat!(
50305041
"Offset of field: ",
50315042
stringify!(_YR_COMPILER),
@@ -5035,7 +5046,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50355046
);
50365047
assert_eq!(
50375048
unsafe { ::std::ptr::addr_of!((*ptr).lex_buf) as usize - ptr as usize },
5038-
1084usize,
5049+
1132usize,
50395050
concat!(
50405051
"Offset of field: ",
50415052
stringify!(_YR_COMPILER),
@@ -5045,7 +5056,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50455056
);
50465057
assert_eq!(
50475058
unsafe { ::std::ptr::addr_of!((*ptr).lex_buf_ptr) as usize - ptr as usize },
5048-
9280usize,
5059+
9328usize,
50495060
concat!(
50505061
"Offset of field: ",
50515062
stringify!(_YR_COMPILER),
@@ -5055,7 +5066,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50555066
);
50565067
assert_eq!(
50575068
unsafe { ::std::ptr::addr_of!((*ptr).lex_buf_len) as usize - ptr as usize },
5058-
9288usize,
5069+
9336usize,
50595070
concat!(
50605071
"Offset of field: ",
50615072
stringify!(_YR_COMPILER),
@@ -5065,7 +5076,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50655076
);
50665077
assert_eq!(
50675078
unsafe { ::std::ptr::addr_of!((*ptr).include_base_dir) as usize - ptr as usize },
5068-
9290usize,
5079+
9338usize,
50695080
concat!(
50705081
"Offset of field: ",
50715082
stringify!(_YR_COMPILER),
@@ -5075,7 +5086,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50755086
);
50765087
assert_eq!(
50775088
unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
5078-
10320usize,
5089+
10368usize,
50795090
concat!(
50805091
"Offset of field: ",
50815092
stringify!(_YR_COMPILER),
@@ -5085,7 +5096,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50855096
);
50865097
assert_eq!(
50875098
unsafe { ::std::ptr::addr_of!((*ptr).incl_clbk_user_data) as usize - ptr as usize },
5088-
10328usize,
5099+
10376usize,
50895100
concat!(
50905101
"Offset of field: ",
50915102
stringify!(_YR_COMPILER),
@@ -5095,7 +5106,7 @@ fn bindgen_test_layout__YR_COMPILER() {
50955106
);
50965107
assert_eq!(
50975108
unsafe { ::std::ptr::addr_of!((*ptr).re_ast_clbk_user_data) as usize - ptr as usize },
5098-
10336usize,
5109+
10384usize,
50995110
concat!(
51005111
"Offset of field: ",
51015112
stringify!(_YR_COMPILER),
@@ -5105,7 +5116,7 @@ fn bindgen_test_layout__YR_COMPILER() {
51055116
);
51065117
assert_eq!(
51075118
unsafe { ::std::ptr::addr_of!((*ptr).callback) as usize - ptr as usize },
5108-
10344usize,
5119+
10392usize,
51095120
concat!(
51105121
"Offset of field: ",
51115122
stringify!(_YR_COMPILER),
@@ -5115,7 +5126,7 @@ fn bindgen_test_layout__YR_COMPILER() {
51155126
);
51165127
assert_eq!(
51175128
unsafe { ::std::ptr::addr_of!((*ptr).include_callback) as usize - ptr as usize },
5118-
10352usize,
5129+
10400usize,
51195130
concat!(
51205131
"Offset of field: ",
51215132
stringify!(_YR_COMPILER),
@@ -5125,7 +5136,7 @@ fn bindgen_test_layout__YR_COMPILER() {
51255136
);
51265137
assert_eq!(
51275138
unsafe { ::std::ptr::addr_of!((*ptr).include_free) as usize - ptr as usize },
5128-
10360usize,
5139+
10408usize,
51295140
concat!(
51305141
"Offset of field: ",
51315142
stringify!(_YR_COMPILER),
@@ -5135,7 +5146,7 @@ fn bindgen_test_layout__YR_COMPILER() {
51355146
);
51365147
assert_eq!(
51375148
unsafe { ::std::ptr::addr_of!((*ptr).re_ast_callback) as usize - ptr as usize },
5138-
10368usize,
5149+
10416usize,
51395150
concat!(
51405151
"Offset of field: ",
51415152
stringify!(_YR_COMPILER),
@@ -5145,7 +5156,7 @@ fn bindgen_test_layout__YR_COMPILER() {
51455156
);
51465157
assert_eq!(
51475158
unsafe { ::std::ptr::addr_of!((*ptr).atoms_config) as usize - ptr as usize },
5148-
10376usize,
5159+
10424usize,
51495160
concat!(
51505161
"Offset of field: ",
51515162
stringify!(_YR_COMPILER),

yara-sys/bindings/yara-4.5.0-x86_64-pc-windows-gnu.rs renamed to yara-sys/bindings/yara-4.5.1-x86_64-pc-windows-gnu.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4052,6 +4052,7 @@ pub struct YR_RULE {
40524052
pub flags: i32,
40534053
pub num_atoms: i32,
40544054
pub required_strings: u32,
4055+
pub unused: u32,
40554056
pub __bindgen_anon_1: YR_RULE__bindgen_ty_1,
40564057
pub __bindgen_anon_2: YR_RULE__bindgen_ty_2,
40574058
pub __bindgen_anon_3: YR_RULE__bindgen_ty_3,
@@ -4312,6 +4313,16 @@ fn bindgen_test_layout_YR_RULE() {
43124313
stringify!(required_strings)
43134314
)
43144315
);
4316+
assert_eq!(
4317+
unsafe { ::std::ptr::addr_of!((*ptr).unused) as usize - ptr as usize },
4318+
12usize,
4319+
concat!(
4320+
"Offset of field: ",
4321+
stringify!(YR_RULE),
4322+
"::",
4323+
stringify!(unused)
4324+
)
4325+
);
43154326
}
43164327
#[repr(C)]
43174328
#[derive(Copy, Clone)]

0 commit comments

Comments
 (0)