From 67a2b060c9fafa5b73ca24e91b50c4f5b8858e49 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 30 Jan 2022 13:39:28 +0100 Subject: [PATCH] feat(inject): make load return value 32bit to prevent receiving of non-zeroed memory --- src/Inject/NosSmooth.Inject/nossmooth.cpp | 6 +++--- src/Inject/NosSmooth.Inject/nossmooth.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Inject/NosSmooth.Inject/nossmooth.cpp b/src/Inject/NosSmooth.Inject/nossmooth.cpp index b5254baada9671eed68afa0ed486cd59912d61e2..75e37b7cc620f977494c0c53c4efb27a6b8e00ce 100644 --- a/src/Inject/NosSmooth.Inject/nossmooth.cpp +++ b/src/Inject/NosSmooth.Inject/nossmooth.cpp @@ -98,12 +98,12 @@ load_assembly_and_get_function_pointer_fn get_dotnet_load_assembly(const char_t* return (load_assembly_and_get_function_pointer_fn)load_assembly_and_get_function_pointer; } -bool LoadAndCallMethod(LoadParams* params) +int LoadAndCallMethod(LoadParams* params) { if (!load_hostfxr()) { assert(false && "Failure: load_hostfxr()"); - return false; + return 0; } load_assembly_and_get_function_pointer_fn load_assembly_and_get_function_pointer = nullptr; @@ -121,5 +121,5 @@ bool LoadAndCallMethod(LoadParams* params) (void**)&main); assert(rc == 0 && main != nullptr && "Failure: load_assembly_and_get_function_pointer()"); main(); - return true; + return 1; } \ No newline at end of file diff --git a/src/Inject/NosSmooth.Inject/nossmooth.h b/src/Inject/NosSmooth.Inject/nossmooth.h index 55f846197658089f4538694f9c6df460cafe6137..3e24d1a7035c79fc0bdf6d8978b26d1dec1ae465 100644 --- a/src/Inject/NosSmooth.Inject/nossmooth.h +++ b/src/Inject/NosSmooth.Inject/nossmooth.h @@ -12,4 +12,4 @@ struct LoadParams #pragma pack(pop) #define DllExport extern "C" __declspec( dllexport ) -DllExport bool LoadAndCallMethod(LoadParams* params); \ No newline at end of file +DllExport int LoadAndCallMethod(LoadParams* params); \ No newline at end of file