~ruther/csharp-dll-injector

c2de55b90c314ebe6d3df681a35fae1d81519e70 — František Boháček 4 years ago 79041a7
Add InjectedModule::FreeLibrary
1 files changed, 7 insertions(+), 0 deletions(-)

M DllUtils/Modules/InjectedModule.cs
M DllUtils/Modules/InjectedModule.cs => DllUtils/Modules/InjectedModule.cs +7 -0
@@ 4,6 4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DllUtils.Interop;
using DllUtils.Memory;
using DllUtils.Process;

namespace DllUtils.Modules


@@ 18,6 19,12 @@ namespace DllUtils.Modules

        public string DllPath { get; }

        public bool FreeLibrary()
        {
            RemoteModule kernel32 = Process.GetRemoteKernel32();
            FunctionResult result = kernel32.ExecuteFunction("FreeLibrary", RemoteHandle);

            return result.To<bool>();
        }
    }
}

Do not follow this link