Commit Graph

56 Commits

Author SHA1 Message Date
Maschell
214369da29 Bump Version 2023-03-28 20:22:29 +02:00
Maschell
fa3292fa28 memset the memory to 0 before freeing 2023-03-26 15:49:04 +02:00
Maschell
35f2c495cc Bump version to 0.2 2023-01-10 18:05:29 +01:00
Maschell
1c7a6ac333 Add support for function patcher struct version 3 2023-01-07 23:55:23 +01:00
Maschell
c074ca4892 Use WUMS 0.3.2 2023-01-07 23:55:23 +01:00
Maschell
9485cc7e15 Rename toRemoved to toBeRemoved 2023-01-06 14:31:14 +01:00
Maschell
ecc109af50 Only try to restore a function if it's actually patched 2023-01-06 14:31:14 +01:00
Maschell
5adf6c3688 Implement v2 of the FunctionPatcherModule API 2023-01-06 14:31:14 +01:00
Maschell
1e2457b266 PatchedFunctionData. Actually return on error instead of allocating even more memory 2023-01-06 14:31:14 +01:00
Maschell
b1320f0c8d Improve logging 2023-01-06 14:31:14 +01:00
Maschell
8d853d6320 Simplify reading the existing instruction when patching a function 2023-01-06 14:31:14 +01:00
Maschell
e85d383ec4 Log the module version on each application start 2023-01-04 22:40:13 +01:00
Maschell
ac0c341eb4 Reset the cached function handle if RPL has been unloaded 2023-01-02 17:06:07 +01:00
Maschell
e51e6a9509 Reset function patch state if a RPL has been unloaded. 2023-01-02 17:06:07 +01:00
Maschell
7703eac375 Fix restoring "dynamic" functions. Instead of predicting an unload of a RPL we now check if the replaced instruction has been changed. 2023-01-02 15:44:27 +01:00
Maschell
182c6d2f92 Check if the function is already patched before updating the addresses 2023-01-02 15:44:27 +01:00
Maschell
f94b857f12 Use std::list instead of array 2023-01-02 15:44:27 +01:00
Maschell
c719b4c8ac Remove call of OSDynLoad_Release for handles that have not been acquired 2023-01-02 15:44:27 +01:00
Maschell
ced1e27b53 Fix patching dynamic function in WUMS_INITIALIZE hooks 2022-08-21 22:47:37 +02:00
Maschell
1a33517f0e Fix patching of functions that only consist of one branch instruction outside of nn::acp 2022-08-06 22:44:59 +02:00
Maschell
874e5d9923 Fix function patching for functions with an effective address between 0x20000000 - 0x3FFFFFFC 2022-08-06 22:44:59 +02:00
Maschell
d602d17034 Update the malloc/free pointers used for threads to fix apps which use a custom heap 2022-07-28 02:44:13 -07:00
Maschell
f95f00e6f2 Rewrite of Function Patcher to match libfunctionpatcher 2022-05-08 19:26:06 +02:00
Maschell
e0f745f0c9 Improve logging to include module name 2022-05-08 19:26:06 +02:00
Maschell
a8b4f7188b Format the code via clang-format 2022-02-03 20:57:25 +01:00
Maschell
2e5e3d1d2f Fix dynamic_function detection 2022-01-31 16:12:51 +01:00
Maschell
2db7befb4b Move logging logic into a seperate file 2022-01-24 18:52:59 +01:00
Maschell
ffd4c4f894 Only declare variables when needed 2022-01-24 18:49:31 +01:00
Maschell
c9c0aeaa2b WUMS 0.3.1 support 2022-01-24 18:48:11 +01:00
Maschell
0678949900 Remove WUMS_MODULE_INIT_BEFORE_RELOCATION_DONE_HOOK 2022-01-24 18:46:22 +01:00
Maschell
925aa353bd Avoid using the "new" operator to reduce the filesize 2022-01-12 23:07:39 +01:00
Maschell
f5f9c5f8ff Only do logging when built with make DEBUG=1 2022-01-12 23:07:09 +01:00
Maschell
4553a06f9b Formatting and cleanup 2021-09-24 14:49:20 +02:00
Maschell
551144ddbd Do an OSFatal if the getting the PA from EA fails 2021-09-23 23:05:15 +02:00
Maschell
dd3709ad48 Fix PA fallback calcuation 2021-09-23 23:03:48 +02:00
Maschell
38b58faf88 Reenable logging, Update Dockerfile to use WUMS 0.2 2021-09-17 18:27:12 +02:00
Maschell
ee76aba48e Compile with latest wut 2021-04-17 12:13:22 +02:00
Maschell
57a932888a Reduce the amount of logged messages 2021-03-13 14:03:07 +01:00
Maschell
c8df49e85c Use WUMS_MODULE_SKIP_WUT_INIT 2021-02-19 17:10:17 +01:00
Maschell
978678675c Add FunctionPatcherRestoreDynamicFunctions 2020-12-28 14:45:28 +01:00
Maschell
e745f34b3a Rename WUMS_MODULE_INIT_BEFORE_ENTRYPOINT => WUMS_MODULE_INIT_BEFORE_RELOCATION_DONE_HOOK, add WUMS_MODULE_SKIP_ENTRYPOINT 2020-12-28 14:42:19 +01:00
Maschell
00e02a33e1 Only patch a function if the module is already loaded 2020-12-26 14:49:48 +01:00
Maschell
73947c0a13 Fix restoring functions patches for other proccesses 2020-08-09 18:02:07 +02:00
Maschell
43964558f2 Format the code and improve logging. 2020-06-13 16:25:39 +02:00
Maschell
1383ca2d8e Add support for "per process"-patches 2020-06-13 13:59:29 +02:00
Maschell
dcff18577f Check if we exceed the space we have available 2020-06-13 13:59:01 +02:00
Maschell
d43d097fd9 The function type is now stored as a enum 2020-06-13 13:58:34 +02:00
Maschell
6c18efef54 Check function patcher data struct before patching a function 2020-06-13 13:17:46 +02:00
Maschell
cb8e963f71 Use a ba instead of a trampoline if possible 2020-06-13 13:14:00 +02:00
Maschell
b817663d47 Simplify the cache flushing 2020-06-13 13:10:17 +02:00