From 342d0a27b5b783081187fd312f280122f77174c8 Mon Sep 17 00:00:00 2001 From: a Date: Fri, 22 Dec 2023 09:28:43 +0200 Subject: [PATCH] fixed is a sneaky instatnt memory deallocation, check this for details: viewtopic.php?p=2962649#p2962649 --- dll/auth.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dll/auth.h b/dll/auth.h index 0e254239..48b8257c 100644 --- a/dll/auth.h +++ b/dll/auth.h @@ -87,7 +87,12 @@ public: *reinterpret_cast(pBuffer) = InternalIP; pBuffer += 4; *reinterpret_cast(pBuffer) = TimeSinceStartup; pBuffer += 4; *reinterpret_cast(pBuffer) = TicketGeneratedCount; pBuffer += 4; - PRINT_DEBUG("AppTicketGC SER: %s\n",uint8_vector_to_hex_string(buffer).c_str()); +#ifndef EMU_RELEASE_BUILD + // we nedd a live object until the printf does its job, hence this special handling + auto str = uint8_vector_to_hex_string(buffer); + PRINT_DEBUG("AUTH::AppTicketGC::SER final data [%zu bytes]: %s\n", buffer.size(), str.c_str()); +#endif + return buffer; } }; @@ -147,10 +152,15 @@ struct AppTicket { { *reinterpret_cast(pBuffer) = dlc_license; pBuffer += 4; } +#ifndef EMU_RELEASE_BUILD + { + // we nedd a live object until the printf does its job, hence this special handling + auto str = uint8_vector_to_hex_string(buffer); + PRINT_DEBUG("AUTH::AppTicket::SER final data [%zu bytes]: %s\n", buffer.size(), str.c_str()); } +#endif *reinterpret_cast(pBuffer) = (uint16_t)0; pBuffer += 2; //padding - PRINT_DEBUG("AppTicket SER : %s\n",uint8_vector_to_hex_string(buffer).c_str()); return buffer; } }; @@ -188,7 +198,13 @@ struct Auth_Data { *reinterpret_cast(pBuffer) = (tickedData.size()+4); pBuffer += 4; memcpy(pBuffer, tickedData.data(), tickedData.size()); - PRINT_DEBUG("Auth_Data SER : %s\n",uint8_vector_to_hex_string(buffer).c_str()); + +#ifndef EMU_RELEASE_BUILD + // we nedd a live object until the printf does its job, hence this special handling + auto str = uint8_vector_to_hex_string(buffer); + PRINT_DEBUG("AUTH::Auth_Data::SER final data [%zu bytes]: %s\n", buffer.size(), str.c_str()); +#endif + //Todo make a signature return buffer; }