Skip to content

Commit c545bf2

Browse files
committed
Implement Multiple Finalizers and Update Dependencies
Automatic cleanup of unmanaged memory to ensure no leaks if/when resources are not manually disposed.
1 parent 73b963a commit c545bf2

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Source/Reloaded.Injector/Injector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ public Injector(Process process)
3939
_shellCode = new Shellcode(process);
4040
}
4141

42+
~Injector()
43+
{
44+
Dispose();
45+
}
46+
4247
/// <summary>
4348
/// Injects a DLL into the target process.
4449
/// </summary>

Source/Reloaded.Injector/Reloaded.Injector.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<RepositoryUrl>https://github.com/Reloaded-Project/Reloaded.Injector</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16+
<Version>1.0.1</Version>
1617
</PropertyGroup>
1718

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

3536
<ItemGroup>
3637
<PackageReference Include="PeNet" Version="0.8.1" />
37-
<PackageReference Include="Reloaded.Assembler" Version="1.0.3" />
38-
<PackageReference Include="Reloaded.Memory" Version="1.2.0" />
39-
<PackageReference Include="Reloaded.Memory.Buffers" Version="1.1.0" />
38+
<PackageReference Include="Reloaded.Assembler" Version="1.0.4" />
39+
<PackageReference Include="Reloaded.Memory" Version="1.2.1" />
40+
<PackageReference Include="Reloaded.Memory.Buffers" Version="1.1.1" />
4041
</ItemGroup>
4142

4243
<ItemGroup>

Source/Reloaded.Injector/Shellcode.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ public Shellcode(Process targetProcess)
9999
_assembler = null;
100100
}
101101

102+
~Shellcode()
103+
{
104+
Dispose();
105+
}
106+
102107
/* Call Shellcode */
103108

104109
public long GetProcAddress(long hModule, string functionName)

0 commit comments

Comments
 (0)