Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using iHook;
- namespace Relogger
- {
- class Program
- {
- public static uint Direct3D9__Device = 0x98BCDC;
- public static uint Direct3D9__Device__OffsetA = 0x27C4;
- public static uint Direct3D9__Device__OffsetB = 0xA8;
- public static uint ClntObjMgrGetActivePlayerObjAddress = 0x3520;
- public static uint Lua_DoStringAddress = 0x3A2620;
- public static uint Lua_GetLocalizedTextAddress = 0x1C2250;
- public static string username = "@gmail.com";
- public static string password = "pw";
- public static string accname = "acct"; // has to be caps?
- public static string name = "charname"; // has to have first capital letter
- public static string realm = "realm"; // has to have first capital letter
- public static string hbuser = "test";
- public static string hbpass = "test";
- bool HBRunning = false;
- bool WoWRunning = false;
- Process[] processes;
- Process honorbuddy;
- Process wow;
- bool reloggerrunning = false;
- static void Main(string[] args)
- {
- Console.WriteLine("Ghetto Relogger!");
- Program relogger = new Program();
- relogger.reloggerrunning = true;
- while (relogger.reloggerrunning)
- {
- if (!relogger.CheckRunningWoW() || !relogger.CheckRunningHB())
- {
- try
- {
- relogger.wow.Kill();
- relogger.wow = null;
- relogger.honorbuddy.Kill();
- relogger.honorbuddy = null;
- }
- catch { }
- relogger.StartAll();
- }
- }
- }
- internal static uint GetEndscene()
- {
- uint D3D9_Device;
- D3D9_Device = Memory.Read<uint>(Memory.BaseAddress + Direct3D9__Device);
- D3D9_Device = Memory.Read<uint>(D3D9_Device + Direct3D9__Device__OffsetA);
- D3D9_Device = Memory.Read<uint>(D3D9_Device);
- D3D9_Device = Memory.Read<uint>(D3D9_Device + Direct3D9__Device__OffsetB);
- return D3D9_Device;
- }
- void StartAll()
- {
- StartWoW(10000);
- HookWoW();
- System.Threading.Thread.Sleep(1000);
- LoginWoW();
- StartHB(10000);
- }
- bool CheckRunningWoW()
- {
- if (wow != null)
- if (wow.Responding)
- return true;
- else
- return false;
- else
- return false;
- }
- bool CheckRunningHB()
- {
- if (honorbuddy != null)
- if (honorbuddy.Responding)
- return true;
- else
- return false;
- else
- return false;
- }
- void StartWoW(int sleepTime)
- {
- Console.WriteLine("Starting WoW and delaying for " + sleepTime/1000 + " seconds");
- wow = new Process();
- wow.StartInfo.FileName = "C:\\Program Files (x86)\\World of Warcraft\\wow.exe";
- wow.Start();
- WoWRunning = true;
- System.Threading.Thread.Sleep(sleepTime);
- }
- void StartHB(int sleepTime) // start HB after sleepTime in ms
- {
- Console.WriteLine("Starting HB in " + sleepTime/1000 + " seconds");
- System.Threading.Thread.Sleep(sleepTime);
- honorbuddy = new Process();
- honorbuddy.StartInfo.FileName = "C:\\Users\\Scott\\Desktop\\Honorbuddy_2.0.0.4129\\Honorbuddy.exe";
- honorbuddy.StartInfo.Arguments = "/autostart /pid=" + wow.Id + " /hbuser=" + hbuser + " /hbpass=" + hbpass;
- honorbuddy.Start();
- HBRunning = true;
- }
- void LoginWoW()
- {
- Hook.DoString(login);
- System.Threading.Thread.Sleep(5000);
- Hook.DoString(login);
- System.Threading.Thread.Sleep(5000);
- Hook.DoString(login);
- System.Threading.Thread.Sleep(5000);
- Hook.DoString(login);
- }
- void HookWoW()
- { /*
- Console.WriteLine("Finding WoW");
- processes = Process.GetProcessesByName("Wow");
- if (processes.Length < 0)
- {
- Console.WriteLine("WoW not found.");
- Console.ReadLine();
- }
- else
- {
- Console.WriteLine("WoW process: " + wow.Id + " found!");
- */
- Console.WriteLine("Attaching...");
- if (Memory.OpenProcess(wow.Id))
- {
- Hook.Apply(GetEndscene(), ClntObjMgrGetActivePlayerObjAddress, Lua_DoStringAddress, Lua_GetLocalizedTextAddress);
- }
- //}
- }
- string login = "if (WoWAccountSelectDialog and WoWAccountSelectDialog:IsShown()) then " +
- "for i = 0, GetNumGameAccounts() do " +
- "if GetGameAccountInfo(i) == '" + accname + "' then " +
- "WoWAccountSelect_SelectAccount(i) " +
- "end " +
- "end " +
- "elseif (AccountLoginUI and AccountLoginUI:IsVisible()) then " +
- "DefaultServerLogin('" + username + "', '" + password + "') " +
- "AccountLoginUI:Hide() " +
- "elseif (RealmList and RealmList:IsVisible()) then " +
- "for i = 1, select('#',GetRealmCategories()) do " +
- "for j = 1, GetNumRealms(i) do " +
- "if GetRealmInfo(i, j) == '" + realm + "' then " +
- "RealmList:Hide() " +
- "ChangeRealm(i, j) " +
- "end " +
- "end " +
- "end " +
- "elseif (CharacterSelectUI and CharacterSelectUI:IsVisible()) then " +
- "if GetServerName() ~= '" + realm + "' and (not RealmList or not RealmList:IsVisible()) then " +
- "RequestRealmList(1) " +
- "else " +
- "for i = 0,GetNumCharacters() do " +
- "if (GetCharacterInfo(i) == '" + name + "') then " +
- "CharacterSelect_SelectCharacter(i) " +
- "EnterWorld() " +
- "end " +
- "end " +
- "end " +
- "end ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement