diff --git a/dependencies/symbol-processor/src b/dependencies/symbol-processor/src index 853481b..9697b35 160000 --- a/dependencies/symbol-processor/src +++ b/dependencies/symbol-processor/src @@ -1 +1 @@ -Subproject commit 853481bd9ae617747fd1a5d0b6255bdf3946c6dd +Subproject commit 9697b35de4d783282afdd3a4c643951ce49a0158 diff --git a/launcher/src/client/available-feature-flags b/launcher/src/client/available-feature-flags index c1a758d..e365ed5 100644 --- a/launcher/src/client/available-feature-flags +++ b/launcher/src/client/available-feature-flags @@ -61,4 +61,5 @@ TRUE Add Splashes TRUE Display Date In Select World Screen TRUE Optimized Chunk Sorting TRUE Disable Buggy Held Item Caching -TRUE Add Reborn Info To Options \ No newline at end of file +TRUE Add Reborn Info To Options +FALSE Track FPS \ No newline at end of file diff --git a/libreborn/include/libreborn/patch.h b/libreborn/include/libreborn/patch.h index 9600011..bb8fda3 100644 --- a/libreborn/include/libreborn/patch.h +++ b/libreborn/include/libreborn/patch.h @@ -27,13 +27,12 @@ void _overwrite_call(const char *file, int line, void *start, void *target); static name##_t _helper_for_##target = __overwrite_helper_for_##name(target, _original_for_##target) // Replace All Calls To Method start With target -void _overwrite_calls(const char *file, int line, void *start, void *target); +void *_overwrite_calls(const char *file, int line, void *start, void *target); #define overwrite_calls_manual(start, target) _overwrite_calls(__FILE__, __LINE__, start, target) #define overwrite_calls(start, target) \ { \ _setup_fancy_overwrite(start, start, target); \ - overwrite_calls_manual((void *) start, (void *) _helper_for_##target); \ - start = _helper_for_##target; \ + start = (start##_t) overwrite_calls_manual((void *) start, (void *) _helper_for_##target); \ } // Replace All Calls To Virtual Method start With target @@ -45,7 +44,12 @@ void _overwrite_calls(const char *file, int line, void *start, void *target); // Replace All Calls To start With target Within [to, from) void _overwrite_calls_within(const char *file, int line, void *from, void *to, void *start, void *target); -#define overwrite_calls_within(from, to, start, target) _overwrite_calls_within(__FILE__, __LINE__, from, to, start, target) +#define overwrite_calls_within_manual(from, to, start, target) _overwrite_calls_within(__FILE__, __LINE__, from, to, start, target) +#define overwrite_calls_within(from, to, start, target) \ + { \ + start##_t type_check = target; \ + overwrite_calls_within_manual(from, to, (void *) start, (void *) type_check); \ + } // Get Target Address From BL Instruction void *extract_from_bl_instruction(unsigned char *from); @@ -55,9 +59,8 @@ void _overwrite(const char *file, int line, void *start, void *target); #define overwrite_manual(start, target) _overwrite(__FILE__, __LINE__, (void *) start, (void *) target) #define overwrite(start, target) \ { \ - _check_if_method_is_new(start); \ start##_t type_check = target; \ - overwrite_manual(start, (void *) type_check); \ + overwrite_manual((void *) start, (void *) type_check); \ } // Patch Instruction diff --git a/libreborn/src/patch/patch.cpp b/libreborn/src/patch/patch.cpp index b6c4ebd..831b3d0 100644 --- a/libreborn/src/patch/patch.cpp +++ b/libreborn/src/patch/patch.cpp @@ -77,7 +77,7 @@ static int _overwrite_calls_within_internal(const char *file, int line, void *fr #define TEXT_END 0x1020c0 // Overwrite All B(L) Intrusctions That Target The Specified Address #define NO_CALLSITE_ERROR "(%s:%i) Unable To Find Callsites For %p" -void _overwrite_calls(const char *file, int line, void *start, void *target) { +void *_overwrite_calls(const char *file, int line, void *start, void *target) { // Add New Target To Code Block void *code_block = update_code_block(target); @@ -93,6 +93,9 @@ void _overwrite_calls(const char *file, int line, void *start, void *target) { if (found < 1) { ERR(NO_CALLSITE_ERROR, file, line, start); } + + // Return + return code_block; } void _overwrite_calls_within(const char *file, int line, void *from /* inclusive */, void *to /* exclusive */, void *target, void *replacement) { // Add New Target To Code Block