From b69c6eff1582d207e2ffdf646e29e24f22b4b55f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 20 Apr 2018 21:06:32 -0600 Subject: [PATCH] Fix padding for C descriptors --- stratosphere/loader/source/ipc_templating.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stratosphere/loader/source/ipc_templating.hpp b/stratosphere/loader/source/ipc_templating.hpp index f7ac28707..2bafb7a7e 100644 --- a/stratosphere/loader/source/ipc_templating.hpp +++ b/stratosphere/loader/source/ipc_templating.hpp @@ -278,7 +278,7 @@ struct Validator> { size_t a_index = 0, b_index = num_inbuffers_in_arguments::value, x_index = 0, c_index = 0, h_index = 0; size_t cur_rawdata_index = 4; - size_t cur_c_size_offset = 8 + size_in_raw_data_for_arguments::value + (0x10 - ((uintptr_t)r.Raw - (uintptr_t)r.RawWithoutPadding)); + size_t cur_c_size_offset = 0x10 + size_in_raw_data_for_arguments::value + (0x10 - ((uintptr_t)r.Raw - (uintptr_t)r.RawWithoutPadding)); size_t total_c_size = 0; if (!(ValidateIpcParsedCommandArgument(r, cur_rawdata_index, cur_c_size_offset, a_index, b_index, x_index, c_index, h_index, total_c_size) && ...)) { @@ -303,7 +303,7 @@ struct Decoder> { static std::tuple Decode(IpcParsedCommand& r, IpcCommand &out_c, u8 *pointer_buffer) { size_t a_index = 0, b_index = num_inbuffers_in_arguments::value, x_index = 0, c_index = 0, h_index = 0; size_t cur_rawdata_index = 4; - size_t cur_c_size_offset = 8 + size_in_raw_data_for_arguments::value + (0x10 - ((uintptr_t)r.Raw - (uintptr_t)r.RawWithoutPadding)); + size_t cur_c_size_offset = 0x10 + size_in_raw_data_for_arguments::value + (0x10 - ((uintptr_t)r.Raw - (uintptr_t)r.RawWithoutPadding)); size_t pointer_buffer_offset = 0; return std::tuple { GetValueFromIpcParsedCommand(r, out_c, pointer_buffer, pointer_buffer_offset, cur_rawdata_index, cur_c_size_offset, a_index, b_index, x_index, c_index, h_index)