From 6c4df9fc0ef03852837519a13b295f00f202d3f8 Mon Sep 17 00:00:00 2001 From: "Daniel K. O." Date: Sat, 12 Oct 2024 11:44:50 -0300 Subject: [PATCH] Moved `function_replacement_data_v2_t` to a private header. (#33) * Moved `function_replacement_data_v2_t` to a private header. * Sorted includes. * Sorted includes the way clang likes it. * Updated Dockerfile. --------- Co-authored-by: Daniel K. O. (dkosmari) --- Dockerfile | 2 +- source/PatchedFunctionData.h | 1 + source/fpatching_defines_legacy.h | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 source/fpatching_defines_legacy.h diff --git a/Dockerfile b/Dockerfile index 972fe76..7b647f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ghcr.io/wiiu-env/devkitppc:20240505 COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO -COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO +COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20241012-5173f86 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO WORKDIR project diff --git a/source/PatchedFunctionData.h b/source/PatchedFunctionData.h index 8bf3691..dec2953 100644 --- a/source/PatchedFunctionData.h +++ b/source/PatchedFunctionData.h @@ -2,6 +2,7 @@ #include "FunctionAddressProvider.h" #include "PatchedFunctionData.h" +#include "fpatching_defines_legacy.h" #include "utils/logger.h" #include #include diff --git a/source/fpatching_defines_legacy.h b/source/fpatching_defines_legacy.h new file mode 100644 index 0000000..8824598 --- /dev/null +++ b/source/fpatching_defines_legacy.h @@ -0,0 +1,17 @@ +#pragma once + +/* Types that are kept only for ABI compatibility. */ + +#include +#include + +typedef struct function_replacement_data_v2_t { + uint32_t VERSION; + uint32_t physicalAddr; /* [needs to be filled] */ + uint32_t virtualAddr; /* [needs to be filled] */ + uint32_t replaceAddr; /* [needs to be filled] Address of our replacement function */ + uint32_t *replaceCall; /* [needs to be filled] Address to access the real_function */ + function_replacement_library_type_t library; /* [needs to be filled] rpl where the function we want to replace is. */ + const char *function_name; /* [needs to be filled] name of the function we want to replace */ + FunctionPatcherTargetProcess targetProcess; /* [will be filled] */ +} function_replacement_data_v2_t;