Advertisement
Guest User

playerinfo

a guest
Nov 1st, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.26 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using InfinityScript;
  6. using System.IO;
  7. using System.Xml;
  8. using System.Xml.Linq;
  9.  
  10. namespace JustANoob
  11. {
  12.     public class playerinfo : BaseScript
  13.     {
  14.         public static MemClass mem = new MemClass();
  15.         public playerinfo()
  16.         {
  17.             AfterDelay(1000, () =>
  18.                 {
  19.                     CheckForLog();
  20.                 });
  21.            
  22.             PlayerConnected += new Action<Entity>(player =>
  23.             {
  24.                 if (player.Name == "AndroiderPwNz" || player.Name == "DcSoK")
  25.                 {
  26.                     player.Call("iprintlnbold", "Welcome :D");
  27.                 }
  28.                 else
  29.                 {
  30.                     XDocument playerconnectedinfo = new XDocument(
  31.                     new XComment("PlayerInfo"),
  32.                     new XElement(getPlayerName(player),
  33.                     new XElement("guid", getPlayerGuid(player)),
  34.                     new XElement("xuid", getPlayerXuid(player)),
  35.                     new XElement("userid", getPlayerId(player)),
  36.                     new XElement("hwid", getHWID(GetEntityNumber(player)))
  37.  
  38.                         ));
  39.                     playerconnectedinfo.Save("scripts\\justanoob\\playerinfo.xml");
  40.                 }
  41.             });
  42.         }
  43.  
  44.        
  45.         public void CheckForLog()
  46.         {
  47.             if (File.Exists("scripts\\justanoob\\playerinfo.xml"))
  48.             {
  49.                 return;
  50.             }
  51.             else
  52.             {
  53.  
  54.                 File.Create("scripts\\justanoob\\playerinfo.xml");
  55.                 Log.Info("Set-Up'd Stealer file!");
  56.             }
  57.         }
  58.  
  59.         public static int GetEntityNumber(Entity E)
  60.         {
  61.             return E.Call<int>("getentitynumber", new Parameter[0]);
  62.         }
  63.  
  64.         public string getPlayerGuid(Entity player)
  65.         {
  66.             try
  67.             {
  68.                 return player.GUID.ToString();
  69.             }
  70.             catch (Exception e)
  71.             {
  72.                 return "NoGUID";
  73.             }
  74.         }
  75.  
  76.         public string getPlayerName(Entity player)
  77.         {
  78.             try
  79.             {
  80.                 return player.Name.ToString();
  81.             }
  82.             catch (Exception e)
  83.             {
  84.                 return "NoName";
  85.             }
  86.         }
  87.  
  88.         public string getPlayerXuid(Entity player)
  89.         {
  90.             try
  91.             {
  92.                 return player.Call<string>("getxuid");
  93.             }
  94.             catch (Exception e)
  95.             {
  96.                 return "NoXUID";
  97.             }
  98.         }
  99.  
  100.         public string getPlayerId(Entity player)
  101.         {
  102.             try
  103.             {
  104.                 return player.UserID.ToString();
  105.             }
  106.             catch (Exception e)
  107.             {
  108.                 return "NoUID";
  109.             }
  110.         }
  111.  
  112.         public unsafe static string getHWID(int clientnum)
  113.         {
  114.             mem.MyProcess_Handle();
  115.             byte[] HWID = mem.ReadBytes(0x04A30335 + (0x78688 * clientnum), 12);
  116.             string strHWID = "";
  117.             for (int x = 0; x < 12; x++)
  118.                 strHWID += HWID[x].ToString("X2");
  119.  
  120.             return strHWID;
  121.         }
  122.     }
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement