QEMU-Nyx-fork/nyx/redqueen_patch.c
Sergej Schumilo 8a88edc2a1 auto-apply clang-format
- including vl.c & kvm-all.c
2022-10-16 23:51:13 +02:00

45 lines
784 B
C

#include "qemu/osdep.h"
#include "redqueen_patch.h"
#include "debug.h"
#include "file_helper.h"
#include "patcher.h"
#include "redqueen.h"
/*
* Private Helper Functions Declarations
*/
void _load_and_set_patches(patcher_t *self);
/*
* Public Functions
*/
void pt_enable_patches(patcher_t *self)
{
_load_and_set_patches(self);
patcher_apply_all(self);
}
void pt_disable_patches(patcher_t *self)
{
patcher_restore_all(self);
}
/*
* Private Helper Functions Definitions
*/
void _load_and_set_patches(patcher_t *self)
{
size_t num_addrs = 0;
uint64_t *addrs = NULL;
parse_address_file(redqueen_workdir.redqueen_patches, &num_addrs, &addrs);
if (num_addrs) {
patcher_set_addrs(self, addrs, num_addrs);
free(addrs);
}
}