Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Proxy : MarshalByRefObject {
- Assembly assembly;
- MethodInfo meth;
- void LoadIfNeeded( ) {
- if( meth == null ) {
- assembly = Assembly.LoadFile( Directory.GetCurrentDirectory( ) + "\\dll" );
- meth = assembly.GetType( "PP3" ).GetMethod( "Run" );
- Activator.CreateInstance( typeof( Proxy ) );
- }
- }
- public byte[] GetILCode( ) {
- LoadIfNeeded( );
- return meth.GetMethodBody( ).GetILAsByteArray( );
- }
- public int GetMaxStackSize( ) {
- LoadIfNeeded( );
- return meth.GetMethodBody( ).MaxStackSize;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement