2 Commits
Author SHA1 Message Date
Mr.XandVictor M. Alvarez 5e8a8ea41f Add yr_get_version to report the version of the library loaded at runtime (#2247)
YR_MAJOR_VERSION, YR_MINOR_VERSION and YR_MICRO_VERSION are fixed when the
caller is compiled, so a program linked against a shared libyara has no way
to tell which version it actually loaded. Distros ship libyara.so in its own
package precisely so it can be updated independently of its consumers, which
is exactly the case the macros cannot describe.

Add yr_get_version(), which reports the version of the library that is
actually loaded. Any argument may be NULL if the caller does not need that
component, and since the function touches no global state it can be called
before yr_initialize.

Closes #2136

---------

Co-authored-by: Victor M. Alvarez <[email protected]>
2026-09-23 11:48:49 +02:00
Mr.X 25a50bd63c elf: expose nine more e_machine values (#2248)
elf.machine can hold any value from the ELF header, but the module only
named 14 of them, so a rule targeting anything else had to hardcode the
number or drop the module and match the header bytes by hand.

Add the architectures from the issue: PARISC, SPARC32PLUS, S390, MCORE,
SH, SPARCV9, ARC_COMPACT, BPF and LOONGARCH.

0x27 is exposed under both EM_MCORE and EM_RCE. EM_RCE is the name it was
originally registered under and still what some toolchains emit, so a rule
written against either name works.

Closes #2149
2026-09-23 10:04:28 +02:00