@@ -18,10 +18,13 @@ namespace Reloaded.Injector
1818 /// Builds the shellcode inside a target process which can be used to
1919 /// call LoadLibrary and GetProcAddress inside a remote process.
2020 /// </summary>
21- internal class Shellcode : IDisposable
21+ public class Shellcode : IDisposable
2222 {
2323 /* Setup/Build Shellcode */
24- public long Kernel32Handle { get ; } /* Address of Kernel32 in remote process. */
24+ public long Kernel32Handle { get ; } /* Address of Kernel32 in remote process. */
25+ public long LoadLibraryAddress { get ; private set ; } /* Address of LoadLibrary function. */
26+ public long GetProcAddressAddress { get ; private set ; } /* Address of GetProcAddress function. */
27+
2528 private uint _loadLibraryWOffset ; /* Address of LoadLibraryW in remote process. */
2629 private uint _getProcAddressOffset ; /* Address of GetProcAddress in remote process. */
2730 private MachineType _machineType ; /* Is remote process 64 or 32bit? */
@@ -145,8 +148,9 @@ private void BuildGetProcAddress86()
145148 // GetProcAddress(long hModule, char* lpProcName)
146149 // lpParameter: Address of first struct member.
147150 // Using stdcall calling convention.
148- long getProcAddressAddress = Kernel32Handle + _getProcAddressOffset ;
149- IntPtr getProcAddressPtr = _privateBuffer . Add ( ref getProcAddressAddress ) ;
151+ long getProcAddressAddress = Kernel32Handle + _getProcAddressOffset ;
152+ GetProcAddressAddress = getProcAddressAddress ;
153+ IntPtr getProcAddressPtr = _privateBuffer . Add ( ref getProcAddressAddress ) ;
150154
151155 long dummy = 0 ;
152156 _getProcAddressReturnValuePtr = ( long ) _privateBuffer . Add ( ref dummy ) ;
@@ -172,8 +176,9 @@ private void BuildGetProcAddress64()
172176 // GetProcAddress(long hModule, char* lpProcName)
173177 // lpParameter: Address of first struct member.
174178 // Using Microsoft X64 calling convention.
175- long getProcAddressAddress = Kernel32Handle + _getProcAddressOffset ;
176- IntPtr getProcAddressPtr = _privateBuffer . Add ( ref getProcAddressAddress ) ;
179+ long getProcAddressAddress = Kernel32Handle + _getProcAddressOffset ;
180+ GetProcAddressAddress = getProcAddressAddress ;
181+ IntPtr getProcAddressPtr = _privateBuffer . Add ( ref getProcAddressAddress ) ;
177182
178183 long dummy = 0 ;
179184 _getProcAddressReturnValuePtr = ( long ) _privateBuffer . Add ( ref dummy ) ;
@@ -200,6 +205,7 @@ private void BuildLoadLibraryW86()
200205 {
201206 // Using stdcall calling convention.
202207 long loadLibraryAddress = Kernel32Handle + _loadLibraryWOffset ;
208+ LoadLibraryAddress = loadLibraryAddress ;
203209 IntPtr loadLibraryPtr = _privateBuffer . Add ( ref loadLibraryAddress ) ;
204210
205211 long dummy = 0 ;
@@ -223,8 +229,9 @@ private void BuildLoadLibraryW86()
223229 private void BuildLoadLibraryW64 ( )
224230 {
225231 // Using Microsoft X64 calling convention.
226- long loadLibraryAddress = Kernel32Handle + _loadLibraryWOffset ;
227- IntPtr loadLibraryPtr = _privateBuffer . Add ( ref loadLibraryAddress ) ;
232+ long loadLibraryAddress = Kernel32Handle + _loadLibraryWOffset ;
233+ LoadLibraryAddress = loadLibraryAddress ;
234+ IntPtr loadLibraryPtr = _privateBuffer . Add ( ref loadLibraryAddress ) ;
228235
229236 long dummy = 0 ;
230237 _loadLibraryWReturnValuePtr = ( long ) _privateBuffer . Add ( ref dummy ) ;
0 commit comments