Remove overwrite()
This commit is contained in:
parent
5e229fb6a8
commit
6a2ecb23ed
@ -58,23 +58,6 @@ void _overwrite_calls_within(const char *file, int line, void *from, void *to, s
|
||||
// Get Target Address From BL Instruction
|
||||
void *extract_from_bl_instruction(unsigned char *from);
|
||||
|
||||
// Replace Method start With target
|
||||
void _overwrite_manual(const char *file, int line, void *start, void *target);
|
||||
#define overwrite_manual(...) \
|
||||
_overwrite(__FILE__, __LINE__, __VA_ARGS__)
|
||||
template <typename start_t>
|
||||
void _overwrite(const char *file, int line, start_t start, start_t target) {
|
||||
_overwrite_manual(file, line, (void *) start, (void *) target);
|
||||
}
|
||||
#define overwrite(start, ...) \
|
||||
_overwrite< \
|
||||
__raw_##start##_t \
|
||||
>( \
|
||||
__FILE__, __LINE__, \
|
||||
start, \
|
||||
__VA_ARGS__ \
|
||||
)
|
||||
|
||||
// Patch Instruction
|
||||
void _patch(const char *file, int line, void *start, unsigned char patch[4]);
|
||||
#define patch(...) \
|
||||
|
@ -112,13 +112,6 @@ void _overwrite_calls_within_manual(const char *file, int line, void *from /* in
|
||||
increment_code_block();
|
||||
}
|
||||
|
||||
// Overwrite Function
|
||||
void _overwrite_manual(const char *file, int line, void *start, void *target) {
|
||||
// Replace the function's start with a call
|
||||
// to the replacement function.
|
||||
_overwrite_call_internal(file, line, start, target, 1);
|
||||
}
|
||||
|
||||
// Print Patch Debug Data
|
||||
#define PATCH_PRINTF(file, line, start, str) if (file != NULL) DEBUG("(%s:%i): Patching (%p) - " str ": %02x %02x %02x %02x", file, line, start, data[0], data[1], data[2], data[3]);
|
||||
|
||||
|
@ -961,7 +961,7 @@ void init_misc() {
|
||||
|
||||
// Replace 2011 std::sort With Optimized(TM) Code
|
||||
if (feature_has("Optimized Chunk Sorting", server_enabled)) {
|
||||
overwrite_manual((void *) 0x51fac, (void *) sort_chunks);
|
||||
overwrite_calls_manual((void *) 0x51fac, (void *) sort_chunks);
|
||||
}
|
||||
|
||||
// Display Date In Select World Screen
|
||||
|
Loading…
Reference in New Issue
Block a user