Example #1
0
        static void Main(string[] args) {
            wow = new BlackMagic();
            wow.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle(processwindowtitle));
            uint gamebase = (uint)wow.MainModule.BaseAddress;
            uint plvl1 = wow.ReadUInt(gamebase + 0x00A42788);
            uint plvl2 = wow.ReadUInt(plvl1 + 0x9c);
            uint plvl3 = wow.ReadUInt(plvl2 + 0x5c);
            uint plvl4 = wow.ReadUInt(plvl3 + 0x60);
            uint player_guid = plvl3 - 0x10;
            //uint playerbase = wow.ReadUInt(wow.ReadUInt(wow.ReadUInt(0x0A87EC2C+0x40))); //this is the player base
            string playername = wow.ReadASCIIString(0x00DBE820, 256); //reads player name
            Console.WriteLine(wow.ReadUInt(player_guid+(uint)descriptors.Health));
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            /*Console.WriteLine(playername + plvl4);
                for (uint j = 0; j < 1; j++) {
                try {
                    uint c = uint.Parse(Console.ReadLine());

                    for (uint i = 0; i < 2000; i++) {
                        uint temp = wow.ReadUInt(plvl3 + (0x10 * i));
                        if (temp > 0 && temp < 200000) {
                            Console.WriteLine("Value: " + temp + " at 0x{0:X}", (0x10 * i));
                            if (temp == c) {
                                Console.WriteLine("Found it! Press enter to continue...");
                                Console.ReadLine();
                            }
                        }
                    }
                }
                catch {

                }
            }
            for (uint i = 0; i < 100; i++) {
                try {
                    uint offset = uint.Parse(Console.ReadLine());
                    Console.WriteLine(wow.ReadUInt(plvl3 + offset));
                }
                catch {

                }
            }
            */
            //////////////////
            Console.ReadLine();
        }
        public static Structs.PatternList FindPatternList(Structs.PatternList patternList)
        {
            Structs.PatternList newPatternList = new Structs.PatternList();
            newPatternList.processName = patternList.processName;
            uint baseModule = 0;

            BlackMagic memread = new BlackMagic();
            if (memread.OpenProcessAndThread(SProcess.GetProcessFromProcessName(patternList.processName)))
            {
                try
                {
                    // Dump module
                    ProcessModuleCollection modules = Process.GetProcessById(memread.ProcessId).Modules;
                    foreach (ProcessModule o in modules)
                    {
                        Structs.ModuleList m = new Structs.ModuleList();
                        m.Name = o.ModuleName;
                        m.baseAddressDec = (int)o.BaseAddress;
                        m.baseAddressHex = (o.BaseAddress).ToString("X");
                        patternList.Modules.Add(m);

                        // Check module base if exist.
                        if (patternList.baseModuleName != "")
                            if (patternList.baseModuleName.ToLower() == o.ModuleName.ToLower())
                                baseModule = (uint)o.BaseAddress;
                    }
                }
                catch { }

                foreach (Structs.Pattern p in patternList.Patterns)
                {
                    try
                    {
                        uint dwCodeLoc = memread.FindPattern(p.pattern, p.mask);
                        uint offset = memread.ReadUInt((uint)((int)dwCodeLoc + p.offsetLocation));
                        if (offset > 0)
                        {
                            offset = offset - baseModule;
                            dwCodeLoc = dwCodeLoc - baseModule;
                        }

                        if (offset > 0)
                        {
                            // Dump offset
                            p.offset = offset.ToString("X");
                            p.offsetDec = offset;
                            p.offsetUsedAtDec = (uint)((int)dwCodeLoc + p.offsetLocation);
                            p.offsetUsedAt = ((int)dwCodeLoc + p.offsetLocation).ToString("X");
                            try
                            {
                                switch (p.type)
                                {
                                    case "int64":
                                        p.value = Convert.ToString(memread.ReadUInt64(p.offsetDec));
                                        break;
                                    case "int":
                                        p.value = Convert.ToString(memread.ReadInt(p.offsetDec));
                                        break;
                                    case "float":
                                        p.value = Convert.ToString(memread.ReadFloat(p.offsetDec));
                                        break;
                                    case "string":
                                        p.value = Convert.ToString(memread.ReadASCIIString(p.offsetDec, 30));
                                        break;
                                }
                            }
                            catch { p.value = "No Found"; }
                        }
                        else
                            p.offset = "No Found";

                    }
                    catch
                    { p.offset = "No Found"; }
                    newPatternList.Patterns.Add(p);
                }
                memread.Close();
            }
            else
            {
                MessageBox.Show("Process no found.");
            }
            return patternList;
        }