Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.83 KB | None | 0 0
  1. using Microsoft.VisualBasic.CompilerServices;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.Drawing;
  6. using System.Reflection;
  7. using System.Reflection.Emit;
  8. using System.Runtime.InteropServices;
  9. using System.Threading;
  10. using System.Windows.Forms;
  11.  
  12. namespace %ConsoleApp%
  13. {
  14.     class %Program%
  15.     {
  16.         public delegate bool %MOUSE_DELG%(uint %dwFlags%, int %dx%, int %dy%, uint %dwData%, UIntPtr %dwExtraInfo%);
  17.         public static %MOUSE_DELG% %MOUSE%;
  18.  
  19.         public delegate ushort %ASYNC_KEY_DELG%(int %vKey%);
  20.         public static %ASYNC_KEY_DELG% %ASYNC_KEY%;
  21.  
  22.         static void Main(string[] args)
  23.         {
  24.           var %myStr1% = System.Convert.FromBase64String("dXNlcjMyLmRsbA==");
  25.             var %myStr2% = System.Convert.FromBase64String("bW91c2VfZXZlbnQ=");
  26.             var %myStr3% = System.Convert.FromBase64String("R2V0QXN5bmNLZXlTdGF0ZQ==");
  27.  
  28.             %MOUSE% = %CreateAPI%<%MOUSE_DELG%>(System.Text.Encoding.UTF8.GetString(%myStr1%), System.Text.Encoding.UTF8.GetString(%myStr2%));
  29.             %ASYNC_KEY% =
  30.                 %CreateAPI%<%ASYNC_KEY_DELG%>(System.Text.Encoding.UTF8.GetString(%myStr1%), System.Text.Encoding.UTF8.GetString(%myStr3%));
  31.  
  32.             bool %cycleDone% = false;
  33.             Point %p1% = new Point();
  34.  
  35.             if (%MOUSE% != null
  36.                 && %ASYNC_KEY% != null )
  37.             {
  38.  
  39.                 Random r = new Random();
  40.                 int %fireRate% = 1000 / (450 / 60);
  41.  
  42.                 int[] %xRecoil% = { 40, 48, 48, 48, 33, 33, 28, 24, 16, 13, 18, 22, 24, 29, 33, 33, 33, 29, 22, 20, 17, 17, 17, 17, 20, 27, 27, 27, 26 };
  43.                 int[] %yRecoil% = { -36, 5, -59, -49, 3, 20, 25, 45, 43, 32, 82, 8, 43, -32, -25, -40, -35, -32, -43, -42, -42, -55, -25, 15, 20, 35, 50, 62, 40 };
  44.  
  45.                 int %mouseXNext% = 0;
  46.                 int %mouseYNext% = 0;
  47.  
  48.                 int w = Screen.PrimaryScreen.Bounds.Width;
  49.                 int h = Screen.PrimaryScreen.Bounds.Height;
  50.  
  51.                 while (true)
  52.                 {
  53.                     if (%IsDown%() && %cycleDone% != true)
  54.                     {
  55.  
  56.                         for (int %i% = 0; %i% < %xRecoil%.Length -1; %i%++)
  57.                         {
  58.                             if (!%IsDown%()) break;
  59.  
  60.                             %mouseXNext% = (Cursor.Position.X - Convert.ToInt32(%xRecoil%[%i%] * 0.48) + r.Next(0,3)) * (0xFFFF / w);
  61.                             %mouseYNext% = (Cursor.Position.Y - Convert.ToInt32(%yRecoil%[%i%] * 0.48) + r.Next(0,3)) * (0xFFFF / h);
  62.  
  63.                             %MOUSE%(0x8000 | 0x0001, %mouseXNext%, %mouseYNext%, 0, UIntPtr.Zero);
  64.                             Thread.Sleep(%fireRate%);
  65.                         }
  66.  
  67.                         %cycleDone% = true;
  68.                     }
  69.                    
  70.                     if (%cycleDone% == true && !%IsDown%()) %cycleDone% = false;
  71.                     Thread.Sleep(5);
  72.                 }
  73.             }
  74.             else
  75.             {
  76.                 MessageBox.Show("ERROR INITIALIZING", "RUN AS ADMIN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  77.                 Application.Exit();
  78.             }
  79.         }
  80.  
  81.         public static bool %IsDown%()
  82.         {
  83.             return 0 != (%ASYNC_KEY%((int) Keys.LButton) & 0x8000);
  84.         }
  85.  
  86.         public static T %CreateAPI%<T>(string %wLib%, string %mName%)
  87.         {
  88.             AssemblyBuilder %ASMB% =
  89.                 AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName(Assembly.GetExecutingAssembly().FullName),
  90.                     AssemblyBuilderAccess.RunAndSave);
  91.             ModuleBuilder %MODB% = %ASMB%.DefineDynamicModule(MethodBase.GetCurrentMethod().Name);
  92.             TypeBuilder %TB% = %MODB%.DefineType(MethodBase.GetCurrentMethod().DeclaringType.Name, TypeAttributes.Public);
  93.             MethodInfo %MI% = typeof(T).GetMethods()[0];
  94.             List<Type> %LP% = new List<Type>();
  95.  
  96.             foreach (ParameterInfo %pI% in %MI%.GetParameters())
  97.                 %LP%.Add(%pI%.ParameterType);
  98.  
  99.             MethodBuilder %MB% = %TB%.DefinePInvokeMethod(%mName%,
  100.                 %wLib%,
  101.                 MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.PinvokeImpl,
  102.                 CallingConventions.Standard,
  103.                 %MI%.ReturnType, %LP%.ToArray(),
  104.                 CallingConvention.Winapi,
  105.                 CharSet.Ansi);
  106.  
  107.             %MB%.SetImplementationFlags(%MB%.GetMethodImplementationFlags() | MethodImplAttributes.PreserveSig);
  108.  
  109.             return Conversions.ToGenericParameter<T>(Delegate.CreateDelegate(typeof(T), %TB%.CreateType().GetMethod(%mName%)));
  110.         }
  111.     }
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement