From f4dc7614054a138a4a21712442ba7b8f61951038 Mon Sep 17 00:00:00 2001 From: ko1N Date: Thu, 31 Mar 2022 14:53:00 +0200 Subject: [PATCH] Fixed compilation on gcc 11 and fixed new import paths for dlopen/dlsym/dlcose (#220) --- NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp | 2 +- ReClass.NET/Native/NativeMethods.Unix.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp index a3ef6d8b..e983ee77 100644 --- a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp @@ -50,7 +50,7 @@ extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, RC_UnicodeChar Path[PATH_MAXIMUM_LENGTH] = {}; }; - std::ifstream input(static_cast(std::stringstream() << "/proc/" << reinterpret_cast(handle) << "/maps").str()); + std::ifstream input((std::stringstream() << "/proc/" << reinterpret_cast(handle) << "/maps").str()); std::unordered_map modules; diff --git a/ReClass.NET/Native/NativeMethods.Unix.cs b/ReClass.NET/Native/NativeMethods.Unix.cs index 50be47b3..c1b2e6c4 100644 --- a/ReClass.NET/Native/NativeMethods.Unix.cs +++ b/ReClass.NET/Native/NativeMethods.Unix.cs @@ -10,13 +10,13 @@ internal class NativeMethodsUnix : INativeMethods private const int RTLD_NOW = 2; - [DllImport("libdl.so")] + [DllImport("__Internal")] private static extern IntPtr dlopen(string fileName, int flags); - [DllImport("libdl.so")] + [DllImport("__Internal")] private static extern IntPtr dlsym(IntPtr handle, string symbol); - [DllImport("libdl.so")] + [DllImport("__Internal")] private static extern int dlclose(IntPtr handle); #endregion