Skip to content

Commit 023e439

Browse files
committed
Add bool for marshalling parameters when calling them.
1 parent 2f0600b commit 023e439

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Source/Reloaded.Injector/Injector.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,18 @@ public long GetFunctionAddress(string module, string functionToExecute)
9999
/// A parameter to pass onto the function. It is written into memory and a pointer to it
100100
/// is passed to the target function.
101101
/// </param>
102+
/// <param name="marshalParameter">
103+
/// Set to true to enable marshalling of the parameter being passed into the receiving application.
104+
/// </param>
102105
/// <remarks>
103106
/// Passing of only 1 parameter is supported. If you want to pass multiple parameters, pass a struct
104107
/// This function passes a pointer to your parameter to the target function.
105108
/// A parameter must be passed and the target method must expect it. This is a limitation of CreateRemoteThread.
106109
/// </remarks>
107110
/// <returns>A 32bit truncated exit code/return value. CreateRemoteThread does not support 64bit returns.</returns>
108-
public int CallFunction<TStruct>(string module, string functionToExecute, TStruct parameter = default(TStruct))
111+
public int CallFunction<TStruct>(string module, string functionToExecute, TStruct parameter = default(TStruct), bool marshalParameter = false)
109112
{
110-
IntPtr parameterPtr = _circularBuffer.Add(ref parameter);
113+
IntPtr parameterPtr = _circularBuffer.Add(ref parameter, marshalParameter);
111114
return CallFunction(module, functionToExecute, (long)parameterPtr);
112115
}
113116

Source/Reloaded.Injector/Reloaded.Injector.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<RepositoryUrl>https://github.com/Reloaded-Project/Reloaded.Injector</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16-
<Version>1.0.3</Version>
16+
<Version>1.1.0</Version>
1717
<Copyright>LGPLV3</Copyright>
1818
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1919
</PropertyGroup>

0 commit comments

Comments
 (0)