mirror of
https://github.com/NohamR/RMHook.git
synced 2026-01-11 06:58:11 +00:00
First release
This commit is contained in:
23
src/core/tinyhook/search.c
Normal file
23
src/core/tinyhook/search.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef COMPACT
|
||||
#include <printf.h> // fprintf()
|
||||
#endif
|
||||
|
||||
#include "skip/skip.h"
|
||||
|
||||
#include "../include/tinyhook.h"
|
||||
|
||||
int find_data(void *start, void *end, const unsigned char *data, size_t len, int count, void **out) {
|
||||
int matched;
|
||||
skipidx_t idx;
|
||||
skip_init(&idx, len, data);
|
||||
matched = skip_match(&idx, start, end, count, (offset_t *)out);
|
||||
skip_release(&idx);
|
||||
#ifndef COMPACT
|
||||
if (matched == 0) {
|
||||
fprintf(stderr, "find_data: data not found!\n");
|
||||
}
|
||||
#endif
|
||||
return matched;
|
||||
}
|
||||
|
||||
// int find_code(uint32_t image_index, const unsigned char *code, size_t len, int count, void **out);
|
||||
Reference in New Issue
Block a user