Skip to content

Commit

Permalink
Implement Multiple Finalizers and Update Dependencies
Browse files Browse the repository at this point in the history
Automatic cleanup of unmanaged memory to ensure no leaks if/when resources are not manually disposed.
  • Loading branch information
Sewer56 committed Jan 5, 2019
1 parent 73b963a commit c545bf2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Source/Reloaded.Injector/Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public Injector(Process process)
_shellCode = new Shellcode(process);
}

~Injector()
{
Dispose();
}

/// <summary>
/// Injects a DLL into the target process.
/// </summary>
Expand Down
7 changes: 4 additions & 3 deletions Source/Reloaded.Injector/Reloaded.Injector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<RepositoryUrl>https://github.com/Reloaded-Project/Reloaded.Injector</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand All @@ -34,9 +35,9 @@

<ItemGroup>
<PackageReference Include="PeNet" Version="0.8.1" />
<PackageReference Include="Reloaded.Assembler" Version="1.0.3" />
<PackageReference Include="Reloaded.Memory" Version="1.2.0" />
<PackageReference Include="Reloaded.Memory.Buffers" Version="1.1.0" />
<PackageReference Include="Reloaded.Assembler" Version="1.0.4" />
<PackageReference Include="Reloaded.Memory" Version="1.2.1" />
<PackageReference Include="Reloaded.Memory.Buffers" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions Source/Reloaded.Injector/Shellcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public Shellcode(Process targetProcess)
_assembler = null;
}

~Shellcode()
{
Dispose();
}

/* Call Shellcode */

public long GetProcAddress(long hModule, string functionName)
Expand Down

0 comments on commit c545bf2

Please sign in to comment.