-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yara: Add patches to fix build on Linux
- No need for linux/magic.h - pread64 is not recognized by musl-gcc. Also fix pkg_PATCHES system to support more than one patch, as originally intended.
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/libyara/filemap.c b/libyara/filemap.c | ||
index f8d06720..0b88640d 100644 | ||
--- a/libyara/filemap.c | ||
+++ b/libyara/filemap.c | ||
@@ -159,7 +159,7 @@ YR_API int yr_filemap_map_fd( | ||
|
||
#ifdef __linux__ | ||
#include <sys/vfs.h> | ||
-#include <linux/magic.h> | ||
+#define PROC_SUPER_MAGIC 0x9fa0 | ||
#endif | ||
|
||
#define MAP_EXTRA_FLAGS 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/libyara/proc/linux.c b/libyara/proc/linux.c | ||
index 72f2ab48..d57788fd 100644 | ||
--- a/libyara/proc/linux.c | ||
+++ b/libyara/proc/linux.c | ||
@@ -249,7 +249,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block) | ||
// target process VM. | ||
if (fd == -1) | ||
{ | ||
- if (pread64( | ||
+ if (pread( | ||
proc_info->mem_fd, | ||
(void*) context->buffer, | ||
block->size, | ||
@@ -265,7 +265,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block) | ||
{ | ||
goto _exit; | ||
} | ||
- if (pread64( | ||
+ if (pread( | ||
proc_info->pagemap_fd, | ||
pagemap, | ||
sizeof(uint64_t) * block->size / page_size, | ||
@@ -284,7 +284,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block) | ||
// swap-backed and if it differs from our mapping. | ||
uint8_t buffer[page_size]; | ||
|
||
- if (pread64( | ||
+ if (pread( | ||
proc_info->mem_fd, | ||
buffer, | ||
page_size, |