/// <param name="libraryPath">Full path to library to load.</param> /// <returns>0 if injection failed.</returns> public int Inject(string libraryPath) { IntPtr libraryNameMemoryAddress = WriteLoadLibraryParameter(libraryPath); int result = ExecuteFunction(_loadLibraryAddress, libraryNameMemoryAddress); _memory.Free(libraryNameMemoryAddress); return(result); }
/// <param name="libraryPath">Full path to library to load.</param> /// <returns>0 if injection failed.</returns> public int Inject(string libraryPath) { if (!initialized) { PreloadAddresses(); } var loadLibraryAddress = _process.Is64Bit() ? x64LoadLibraryAddress : x86LoadLibraryAddress; IntPtr libraryNameMemoryAddress = WriteLoadLibraryParameter(libraryPath); int result = ExecuteFunction(loadLibraryAddress, libraryNameMemoryAddress); _memory.Free(libraryNameMemoryAddress); return(result); }