Advertisement
Guest User

Untitled

a guest
Nov 5th, 2017
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4. namespace Payload
  5. {
  6.     /// <summary>
  7.     /// Test app that can be run standalone, or using Inject.exe.
  8.     /// </summary>
  9.     public class Program
  10.     {
  11.         /// <summary>
  12.         /// Method that matches our injection signature:
  13.         /// http://msdn.microsoft.com/en-us/library/ms164411.aspx
  14.         /// </summary>
  15.         /// <param name="pwzArgument">Optional argument to pass in.</param>
  16.         /// <returns>An integer code defined by you.</returns>
  17.         static int EntryPoint(String pwzArgument)
  18.         {
  19.             // play sound
  20.             //System.Media.SystemSounds.Beep.Play();
  21.  
  22.             // show modal message box
  23.             MessageBox.Show(
  24.                 "I am a managed app.\n\n" +
  25.                 "I am running inside: [" + System.Diagnostics.Process.GetCurrentProcess().ProcessName + "]\n\n" +
  26.                 (String.IsNullOrEmpty(pwzArgument) ? "I was not given an argument" : "I was given this argument: [" + pwzArgument + "]"));
  27.              
  28.             return 0;
  29.         }
  30.  
  31.         /// <summary>
  32.         /// Main method. Invoked when app is run standalone.
  33.         /// </summary>
  34.         /// <param name="args"></param>
  35.         static void Main(string[] args)
  36.         {
  37.             EntryPoint("hello world");
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement