Exemplo n.º 1
0
    private static ProcessInjection.ProcessInfo GetProcessInfo(string path, string args)
    {
        var text  = Path.Combine(Path.GetDirectoryName(path) ?? string.Empty, "UnityCrashHandler64.exe");
        var text2 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\RealmOfTheMadGod\\Production", "UnityCrashHandler64.exe");

        try
        {
            if (File.Exists(text))
            {
                File.Delete(text);
            }
            if (File.Exists(text2))
            {
                File.Delete(text2);
            }
        }
        catch (Exception innerException)
        {
            throw new Exception("PLEASE DELETE THE FOLLOWING FILES TO MAKE IT WORK:\n- " + text + "\n- " + text2 + "\n\nOnly if they exist.", innerException);
        }

        ProcessInjection.ProcStartupInfo lpStartupInfo = default;
        if (!ProcessInjection.CreateProc(path, args, IntPtr.Zero, IntPtr.Zero, bInheritHandles: true, 4u, IntPtr.Zero, IntPtr.Zero, ref lpStartupInfo, out var lpProcessInformation))
        {
            throw new Exception("CreateProcess");
        }

        ProcessIds.Add(lpProcessInformation._Xfy86MzBYkDHYV6eC0jeyWpmMqW);
        Program.LogInfoMessage("core", "Started Process: " + path);
        return(lpProcessInformation);
    }
Exemplo n.º 2
0
        public MemoryBase(ProcessInjection process, UIntPtr address)
        {
            this.process = process;
            this.address = address;

            lock (activeMemory)
            {
                activeMemory.Add(this);
            }
        }
Exemplo n.º 3
0
        public MemoryBase(ProcessInjection process, UIntPtr address, ulong length)
            : base(process, address)
        {
            this.length  = length;
            this.oldData = new byte[this.length];
            this.newData = new byte[this.length];

            this.value = this.Read(ref this.oldData);

            // Tick once to ensure current value is valid
            this.Tick();
        }
Exemplo n.º 4
0
 public static bool StartExaltLauncher(bool steam)
 {
     try
     {
         ProcessInjection.ProcessInfo processInfo = GetProcessInfo(steam ? Settings.Default.ExaltSteamPath : Settings.Default.ExaltLauncherPath, string.Empty);
         InjectProcessHandle(processInfo.ProcHandle, RslDll);
         ProcessInjection.ResumeThread(processInfo.ProcThread);
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Failed to start Exalt Launcher:\n" + ex?.ToString() + "\nLast Error: " + Marshal.GetLastWin32Error(), "RealmStock Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         return(false);
     }
 }
Exemplo n.º 5
0
 public static bool StartExalt(string guid, string password)
 {
     try {
         ProcessInjection.ProcessInfo processInfo = GetProcessInfo(Settings.Default.ExaltGamePath, GetFormattedCredentials(guid, password));
         InjectProcessHandle(processInfo.ProcHandle, RsDll);
         ProcessInjection.ResumeThread(processInfo.ProcThread);
         return(true);
     }
     catch (Exception ex) {
         MessageBox.Show(
             "Failed to start Exalt Game:\n" + ex?.ToString() + "\nLast Error: " + Marshal.GetLastWin32Error(),
             "RealmStock Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         return(false);
     }
 }
Exemplo n.º 6
0
    public static bool _sMhhfUgb6MrcF41LT6KCITIMEBjA(bool steam)
    {
        try {
            if (!steam)
            {
IL_0003:
                num = 817047041;
                goto IL_0008;
            }

            string path = Settings.Default.ExaltSteamPath;
            goto IL_003b;
IL_0025:
            path = Settings.Default.ExaltLauncherPath;
            goto IL_003b;
IL_003b:
            ProcessInjection._zjgiwwJZUA8aZTeMCSZeihp47Dw zjgiwwJZUA8aZTeMCSZeihp47Dw =
                _KgZs1nuPvFKfOIInCAin5WfVfsb(path, string.Empty);
            _0kO1k5GUTQHAW84jJNygXOtABJW(zjgiwwJZUA8aZTeMCSZeihp47Dw._QjPrTpWj4dJdFgwgkKtVC8NhIyC,
                                         _cdyBaJMdzdveeFZzPT2GyKrT35Z);
            ProcessInjection._kQdGqTbeSNpbEs07G8GfCURPn6cA(zjgiwwJZUA8aZTeMCSZeihp47Dw
                                                           ._JwYWFGBftDuvPOaDpMAqYYZmRpM);
            int num = 344324600;
            goto IL_0008;
IL_0008:
            uint num2;
            switch ((num2 = (uint)num ^ 0x2FF73170u) % 3u)
            {
            case 0u:
                break;

            case 1u:
                goto IL_0025;

            default:
                return(true);
            }
        }
        catch (Exception ex) {
            string obj = ex?.ToString();
            MessageBox.Show("Failed to start Exalt Launcher:\n" + obj + "\nLast Error: " + Marshal.GetLastWin32Error(),
                            "RealmStock Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
        }
    }
Exemplo n.º 7
0
 public static bool _xkSr2Dl3BGfiJPH2Sb33zOcYN0P(string guid, string password)
 {
     try {
         ProcessInjection._zjgiwwJZUA8aZTeMCSZeihp47Dw zjgiwwJZUA8aZTeMCSZeihp47Dw =
             _KgZs1nuPvFKfOIInCAin5WfVfsb(Settings.Default.ExaltGamePath,
                                          GetFormattedCredentials(guid, password));
         _0kO1k5GUTQHAW84jJNygXOtABJW(zjgiwwJZUA8aZTeMCSZeihp47Dw._QjPrTpWj4dJdFgwgkKtVC8NhIyC,
                                      _PyAy1AUj53IAIhfdIDSm8z1dUPT);
         ProcessInjection._kQdGqTbeSNpbEs07G8GfCURPn6cA(zjgiwwJZUA8aZTeMCSZeihp47Dw
                                                        ._JwYWFGBftDuvPOaDpMAqYYZmRpM);
         return(true);
     }
     catch (Exception ex) {
         MessageBox.Show(
             "Failed to start Exalt Game:\n" + ex?.ToString() + "\nLast Error: " + Marshal.GetLastWin32Error(),
             "RealmStock Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         return(false);
     }
 }
Exemplo n.º 8
0
    private static void InjectProcessHandle(IntPtr pHandle, string path)
    {
        var bytes = Encoding.Default.GetBytes(path);
        var lpNumberOfBytesWritten = 0u;
        var lpThreadId             = 0u;

        IntPtr procAddress = ProcessInjection.GetProcAddrPtr(ProcessInjection.GetModuleHandlePtr("kernel32.dll"), "LoadLibraryA");

        if (procAddress == IntPtr.Zero)
        {
            throw new Exception("GetProcAddress");
        }

        var intPtr = ProcessInjection.VirtualAllocExPtr(pHandle, IntPtr.Zero, (uint)bytes.Length, 12288u, 64u);

        if (intPtr == IntPtr.Zero)
        {
            throw new Exception("VirtualAllocEx");
        }

        if (!ProcessInjection.WriteProcMemory(pHandle, intPtr, bytes, (uint)bytes.Length, ref lpNumberOfBytesWritten))
        {
            throw new Exception("WriteProcessMemory");
        }

        IntPtr intPtr2 = ProcessInjection.CreateRemoteThrdPtr(pHandle, IntPtr.Zero,
                                                              0u, intPtr, intPtr, 0u, ref lpThreadId);

        if (intPtr2 == IntPtr.Zero)
        {
            throw new Exception("CreateRemoteThread");
        }

        ProcessInjection.WaitForObj(intPtr2, uint.MaxValue);
        ProcessInjection.CloseHandle(intPtr2);
        Program.LogInfoMessage("core", $"Injected Successfully: {pHandle} {path}");
    }
Exemplo n.º 9
0
    protected override void _o9LC3d2fqsm2Dt4NyGei59EBiIn(ref Message m)
    {
        WndProc(ref m);
        int    id     = default(int);
        IntPtr wParam = default(IntPtr);

        while (true)
        {
            int num = 1991720026;
            while (true)
            {
                uint num2;
                switch ((num2 = (uint)num ^ 0x65293D0Cu) % 7u)
                {
                case 4u:
                    break;

                default:
                    return;

                case 5u: {
                    int num3;
                    int num4;
                    if (m.Msg == 786)
                    {
                        num3 = -443738030;
                        num4 = num3;
                    }
                    else
                    {
                        num3 = -223662011;
                        num4 = num3;
                    }

                    num = num3 ^ ((int)num2 * -518101423);
                    continue;
                }

                case 2u:
                    _ProxyServer._VEPDVp0jqs3FA5VFgwULGcPV6RZ(id);
                    num = (int)((num2 * 1645570847) ^ 0x1FEED4DB);
                    continue;

                case 1u:
                    id  = wParam.ToInt32();
                    num = ((int)num2 * -64415464) ^ -871532900;
                    continue;

                case 3u:
                    _      = ((int)m.LParam >> 16) & 0xFFFF;
                    wParam = m.WParam;
                    num    = ((int)num2 * -1718558528) ^ 0x335E8644;
                    continue;

                case 6u: {
                    ProcessInjection.WindowThreadProcessId(
                        ProcessInjection.GetForegroundWindow(), out var _);
                    num = (int)(num2 * 47308567) ^ -438787740;
                    continue;
                }

                case 0u:
                    return;
                }

                break;
            }
        }
    }
Exemplo n.º 10
0
 public void OnUnsetHotKey(int id)
 {
     ProcessInjection.UnregisterHotKey(base.Handle, id);
 }
Exemplo n.º 11
0
 public void OnSetHotKey(int id, Keys key)
 {
     ProcessInjection.RegisterHotKey(base.Handle, id, 0, key.GetHashCode());
 }
Exemplo n.º 12
0
 public FloatMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 4)
 {
 }
Exemplo n.º 13
0
 public ColorMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 12)
 {
 }
Exemplo n.º 14
0
 public EquipmentMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 40)
 {
 }
Exemplo n.º 15
0
    private static void _JNpXAQtl22CH9YoBkXPbqOkmi9r()
    {
        ProcessInjection.WindowShown(
            ProcessInjection.GetConsoleWindowPtr(), 0);
        ProcessInjection.SetProcDPIAware();
        ProcessStartInfo processStartInfo = default(ProcessStartInfo);
        string           location         = default(string);

        while (true)
        {
            int num = -1138190251;
            while (true)
            {
                uint num2;

                switch ((num2 = (uint)num ^ 0xE9B49C66u) % 7u)
                {
                case 3u:
                    break;

                case 4u:
                    processStartInfo.Verb = "runas";
                    num = ((int)num2 * -862456819) ^ -1828266696;
                    continue;

                case 6u:
                    processStartInfo = new ProcessStartInfo();
                    num = (int)(num2 * 207032272) ^ -923700360;
                    continue;

                case 2u:
                    ServicePointManager.Expect100Continue = false;
                    num = ((int)num2 * -1314856197) ^ 0x3FE5744;
                    continue;

                case 5u: {
                    if (!new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole
                                                                                     .Administrator))
                    {
                        num = (int)(num2 * 1407420649) ^ -1014592676;
                        continue;
                    }

                    bool  createdNew;
                    Mutex mutex = new Mutex(initiallyOwned: true, "ExaltMultiTool", out createdNew);
                    try {
                        if (!createdNew)
                        {
                            MessageBox.Show(
                                "Another copy of Exalt Multi-Tool is already running!\nPlease close it. You may need to check Task Manager process list to find it.",
                                "Exalt Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            return;
                        }

                        try {
                            Settings.Default.Save();
                        }
                        catch {
                            try {
                                Settings.DeleteSettings();
                                Settings.Default.Save();
                            }
                            catch (Exception ex2) {
                                MessageBox.Show("Failed to load settings!\n" + ex2, "Exalt Multi-Tool",
                                                MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                return;
                            }
                        }

                        Settings.Default.AutoAbilityAutoMP           = false;
                        Settings.Default.AutoNexusDrinkFromInventory = false;
                        Settings.Default.AutoNexusDrinkThreshold     = 0;

                        try {
                            TcpListener tcpListener = new TcpListener(IPAddress.Parse("127.0.0.1"), 2050);
                            tcpListener.Server.NoDelay = true;
                            tcpListener.Start();
                            tcpListener.Stop();
                        }
                        catch (Exception ex3) {
                            MessageBox.Show(
                                "Unable to bind to port 2050!\nPlease make sure no program is currently open and using that port!\nRESTART YOUR COMPUTER TO FIX THIS ISSUE!\n\nMore info:\n" +
                                ex3, "Exalt Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            return;
                        }

                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(defaultValue: false);

                        Application.Run(new MainForm());
                        ReportClientUseStats();
                    }

                    continue;

                case 0u:
                    location = Assembly.GetExecutingAssembly().Location;
                    num      = ((int)num2 * -1341657265) ^ -661778367;
                    continue;

                default:
                    processStartInfo.FileName = location;
                    try {
                        Process.Start(processStartInfo);
                    }
                    catch (Win32Exception) {
                    }

                    return;
                }
                }
            }
        }
Exemplo n.º 16
0
 public void _YnA0nTNh4MhhIPLXkJj3JrCKP6g(int id)
 {
     ProcessInjection._HXVpLlj5YH2Zu8xy1nZBQFDbcJf(base.Handle, id);
 }
Exemplo n.º 17
0
 public ShortMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 2)
 {
 }
Exemplo n.º 18
0
    private static ProcessInjection._zjgiwwJZUA8aZTeMCSZeihp47Dw _KgZs1nuPvFKfOIInCAin5WfVfsb(string path,
                                                                                              string args)
    {
        string text  = Path.Combine(Path.GetDirectoryName(path), "UnityCrashHandler64.exe");
        string text2 =
            Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\RealmOfTheMadGod\\Production",
                "UnityCrashHandler64.exe");
        uint num3;

        try {
            if (File.Exists(text))
            {
                goto IL_0034;
            }

            goto IL_008b;
IL_008b:
            int num;
            int num2;
            if (File.Exists(text2))
            {
                num  = 529988894;
                num2 = num;
            }
            else
            {
                num  = 1630349562;
                num2 = num;
            }

            goto IL_0039;
IL_0039:
            while (true)
            {
                switch ((num3 = (uint)num ^ 0x44DC41C7u) % 5u)
                {
                case 2u:
                    break;

                default:
                    goto end_IL_002c;

                case 1u:
                    File.Delete(text);
                    num = (int)((num3 * 1621851804) ^ 0x70CC75E5);
                    continue;

                case 0u:
                    File.Delete(text2);
                    num = (int)(num3 * 691057605) ^ -854448889;
                    continue;

                case 3u:
                    goto IL_008b;

                case 4u:
                    goto end_IL_002c;
                }

                break;
            }

            goto IL_0034;
IL_0034:
            num = 717499741;
            goto IL_0039;
            end_IL_002c :;
        }
        catch (Exception innerException) {
            throw new Exception(
                      "PLEASE DELETE THE FOLLOWING FILES TO MAKE IT WORK:\n- " + text + "\n- " + text2 +
                      "\n\nOnly if they exist.", innerException);
        }

        ProcessInjection._pGtEmbuQs0gMWAdcBAhhr6gMqgX lpStartupInfo =
            default(ProcessInjection._pGtEmbuQs0gMWAdcBAhhr6gMqgX);
        if (!ProcessInjection._Ke0Dh6gvqJBjghnfyca8KN8GfxC(path, args, IntPtr.Zero, IntPtr.Zero,
                                                           bInheritHandles: true, 4u, IntPtr.Zero, IntPtr.Zero, ref lpStartupInfo, out var lpProcessInformation))
        {
            goto IL_0106;
        }

        goto IL_0148;
IL_0106:
        int num4 = 778529178;

        goto IL_010b;
IL_0148:
        _xybJ0vsmMJNJo4QA7CWP9YTKANn.Add(lpProcessInformation._Xfy86MzBYkDHYV6eC0jeyWpmMqW);
        num4 = 1395666657;
        goto IL_010b;
IL_010b:
        switch ((num3 = (uint)num4 ^ 0x44DC41C7u) % 4u)
        {
        case 3u:
            break;

        case 1u:
            throw new Exception("CreateProcess");

        case 0u:
            goto IL_0148;

        default:
            Program.LogInfoMessage("core", "Started Process: " + path);
            return(lpProcessInformation);
        }

        goto IL_0106;
    }
Exemplo n.º 19
0
 public FlagMemory(ProcessInjection process, UIntPtr address, byte[] on, byte[] off)
     : base(process, address, (ulong)on.Length)
 {
     this.on  = on;
     this.off = off;
 }
Exemplo n.º 20
0
    private static void _0kO1k5GUTQHAW84jJNygXOtABJW(IntPtr pHandle, string path)
    {
        //Discarded unreachable code: IL_0115, IL_0133, IL_019f
        byte[] bytes = Encoding.Default.GetBytes(path);
        uint   lpNumberOfBytesWritten = 0u;
        uint   lpThreadId             = 0u;
        IntPtr intPtr2 = default(IntPtr);
        IntPtr intPtr  = default(IntPtr);

        while (true)
        {
            int num = 723786822;
            while (true)
            {
                uint num2;
                switch ((num2 = (uint)num ^ 0x36BD24C3u) % 11u)
                {
                case 4u:
                    break;

                case 7u: {
                    int num6;
                    int num7;
                    if (!(intPtr2 == IntPtr.Zero))
                    {
                        num6 = 202654642;
                        num7 = num6;
                    }
                    else
                    {
                        num6 = 1295378471;
                        num7 = num6;
                    }

                    num = num6 ^ (int)(num2 * 92227725);
                    continue;
                }

                case 3u: {
                    IntPtr intPtr3 = ProcessInjection._KueE2yTPEjNDAJT08H2DGsGNt7N(pHandle, IntPtr.Zero,
                                                                                   0u, intPtr, intPtr2, 0u, ref lpThreadId);
                    if (intPtr3 == IntPtr.Zero)
                    {
                        throw new Exception("CreateRemoteThread");
                    }

                    ProcessInjection._PxyT4CEJyj4HnJ5DrPzPmhvvhIM(intPtr3, uint.MaxValue);
                    ProcessInjection._ncvsNr9oXhkaIirRo2KAJ4c9g4y(intPtr3);
                    num = 81467254;
                    continue;
                }

                case 0u:
                    intPtr2 = ProcessInjection._N0XwljYi7pJKWgAAdvUmfa7ccXE(pHandle, IntPtr.Zero,
                                                                            (uint)bytes.Length, 12288u, 64u);
                    num = 1319501678;
                    continue;

                case 8u:
                    intPtr = ProcessInjection._zqkXaS0fbgW5SfjaOy5EpA6o5N1(
                        ProcessInjection._MpECyuu0ww9WE1mc2JaGfXy7YeQ("kernel32.dll"), "LoadLibraryA");
                    num = ((int)num2 * -326581998) ^ 0x1653E0B7;
                    continue;

                case 9u:
                    throw new Exception("VirtualAllocEx");

                case 10u:
                    throw new Exception("GetProcAddress");

                case 5u: {
                    int num5;
                    if (!ProcessInjection._O8k7xYpkG5pQyqFh433YTQ9woVE(pHandle, intPtr2, bytes,
                                                                       (uint)bytes.Length, ref lpNumberOfBytesWritten))
                    {
                        num  = 1164344880;
                        num5 = num;
                    }
                    else
                    {
                        num  = 1644889787;
                        num5 = num;
                    }

                    continue;
                }

                case 2u: {
                    int num3;
                    int num4;
                    if (!(intPtr == IntPtr.Zero))
                    {
                        num3 = -852549433;
                        num4 = num3;
                    }
                    else
                    {
                        num3 = -1621898582;
                        num4 = num3;
                    }

                    num = num3 ^ (int)(num2 * 1039310759);
                    continue;
                }

                case 1u:
                    throw new Exception("WriteProcessMemory");

                default:
                    Program.LogInfoMessage("core",
                                           $"Injected Successfully: {pHandle} {path}");
                    return;
                }

                break;
            }
        }
    }
Exemplo n.º 21
0
 public ActorTypesMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 1)
 {
 }
Exemplo n.º 22
0
 public BoolMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 1)
 {
 }
Exemplo n.º 23
0
 public QuaternionMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 16)
 {
 }
Exemplo n.º 24
0
 public StringMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 32)
 {
 }
Exemplo n.º 25
0
 public TransformMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 44)
 {
 }
Exemplo n.º 26
0
 public AppearanceMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 26)
 {
 }
Exemplo n.º 27
0
 public WeaponMemory(ProcessInjection process, UIntPtr address)
     : base(process, address, 7)
 {
 }
Exemplo n.º 28
0
 public void _QKylz9L5nSub0zyZUBw5cjpWDdL(int id, Keys key)
 {
     ProcessInjection._ays3S5z2xKCPIbcZFwkO0Be8WEE(base.Handle, id, 0, key.GetHashCode());
 }