mirror of
https://github.com/NohamR/RMHook.git
synced 2026-01-09 22:18:13 +00:00
23 lines
611 B
C
23 lines
611 B
C
#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);
|