2021-01-27 16:26:19 -05:00
|
|
|
#pragma once
|
2020-09-25 12:43:53 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
#include "log.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "string.h"
|
|
|
|
#include "exec.h"
|
|
|
|
#include "elf.h"
|
|
|
|
|
2021-09-11 23:18:12 -04:00
|
|
|
#ifdef REBORN_HAS_COMPILED_CODE
|
2021-02-21 22:43:57 -05:00
|
|
|
|
|
|
|
// Patching Functions
|
|
|
|
|
2020-11-20 13:36:03 -05:00
|
|
|
void _overwrite_call(const char *file, int line, void *start, void *target);
|
|
|
|
#define overwrite_call(start, target) _overwrite_call(__FILE__, __LINE__, start, target);
|
|
|
|
|
2020-11-09 19:49:41 -05:00
|
|
|
void _overwrite_calls(const char *file, int line, void *start, void *target);
|
|
|
|
#define overwrite_calls(start, target) _overwrite_calls(__FILE__, __LINE__, start, target);
|
2020-10-03 12:57:58 -04:00
|
|
|
|
2020-11-09 19:49:41 -05:00
|
|
|
void _overwrite(const char *file, int line, void *start, void *target);
|
|
|
|
#define overwrite(start, target) _overwrite(__FILE__, __LINE__, start, target);
|
2020-10-03 12:57:58 -04:00
|
|
|
|
2021-07-18 21:08:51 -04:00
|
|
|
void _patch(const char *file, int line, void *start, unsigned char patch[4]);
|
2020-10-03 12:57:58 -04:00
|
|
|
#define patch(start, patch) _patch(__FILE__, __LINE__, start, patch);
|
|
|
|
|
2020-10-03 20:30:15 -04:00
|
|
|
void _patch_address(const char *file, int line, void *start, void *target);
|
2020-10-03 12:57:58 -04:00
|
|
|
#define patch_address(start, target) _patch_address(__FILE__, __LINE__, start, target);
|
2020-09-25 12:43:53 -04:00
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
#endif // #ifdef __arm__
|
|
|
|
|
2020-09-25 12:43:53 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|