-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linux.c: don't use pread64 #2048
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
#include <yara/proc.h> | ||
#include <yara/strutils.h> | ||
|
||
#define _FILE_OFFSET_BITS 64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not work, it must be defined before any include for it to have an effect. This can be confirmed by:
the static assert fails, indicating the scanning would be invalid. That's why i was suggesting adding a static assert, it is very easy to break the fix without realizing it. |
||
|
||
typedef struct _YR_PROC_INFO | ||
{ | ||
int pid; | ||
|
@@ -249,7 +251,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 +267,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 +286,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, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: Since the
_FILE_OFFSET_BITS=64
value is defined, we could remove AC_SYS_LARGEFILE from the configure.ac file now