Example #1
0
        // 初始化hook
        public static void init(MCCSAPI api)
        {
            mcapi = api;
            // 初始化RVA,或可远程获取
            ArrayList al = new ArrayList();

            al.Add(0x00B9D4C0);
            al.Add(0x00429850);
            al.Add(0x004ECFD0);
            RVAs["1.16.1.2"] = al;
            try {
                ArrayList rval = null;
                if (RVAs.TryGetValue(api.VERSION, out rval))
                {
                    if (rval != null && rval.Count > 0)
                    {
                        IntPtr tmpCrtorg = IntPtr.Zero;
                        api.cshook((int)rval[0],                                // IDA ServerScoreboard::onPlayerJoined
                                   Marshal.GetFunctionPointerForDelegate(cs_crthookptr), out tmpCrtorg);
                        _CS_ONCREATEPLAYER_org = tmpCrtorg;

                        tmpCrtorg = IntPtr.Zero;
                        api.cshook((int)rval[1],                                // IDA CommandRegistry::registerCommand
                                   Marshal.GetFunctionPointerForDelegate(cs_reghookptr), out tmpCrtorg);
                        _CS_REGISTERCOMMAND_org = tmpCrtorg;
                    }
                }
            } catch (Exception e) {
                Console.WriteLine(e.StackTrace);
            }
        }
Example #2
0
        public static void init(MCCSAPI api)
        {
            mapi = api;
            // 初始化RVA,或可远程获取
            var a1 = new ArrayList(new int[] { 0x00A7F9C0, 0x004CD7D0, 0x0042D250 });

            RVAs["1.16.20.3"] = a1;
            try {
                ArrayList rval = null;
                if (RVAs.TryGetValue(api.VERSION, out rval))
                {
                    if (rval != null && rval.Count > 0)
                    {
                        bool ret = api.cshook((int)rval[1],                             // IDA MinecraftServerScriptEngine::onServerThreadStarted
                                              Marshal.GetFunctionPointerForDelegate(jsonpen), out jsorg);
                        ret = ret && api.cshook((int)rval[2],                           // IDA CommandRegistry::registerCommand
                                                Marshal.GetFunctionPointerForDelegate(cmdnocheat), out cregorg);
                        if (ret)
                        {
                            Console.WriteLine("[UnlockScripting] Addons脚本引擎+作弊指令已强开。");
                        }
                    }
                }
            } catch (Exception e) {
                Console.WriteLine(e.StackTrace);
            }
        }
Example #3
0
        // 强开实验玩法,早期版本(已过时)
        private static void explayHook()
        {
            ArrayList l;

            if (RVAs.TryGetValue(mapi.VERSION, out l))
            {
                if (l != null && l.Count > 0)
                {
                    mapi.cshook((int)l[0],              // IDA Level::hasExperimentalGameplayEnabled
                                Marshal.GetFunctionPointerForDelegate(explay), out exorg);
                }
            }
        }
Example #4
0
        // 初始化hook
        public static void init(MCCSAPI api)
        {
            mcapi = api;
            // 改写原始代码数据
            if (api.VERSION == "1.16.100.4")
            {
                byte[] jmp_expplaycheck = { 0xeb, 0x07, 0xF6, 0x00, 0x04, 0xeb, 0x00, 0xeb, 0x00 };                             // IDA jmp short + 7
                if (api.writeHardMemory(0x0AC36F9, jmp_expplaycheck, 9))
                {
                    Console.WriteLine("[C# hack] JS 引擎实验性验证已跳过。");
                }
                else
                {
                    Console.WriteLine("[C# hack] Some hardcode err excption.");
                }
            }
            // 初始化RVA,或可远程获取
            ArrayList al = new ArrayList(new int[] { 0x00B9D4C0, 0x00429850, 0x004ECFD0 });

            RVAs["1.16.1.2"] = al;
            ArrayList a2 = new ArrayList(new int[] { 0x00B9D100, 0x00429820, 0x004ECFA0 });

            RVAs["1.16.10.2"] = a2;
            ArrayList a3 = new ArrayList(new int[] { 0x00BA3560, 0x0042D250, 0x004F0920 });

            RVAs["1.16.20.3"] = a3;
            ArrayList a4 = new ArrayList(new int[] { 0x00BA1200, 0x0042D260, 0x004F0930 });

            RVAs["1.16.40.2"] = a4;
            try
            {
                ArrayList rval = null;
                if (RVAs.TryGetValue(api.VERSION, out rval))
                {
                    if (rval != null && rval.Count > 0)
                    {
                        IntPtr tmpCrtorg = IntPtr.Zero;
                        api.cshook((int)rval[0],                                // IDA ServerScoreboard::onPlayerJoined
                                   Marshal.GetFunctionPointerForDelegate(cs_crthookptr), out tmpCrtorg);
                        _CS_ONCREATEPLAYER_org = tmpCrtorg;

                        tmpCrtorg = IntPtr.Zero;
                        api.cshook((int)rval[1],                                // IDA CommandRegistry::registerCommand
                                   Marshal.GetFunctionPointerForDelegate(cs_reghookptr), out tmpCrtorg);
                        _CS_REGISTERCOMMAND_org = tmpCrtorg;
                    }
                }
            } catch (Exception e) {
                Console.WriteLine(e.StackTrace);
            }
        }
Example #5
0
        // 注册hook
        public static void init(MCCSAPI api)
        {
            int rva = 0;

            switch (api.VERSION)                // 版本适配
            {
            case "1.16.1.2":
                rva = 0x00429850;
                break;

            case "1.16.10.2":
                rva = 0x00429820;
                break;

            case "1.16.20.3":
                rva = 0x0042D250;
                break;

            case "1.16.40.2":
                rva = 0x0042D260;
                break;
            }
            if (rva != 0)
            {
                bool ret = api.cshook(rva,                      // IDA CommandRegistry::registerCommand
                                      Marshal.GetFunctionPointerForDelegate(cs_reghookptr),
                                      out _CS_REGISTERCOMMAND_org);
                if (ret)
                {
                    Console.WriteLine("作弊指令已解锁。");
                }
            }
        }
Example #6
0
        // 注册hook
        public static void init(MCCSAPI api, int seed)
        {
            fakeseed = seed;
            int rva = 0;

            switch (api.VERSION)                // 版本适配
            {
            case "1.16.1.2":
                rva = 0x00380010;
                break;

            case "1.16.10.2":
                rva = 0x0037FFE0;
                break;

            case "1.16.20.3":
                rva = 0x00386260;
                break;

            case "1.16.40.2":
                rva = 0x00386270;
                break;
            }
            if (rva != 0)
            {
                bool ret = api.cshook(rva,                      // IDA StartGamePacket::write
                                      Marshal.GetFunctionPointerForDelegate(hide),
                                      out hideorg);
                if (ret)
                {
                    Console.WriteLine("[HideSeed] 种子已隐藏。");
                }
            }
        }
Example #7
0
        // 注册hook
        public static bool init(MCCSAPI api, int seed)
        {
            bool ret = false;

            fakeseed = seed;
            int rva = 0;

            switch (api.VERSION)
            {               // 版本适配
            case "1.16.1.2":
                rva = 0x00380010;
                break;

            case "1.16.10.2":
                rva = 0x0037FFE0;
                break;

            case "1.16.20.3":
                rva = 0x00386260;
                break;

            case "1.16.40.2":
                rva = 0x00386270;
                break;

            case "1.16.100.4":
            case "1.16.101.1":
                rva = 0x00972F80;
                break;

            case "1.16.201.3":
                rva = 0x00B61DF0;
                break;

            default:
                Console.WriteLine("[ILUAR] Hook[changeSeed]未适配此版本。");
                break;
            }
            if (rva != 0)
            {
                ret = api.cshook(rva,                  // IDA write@StartGamePacket@@UEBAXAEAVBinaryStream@@@Z
                                 Marshal.GetFunctionPointerForDelegate(hide),
                                 out hideorg);

                //Console.WriteLine(Marshal.PtrToStringAnsi(api.dlsym(0x01F68C80)));
            }
            return(ret);
        }
        public static void init(MCCSAPI api)
        {
            mapi = api;

            rva_bedlogs["1.16.220.02"] = 0x01051430;                    // IDA BedrockLog::log
            rva_bedlogs["1.16.221.01"] = 0x01051590;
            rva_bedlogs["1.17.0.03"]   = 0x0134F520;
            rva_bedlogs["1.17.2.01"]   = 0x0134EFF0;
            rva_bedlogs["1.17.10.04"]  = 0x0137BF70;
            rva_docalls["1.16.220.02"] = 0xD50380;                      // IDA "Running AutoCompaction..."
            rva_docalls["1.16.221.01"] = 0xD50510;
            rva_docalls["1.17.2.01"]   = 0xFC19D0;
            rva_docalls["1.17.10.04"]  = 0xFAE630;
            int rva = (int)rva_docalls[api.VERSION];

            if (rva != 0)
            {
                if (api.cshook(rva, Marshal.GetFunctionPointerForDelegate(hook_task_do_call), out f_do_call))
                {
                    Console.WriteLine("[NoAutoCompactionTip] 隐藏AutoCompaction提示已加载。适配版本:" + api.VERSION);
                }
            }
        }
Example #9
0
        public static void init(MCCSAPI api)
        {
            mapi = api;
            // 高版本,函数被优化,使用汇编机器码方式直接改写源程序机器码
            switch (api.VERSION)
            {
            case "1.16.100.4":
            case "1.16.101.1":
            {
                //byte[] orgdata = {0xF6, 0x00, 0x04, 0x0F, 0x84, 0x47, 0x01, 0x00, 0x00};	// IDA test XX, jz XX
                //byte[] loaded = api.readHardMemory(0x0AC36F9, 9);
                //if (string.Compare(Convert.ToBase64String(orgdata), Convert.ToBase64String(loaded)) == 0) {
                //	// 特征码测试通过
                //	Console.WriteLine("explay check readHardMemory OK");
                //}
                byte[] jmp_explaycheckcode = { 0xeb, 0x07, 0, 0, 0, 0, 0, 0, 0 };                                       // IDA jmp short + 7, hex data
                if (api.writeHardMemory(0x0AC36F9, jmp_explaycheckcode, 9))                                             // IDA MinecraftServerScriptEngine::onServerThreadStarted + 0x69
                // JS 引擎对实验性玩法的验证通过汇编码跳过
                {
                    const int symregcmd = 0x00A1E8E0;                                           // IDA CommandRegistry::registerCommand
                    nocheat(symregcmd);
                }
            }
            break;

            case "1.16.200.2":
            case "1.16.201.2":
            case "1.16.201.3":
            {
                byte[] jmp_explaycheckcode = { 0xeb, 0x07, 0, 0, 0, 0, 0, 0, 0 };
                if (api.writeHardMemory(0x0CB1379, jmp_explaycheckcode, 9))
                {
                    const int symregcmd = 0x00C0D650;
                    nocheat(symregcmd);
                }
            }
            break;

            case "1.16.210.05":
            case "1.16.210.06":
            case "1.16.220.02":
            case "1.16.221.01":
            case "1.17.0.03":
            case "1.17.1.01":
            case "1.17.2.01":
            case "1.17.10.04":
            {
                Hashtable rva_sestart = new Hashtable();
                rva_sestart["1.16.210.05"] = 0x0B325C1;
                rva_sestart["1.16.210.06"] = 0x00B21710 + 0x61;
                rva_sestart["1.16.220.02"] = 0x00BF6090 + 0x61;
                rva_sestart["1.16.221.01"] = 0x00BF6220 + 0x61;
                rva_sestart["1.17.0.03"]   = 0x00E59380 + 0x61;
                rva_sestart["1.17.1.01"]   = 0x00E58E20 + 0x61;
                rva_sestart["1.17.2.01"]   = 0x00E58E60 + 0x61;
                rva_sestart["1.17.10.04"]  = 0x00E4A030 + 0x61;
                Hashtable rva_regcmd = new Hashtable();
                rva_regcmd["1.16.210.05"] = 0x00612040;
                rva_regcmd["1.16.210.06"] = 0x006112B0;
                rva_regcmd["1.16.220.02"] = 0x00683AC0;
                rva_regcmd["1.16.221.01"] = 0x00683A90;
                rva_regcmd["1.17.0.03"]   = 0x0075F9F0;
                rva_regcmd["1.17.1.01"]   = 0x0075F610;
                rva_regcmd["1.17.2.01"]   = 0x0075F620;
                rva_regcmd["1.17.10.04"]  = 0x00793530;
                byte[] jmp_explaycheckcode = { 0xeb, 0x06, 0, 0, 0, 0, 0, 0 };
                if (api.writeHardMemory((int)rva_sestart[api.VERSION], jmp_explaycheckcode, 8))
                {
                    int symregcmd = (int)rva_regcmd[api.VERSION];
                    nocheat(symregcmd);
                }
            }
            break;
            }

            // 初始化RVA,或可远程获取,早期版本
            var a1 = new ArrayList(new int[] { 0x00A7F9C0, 0x004CD7D0, 0x0042D250 });

            RVAs["1.16.20.3"] = a1;
            var a2 = new ArrayList(new int[] { 0x00A7D660, 0x004CD7E0, 0x0042D260 });

            RVAs["1.16.40.2"] = a2;
            try {
                ArrayList rval = null;
                if (RVAs.TryGetValue(api.VERSION, out rval))
                {
                    if (rval != null && rval.Count > 0)
                    {
                        bool ret = api.cshook((int)rval[1],                             // IDA MinecraftServerScriptEngine::onServerThreadStarted
                                              Marshal.GetFunctionPointerForDelegate(jsonpen), out jsorg);
                        ret = ret && api.cshook((int)rval[2],                           // IDA CommandRegistry::registerCommand
                                                Marshal.GetFunctionPointerForDelegate(cmdnocheat), out cregorg);
                        if (ret)
                        {
                            Console.WriteLine("[UnlockScripting] Addons脚本引擎+作弊指令已强开。");
                        }
                    }
                }
            } catch (Exception e) {
                Console.WriteLine(e.StackTrace);
            }
        }