From 235805edf30475131299fe6a1c3fd772cd6dba98 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 21 May 2020 10:23:53 +0200 Subject: [PATCH 1/2] nifm: correct assert in CreateTemporaryNetworkProfile This has been wrong since https://github.com/yuzu-emu/yuzu/commit/0432af5ad1ec34f02071f6fdc5fc78149b059f18 I haven't found a game that called this function (and I haven't tried this on a real Switch), and because of this I haven't been able to check if the number in assert OR the string in the assert is wrong, but one of the two is wrong: NetworkProfileData is 0x18E, while SfNetworkProfileData is 0x17C, according to Switchbrew Switchbrew doesn't officially say that NetworkProfileData's size is 0x18E but it's possible to calculate its size since Switchbrew provides the size and the offset of all the components of NetworkProfileData (which isn't currently implemented in yuzu, alongside SfNetworkProfileData) NetworkProfileData documentation: https://switchbrew.org/wiki/Network_Interface_services#NetworkProfileData SfNetworkProfileData documentation: https://switchbrew.org/wiki/Network_Interface_services#SfNetworkProfileData Since I trust ogniK's work on reversing NIFM, I'd assume this was just a typo in the string --- src/core/hle/service/nifm/nifm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 7671584442..aa6fbf67f1 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -177,7 +177,7 @@ private: void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NIFM, "called"); - ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, "NetworkProfileData is not the correct size"); + ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, "SfNetworkProfileData is not the correct size"); u128 uuid{}; auto buffer = ctx.ReadBuffer(); std::memcpy(&uuid, buffer.data() + 8, sizeof(u128)); From cb75ccc1f70778c245947047b5139795b9463c48 Mon Sep 17 00:00:00 2001 From: VolcaEM <63682805+VolcaEM@users.noreply.github.com> Date: Thu, 21 May 2020 10:43:55 +0200 Subject: [PATCH 2/2] clang-format --- src/core/hle/service/nifm/nifm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index aa6fbf67f1..01ddcdbd6a 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -177,7 +177,8 @@ private: void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NIFM, "called"); - ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, "SfNetworkProfileData is not the correct size"); + ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, + "SfNetworkProfileData is not the correct size"); u128 uuid{}; auto buffer = ctx.ReadBuffer(); std::memcpy(&uuid, buffer.data() + 8, sizeof(u128));