Пример #1
0
        static public void ListZeroAdresses(Adresses a)
        {
#if DEBUG
            BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;

            var list = new List <Tuple <string, int> >();
            foreach (FieldInfo prop in typeof(Adresses).GetFields(flags))
            {
                if ((int)prop.GetValue(a) <= 0x401000 && prop.Name != "game")
                {
                    list.Add(new Tuple <string, int>(prop.Name, (int)prop.GetValue(a)));
                }
            }

            if (list.Count > 0)
            {
                Debug.WriteLine("These addresses are below 0x400000 and dangerous:");
                Debug.Indent();
                foreach (var item in list)
                {
                    Debug.WriteLine(item.Item1);
                }
                Debug.Unindent();
            }
#endif
        }
Пример #2
0
        static public void DumpAdresses(Adresses a)
        {
#if DEBUG
            Debug.Listeners.Remove(Program.ListenerConsole);
            BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;

            Debug.WriteLine("All Adresses");

            Debug.Indent();
            foreach (FieldInfo prop in typeof(Adresses).GetFields(flags))
            {
                Debug.WriteLine(prop.Name + " = 0x" + ((int)prop.GetValue(a)).ToString("X4"), "Adresses");
            }
            Debug.Unindent();
            Debug.Listeners.Add(Program.ListenerConsole);
#endif
        }
Пример #3
0
        public static List <FreezeHack> SetupFreezeHacks(MemHelper mem, Adresses a)
        {
            Debug.WriteLine("Setting up FreezeHacks");

            var        freezeHacks = new List <FreezeHack>();
            FreezeHack currentHack;

            //////////////////////////////////////////////////
            // Pacifist Mode
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "Tree Mode"
            };
            currentHack.Enable = delegate()
            {
                mem.WriteMemory(a.skillDelay, 0);
            };
            currentHack.Disable = delegate()
            {
                mem.WriteMemory(a.skillDelay, 1);
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // Perfect Combos
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "perfect combos"
            };
            currentHack.Freeze = delegate()
            {
                mem.WriteMemory(a.comboTime, 0);
                Thread.Sleep(10);
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // TP
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "teleport on click"
            };
            currentHack.Freeze = delegate()
            {
                mem.WriteMemory(a.tp, 0);
                Thread.Sleep(10);
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // No Casting Time
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "No Casting Time"
            };
            currentHack.Freeze = delegate()
            {
                mem.WriteMemory(a.castingTime, 0);
                Thread.Sleep(10);
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // No Skill Delay
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "No Skill Delay"
            };
            currentHack.Freeze = delegate()
            {
                int org = 1693093;

                mem.WriteMemory(a.skillDelay, org);
                Thread.Sleep(10);
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // Range Hack
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "increased loot range",
            };
            currentHack.Enable = delegate()
            {
                mem.WriteMemory(a.pickupRange1, new byte[] { 0x83, 0xF9, 0x09 });
                mem.WriteMemory(a.pickupRange2, new byte[] { 0x83, 0xF9, 0x09 });
            };
            currentHack.Disable = delegate()
            {
                mem.WriteMemory(a.pickupRange1, new byte[] { 0x83, 0xF9, 0x02 });
                mem.WriteMemory(a.pickupRange2, new byte[] { 0x83, 0xF9, 0x02 });
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // WallHack
            //////////////////////////////////////////////////
            int WHsize = 0x3FFFF;
            int level  = -1;

            byte[] wallBackup = new byte[WHsize];
            currentHack = new FreezeHack()
            {
                name = "WallHack"
            };
            currentHack.Enable = delegate()
            {
                level      = mem.ReadMemoryInt(a.level);
                wallBackup = mem.ReadMemoryBuffer(mem.ResovePointer(a.wallBase) + Offsets.wallHack0, WHsize);
                mem.WriteMemory(mem.ResovePointer(a.wallBase) + Offsets.wallHack0, new byte[WHsize]);
            };
            currentHack.Disable = delegate()
            {
                if (level == mem.ReadMemoryInt(a.level))
                {
                    mem.WriteMemory(mem.ResovePointer(a.wallBase) + Offsets.wallHack0, wallBackup);
                }
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // Zoom Hack
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "Unlimited Zoom"
            };
            currentHack.Enable = delegate()
            {
                mem.WriteMemory(a.fullZoom1, new byte[] { 0x20, 0x9D });
                mem.WriteMemory(a.fullZoom2, new byte[] { 0x20, 0x9D });
                mem.WriteMemory(a.zoom, new byte[] { 0xEB, 0x06 });
            };
            currentHack.Disable = delegate()
            {
                mem.WriteMemory(a.zoom, new byte[] { 0x77, 0x06 });
            };
            freezeHacks.Add(currentHack);

            //////////////////////////////////////////////////
            // Game Master
            //////////////////////////////////////////////////
            currentHack = new FreezeHack()
            {
                name = "view every inventory"
            };
            currentHack.Enable = delegate()
            {
                mem.WriteMemory(a.nation, 3);
            };
            currentHack.Disable = delegate()
            {
                mem.WriteMemory(a.nation, 0);
            };
            freezeHacks.Add(currentHack);

            freezeHacks.Sort((x, y) => x.name.CompareTo(y.name));

            return(freezeHacks);
        }
Пример #4
0
        static public void GenerateCheatTable(Adresses a)
        {
#if DEBUG
            Tuple <string, string, int, bool>[] info = new Tuple <string, string, int, bool>[]
            {
                new Tuple <string, string, int, bool>("bypassHackDetection", "Array of byte", 6, true),
                new Tuple <string, string, int, bool>("wallHackDetection", "Array of byte", 6, true),
                new Tuple <string, string, int, bool>("wallHack", "Array of byte", 200, true),
                new Tuple <string, string, int, bool>("wallBase", "Array of byte", 200, true),
                new Tuple <string, string, int, bool>("pickupRange1", "Array of byte", 3, false),
                new Tuple <string, string, int, bool>("pickupRange2", "Array of byte", 3, false),

                new Tuple <string, string, int, bool>("Base", "4 Bytes", 0, true),
                new Tuple <string, string, int, bool>("baseCam", "4 Bytes", 0, true),
                new Tuple <string, string, int, bool>("wallBase", "4 Bytes", 0, true),

                new Tuple <string, string, int, bool>("id", "String", 99, true),

                new Tuple <string, string, int, bool>("x", "Float", 0, false),
                new Tuple <string, string, int, bool>("y", "Float", 0, false),
            };

            Debug.Listeners.Remove(Program.ListenerConsole);
            Debug.Listeners.Remove(Program.ListenerLog);
            Debug.Listeners.Add(new TextWriterTraceListener(new System.IO.StreamWriter("table.ct", false).BaseStream, "CheatTable"));

            BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;

            int i = 0;
            Debug.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            Debug.WriteLine("<CheatTable CheatEngineTableVersion=\"28\">");
            Debug.Indent();
            Debug.WriteLine("<CheatEntries>");
            Debug.Indent();
            Debug.WriteLine("<CheatEntry>");
            Debug.Indent();
            Debug.WriteLine("<ID>" + i + "</ID>"); i++;
            Debug.WriteLine("<Description>\"" + DateTime.Now + "\"</Description>");
            Debug.WriteLine("<Options moHideChildren=\"1\" moAllowManualCollapseAndExpand=\"1\"/>");
            Debug.WriteLine("<LastState Value=\"\" Activated=\"1\" RealAddress=\"00000000\"/>");
            Debug.WriteLine("<GroupHeader>1</GroupHeader>");
            Debug.WriteLine("<CheatEntries>");

            foreach (FieldInfo prop in typeof(Adresses).GetFields(flags))
            {
                Tuple <string, string, int, bool> selected = info.FirstOrDefault(x => x.Item1 == prop.Name);
                if (selected == null)
                {
                    selected = new Tuple <string, string, int, bool>(prop.Name, "4 Bytes", 0, false);
                }

                Debug.WriteLine("<CheatEntry>");
                Debug.Indent();
                Debug.WriteLine("<ID>" + i + "</ID>");
                Debug.WriteLine("<Description>\"" + prop.Name + "\"</Description>");
                Debug.WriteLine("<VariableType>" + selected.Item2 + "</VariableType>");
                if (selected.Item4 && selected.Item1 != "String")
                {
                    Debug.WriteLine("<ShowAsHex>1</ShowAsHex>");
                }
                if (selected.Item2 == "Array of byte")
                {
                    Debug.WriteLine("<ByteLength>" + selected.Item3 + "</ByteLength>");
                }
                if (selected.Item2 == "String")
                {
                    Debug.WriteLine("<Length>" + selected.Item3 + "</Length>");
                    Debug.WriteLine("<Unicode>0</Unicode>");
                    Debug.WriteLine("<CodePage>0</CodePage>");
                    Debug.WriteLine("<ZeroTerminate>1</ZeroTerminate>");
                }
                Debug.WriteLine("<Address>" + ((int)prop.GetValue(a)).ToString("X4") + "</Address>");
                Debug.Unindent();
                Debug.WriteLine("</CheatEntry>");

                i++;
            }
            Debug.Unindent();
            Debug.WriteLine("</CheatEntries>");
            Debug.Unindent();
            Debug.WriteLine("</CheatEntry>");
            Debug.Unindent();
            Debug.WriteLine("</CheatEntries>");
            Debug.WriteLine("<UserdefinedSymbols/>");
            Debug.Unindent();
            Debug.WriteLine("</CheatTable>");

            Debug.Flush();
            Debug.Listeners.Remove("CheatTable");
            Debug.Listeners.Add(Program.ListenerConsole);
            Debug.Listeners.Add(Program.ListenerLog);

            string s = Path.GetFullPath(@"table.ct");
            string t = Path.GetFullPath(@"..\..\..\table.ct");
            try
            {
                System.IO.File.Copy(s, t, true);
            }
            catch (Exception) { }
#endif
        }