Skip to content

Commit

Permalink
Require yara 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian Eikenberg committed Feb 28, 2024
1 parent 529f9d3 commit b70ab31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions plugins/inmemoryscanner/src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ target_include_directories(inmemoryscanner-obj INTERFACE $<BUILD_INTERFACE:${CMA

include(FindPkgConfig)

pkg_check_modules(YARA REQUIRED yara>=4)
pkg_check_modules(YARA REQUIRED yara>=4.2)
target_link_libraries(inmemoryscanner-obj PUBLIC ${YARA_LINK_LIBRARIES})

if (${YARA_VERSION} VERSION_GREATER_EQUAL 4.1)
target_compile_definitions(inmemoryscanner-obj PRIVATE LIBYARA_4_1)
endif ()

pkg_check_modules(TCLAP REQUIRED tclap>=1.2)

include(FetchContent)
Expand Down
6 changes: 1 addition & 5 deletions plugins/inmemoryscanner/src/lib/YaraInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,12 @@ namespace InMemoryScanner
mappedRegion.mappingBase,
&fetch_block_data);
}
#ifdef LIBYARA_4_1

YR_MEMORY_BLOCK_ITERATOR iterator{.context = &iteratorContext,
.first = &get_first_block,
.next = &get_next_block,
.file_size = nullptr,
.last_error = ERROR_SUCCESS};
#else
YR_MEMORY_BLOCK_ITERATOR iterator{
.context = &iteratorContext, .first = &get_first_block, .next = &get_next_block};
#endif

if (auto err = yr_rules_scan_mem_blocks(rules,
&iterator,
Expand Down

0 comments on commit b70ab31

Please sign in to comment.