Пример #1
0
 public void act_read()
 {
     Console.WriteLine("DEBUG > StatsPageHandler > Reading...");
     HP_Max         = BinaryHandler.bytesAsInt(Pcsx2Memory.readPcsx2(long.Parse(HP_Max_MEM, System.Globalization.NumberStyles.HexNumber), HP_Max_Size));
     HP_Current     = BinaryHandler.bytesAsInt(Pcsx2Memory.readPcsx2(long.Parse(HP_Current_MEM, System.Globalization.NumberStyles.HexNumber), HP_Current_Size));
     MP_Max         = BinaryHandler.bytesAsInt(Pcsx2Memory.readPcsx2(long.Parse(MP_Max_MEM, System.Globalization.NumberStyles.HexNumber), MP_Max_Size));
     MP_Current     = BinaryHandler.bytesAsInt(Pcsx2Memory.readPcsx2(long.Parse(MP_Current_MEM, System.Globalization.NumberStyles.HexNumber), MP_Current_Size));
     Drive_Max      = Pcsx2Memory.readPcsx2(long.Parse(Drive_Max_MEM, System.Globalization.NumberStyles.HexNumber), Drive_Max_Size)[0];
     Drive_Current  = Pcsx2Memory.readPcsx2(long.Parse(Drive_Current_MEM, System.Globalization.NumberStyles.HexNumber), Drive_Current_Size)[0];
     Munny          = BinaryHandler.bytesAsInt(Pcsx2Memory.readPcsx2(long.Parse(Munny_MEM, System.Globalization.NumberStyles.HexNumber), Munny_Size));
     AP_Boost       = Pcsx2Memory.readPcsx2(long.Parse(AP_Boost_MEM, System.Globalization.NumberStyles.HexNumber), AP_Boost_Size)[0];
     Strength       = BinaryHandler.bytesAsUShort(Pcsx2Memory.readPcsx2(long.Parse(Strength_MEM, System.Globalization.NumberStyles.HexNumber), Strength_Size));
     Strength_Boost = Pcsx2Memory.readPcsx2(long.Parse(Strength_Boost_MEM, System.Globalization.NumberStyles.HexNumber), Strength_Boost_Size)[0];
     Magic          = BinaryHandler.bytesAsUShort(Pcsx2Memory.readPcsx2(long.Parse(Magic_MEM, System.Globalization.NumberStyles.HexNumber), Magic_Size));
     Magic_Boost    = Pcsx2Memory.readPcsx2(long.Parse(Magic_Boost_MEM, System.Globalization.NumberStyles.HexNumber), Magic_Boost_Size)[0];
     Defense        = BinaryHandler.bytesAsUShort(Pcsx2Memory.readPcsx2(long.Parse(Defense_MEM, System.Globalization.NumberStyles.HexNumber), Defense_Size));
     Defense_Boost  = Pcsx2Memory.readPcsx2(long.Parse(Defense_Boost_MEM, System.Globalization.NumberStyles.HexNumber), Defense_Boost_Size)[0];
     PhysRes        = Pcsx2Memory.readPcsx2(long.Parse(PhysRes_MEM, System.Globalization.NumberStyles.HexNumber), PhysRes_Size)[0];
     FireRes        = Pcsx2Memory.readPcsx2(long.Parse(FireRes_MEM, System.Globalization.NumberStyles.HexNumber), FireRes_Size)[0];
     BlizRes        = Pcsx2Memory.readPcsx2(long.Parse(BlizRes_MEM, System.Globalization.NumberStyles.HexNumber), BlizRes_Size)[0];
     ThunRes        = Pcsx2Memory.readPcsx2(long.Parse(ThunRes_MEM, System.Globalization.NumberStyles.HexNumber), ThunRes_Size)[0];
     DarkRes        = Pcsx2Memory.readPcsx2(long.Parse(DarkRes_MEM, System.Globalization.NumberStyles.HexNumber), DarkRes_Size)[0];
     NeutRes        = Pcsx2Memory.readPcsx2(long.Parse(NeutRes_MEM, System.Globalization.NumberStyles.HexNumber), NeutRes_Size)[0];
     GeneRes        = Pcsx2Memory.readPcsx2(long.Parse(GeneRes_MEM, System.Globalization.NumberStyles.HexNumber), GeneRes_Size)[0];
     Console.WriteLine("DEBUG > StatsPageHandler > Finished reading!");
 }
Пример #2
0
 public void act_write()
 {
     Console.WriteLine("DEBUG > StatsPageHandler > Writing to Pcsx2...");
     Pcsx2Memory.writePcsx2(long.Parse(HP_Max_MEM, System.Globalization.NumberStyles.HexNumber), HP_Max_Size, BinaryHandler.intAsBytes(HP_Max));
     Pcsx2Memory.writePcsx2(long.Parse(HP_Current_MEM, System.Globalization.NumberStyles.HexNumber), HP_Current_Size, BinaryHandler.intAsBytes(HP_Current));
     Pcsx2Memory.writePcsx2(long.Parse(MP_Max_MEM, System.Globalization.NumberStyles.HexNumber), MP_Max_Size, BinaryHandler.intAsBytes(MP_Max));
     Pcsx2Memory.writePcsx2(long.Parse(MP_Current_MEM, System.Globalization.NumberStyles.HexNumber), MP_Current_Size, BinaryHandler.intAsBytes(MP_Current));
     Pcsx2Memory.writePcsx2(long.Parse(Drive_Max_MEM, System.Globalization.NumberStyles.HexNumber), Drive_Max_Size, new List <byte>(new byte[] { Drive_Max }));
     Pcsx2Memory.writePcsx2(long.Parse(Drive_Current_MEM, System.Globalization.NumberStyles.HexNumber), Drive_Current_Size, new List <byte>(new byte[] { Drive_Current }));
     Pcsx2Memory.writePcsx2(long.Parse(Munny_MEM, System.Globalization.NumberStyles.HexNumber), Munny_Size, BinaryHandler.intAsBytes(Munny));
     Pcsx2Memory.writePcsx2(long.Parse(AP_Boost_MEM, System.Globalization.NumberStyles.HexNumber), AP_Boost_Size, new List <byte>(new byte[] { AP_Boost }));
     Pcsx2Memory.writePcsx2(long.Parse(Strength_MEM, System.Globalization.NumberStyles.HexNumber), Strength_Size, BinaryHandler.ushortAsBytes(Strength));
     Pcsx2Memory.writePcsx2(long.Parse(Strength_Boost_MEM, System.Globalization.NumberStyles.HexNumber), Strength_Boost_Size, new List <byte>(new byte[] { Strength_Boost }));
     Pcsx2Memory.writePcsx2(long.Parse(Magic_MEM, System.Globalization.NumberStyles.HexNumber), Magic_Size, BinaryHandler.ushortAsBytes(Magic));
     Pcsx2Memory.writePcsx2(long.Parse(Magic_Boost_MEM, System.Globalization.NumberStyles.HexNumber), Magic_Boost_Size, new List <byte>(new byte[] { Magic_Boost }));
     Pcsx2Memory.writePcsx2(long.Parse(Defense_MEM, System.Globalization.NumberStyles.HexNumber), Defense_Size, BinaryHandler.ushortAsBytes(Defense));
     Pcsx2Memory.writePcsx2(long.Parse(Defense_Boost_MEM, System.Globalization.NumberStyles.HexNumber), Defense_Boost_Size, new List <byte>(new byte[] { Defense_Boost }));
     Pcsx2Memory.writePcsx2(long.Parse(PhysRes_MEM, System.Globalization.NumberStyles.HexNumber), PhysRes_Size, new List <byte>(new byte[] { PhysRes }));
     Pcsx2Memory.writePcsx2(long.Parse(FireRes_MEM, System.Globalization.NumberStyles.HexNumber), FireRes_Size, new List <byte>(new byte[] { FireRes }));
     Pcsx2Memory.writePcsx2(long.Parse(BlizRes_MEM, System.Globalization.NumberStyles.HexNumber), BlizRes_Size, new List <byte>(new byte[] { BlizRes }));
     Pcsx2Memory.writePcsx2(long.Parse(ThunRes_MEM, System.Globalization.NumberStyles.HexNumber), ThunRes_Size, new List <byte>(new byte[] { ThunRes }));
     Pcsx2Memory.writePcsx2(long.Parse(DarkRes_MEM, System.Globalization.NumberStyles.HexNumber), DarkRes_Size, new List <byte>(new byte[] { DarkRes }));
     Pcsx2Memory.writePcsx2(long.Parse(NeutRes_MEM, System.Globalization.NumberStyles.HexNumber), NeutRes_Size, new List <byte>(new byte[] { NeutRes }));
     Pcsx2Memory.writePcsx2(long.Parse(GeneRes_MEM, System.Globalization.NumberStyles.HexNumber), GeneRes_Size, new List <byte>(new byte[] { GeneRes }));
     Console.WriteLine("DEBUG > StatsPageHandler > Finished writing!");
 }
Пример #3
0
 public void writeFileToProcess(List <byte> fileToWrite)
 {
     if (MemOffset == NOT_FOUND)
     {
         return;
     }
     Pcsx2Memory.writePcsx2(long.Parse(MemOffset, System.Globalization.NumberStyles.HexNumber), fileToWrite.Count, fileToWrite);
 }
Пример #4
0
        public void act_testData()
        {
            Console.WriteLine("DEBUG > ArdScriptPageHandler > Writing to Pcsx2...");
            // For whenever an entry is added
            //insertDataToFile();
            List <byte> fileToWrite = ArdScriptFileLoaded.getAsByteList();

            Pcsx2Memory.writePcsx2(int.Parse(MemOffset, System.Globalization.NumberStyles.HexNumber), fileToWrite.Count, fileToWrite);
            Console.WriteLine("DEBUG > ArdScriptPageHandler > Finished writing!");
        }
Пример #5
0
 public StatsPageHandler()
 {
     Pcsx2Memory.findProcess();
     if (Pcsx2Memory.process_current_Type == Enum.ProcessType.PCSX2)
     {
         // HP_Before_Hit = "21ADE8A8";
         HP_Max_MEM         = "21C6C754";
         HP_Current_MEM     = "21C6C750";
         MP_Max_MEM         = "21C6C8D4";
         MP_Current_MEM     = "21C6C8D0";
         Drive_Max_MEM      = "21C6C902";
         Drive_Current_MEM  = "21C6C901";
         Munny_MEM          = "2032DF70";
         AP_Boost_MEM       = "2032E028";
         Strength_MEM       = "21C6C8D8";
         Strength_Boost_MEM = "2032E029";
         Magic_MEM          = "21C6C8DA";
         Magic_Boost_MEM    = "2032E02A";
         Defense_MEM        = "21C6C8DC";
         Defense_Boost_MEM  = "2032E02B";
         PhysRes_MEM        = "21C6C8F8";
         FireRes_MEM        = "21C6C8F9";
         BlizRes_MEM        = "21C6C8FA";
         ThunRes_MEM        = "21C6C8FB";
         DarkRes_MEM        = "21C6C8FC";
         NeutRes_MEM        = "21C6C8FD";
         GeneRes_MEM        = "21C6C8FE";
     }
     else if (Pcsx2Memory.process_current_Type == Enum.ProcessType.EGS)
     {
         // HP_Before_Hit = "21ADE8A8";
         HP_Max_MEM         = (Pcsx2Memory.startingAddressEGS + 0x2A20C5C).ToString("X12");
         HP_Current_MEM     = (Pcsx2Memory.startingAddressEGS + 0x2A20C58).ToString("X12");
         MP_Max_MEM         = (Pcsx2Memory.startingAddressEGS + 0x2A20DDC).ToString("X12");
         MP_Current_MEM     = (Pcsx2Memory.startingAddressEGS + 0x2A20DD8).ToString("X12");
         Drive_Max_MEM      = (Pcsx2Memory.startingAddressEGS + 0x2A20E0A).ToString("X12");
         Drive_Current_MEM  = (Pcsx2Memory.startingAddressEGS + 0x2A20E09).ToString("X12");
         Munny_MEM          = (Pcsx2Memory.startingAddressEGS + 0x9A94B0).ToString("X12");
         AP_Boost_MEM       = (Pcsx2Memory.startingAddressEGS + 0x10E2530).ToString("X12");
         Strength_MEM       = (Pcsx2Memory.startingAddressEGS + 0x2A20DE0).ToString("X12");
         Strength_Boost_MEM = (Pcsx2Memory.startingAddressEGS + 0x10E2531).ToString("X12");
         Magic_MEM          = (Pcsx2Memory.startingAddressEGS + 0x2A20DE2).ToString("X12");
         Magic_Boost_MEM    = (Pcsx2Memory.startingAddressEGS + 0x10E2532).ToString("X12");
         Defense_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20DE4).ToString("X12");
         Defense_Boost_MEM  = (Pcsx2Memory.startingAddressEGS + 0x10E2533).ToString("X12");
         PhysRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E00).ToString("X12");
         FireRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E01).ToString("X12");
         BlizRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E02).ToString("X12");
         ThunRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E03).ToString("X12");
         DarkRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E04).ToString("X12");
         NeutRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E05).ToString("X12");
         GeneRes_MEM        = (Pcsx2Memory.startingAddressEGS + 0x2A20E06).ToString("X12");
     }
     act_read();
 }
Пример #6
0
 public void act_read()
 {
     if (AbilityFileLoaded == null)
     {
         return;
     }
     Console.WriteLine("DEBUG > AbilitiesPageHandler > Reading...");
     AbilityFileLoaded.readData(Pcsx2Memory.readPcsx2(long.Parse(MemOffset, System.Globalization.NumberStyles.HexNumber), Int32.Parse(AbilityCount) * 2), Int32.Parse(AbilityCount));
     AbilitiesCopy = AbilityFileLoaded.Abilities;
     Console.WriteLine("DEBUG > AbilitiesPageHandler > Finished reading!");
 }
Пример #7
0
 public void act_read()
 {
     if (InventoryFileLoaded == null)
     {
         return;
     }
     Console.WriteLine("DEBUG > InventoryPageHandler > Reading...");
     InventoryFileLoaded.readData(Pcsx2Memory.readPcsx2(long.Parse(MemOffset, System.Globalization.NumberStyles.HexNumber), Int32.Parse(ItemCount)), Int32.Parse(ItemCount));
     loadList();
     Console.WriteLine("DEBUG > InventoryPageHandler > Finished reading!");
 }
Пример #8
0
        public void act_testData()
        {
            Console.WriteLine("DEBUG > BarPageHandler > Writing to Pcsx2...");
            // For whenever an entry is added
            //insertDataToFile();
            // Starting offset: The bar in memory uses different offsets, so we start from the first subfile
            int         startOffset = BarFileLoaded.Header.Count + (BarFileLoaded.Items.Count * BarFile.entrySize);
            List <byte> fileToWrite = BarFileLoaded.getAsByteList().GetRange(startOffset, BarFileLoaded.getAsByteList().Count - startOffset);

            Pcsx2Memory.writePcsx2(int.Parse(MemOffset, System.Globalization.NumberStyles.HexNumber) + startOffset, fileToWrite.Count - startOffset, fileToWrite);
            Console.WriteLine("DEBUG > BarPageHandler > Finished writing!");
        }
Пример #9
0
        public AbilitiesPageHandler()
        {
            Pcsx2Memory.findProcess();
            if (Pcsx2Memory.process_current_Type == Enum.ProcessType.PCSX2)
            {
                MemOffset = "2032E074";
            }
            else if (Pcsx2Memory.process_current_Type == Enum.ProcessType.EGS)
            {
                MemOffset = (Pcsx2Memory.startingAddressEGS + 0x9A95B4).ToString("X12");
            }

            AbilityCount = "96";
            Console.WriteLine("DEBUG > AbilitiesPageHandler > Processing file...");
            AbilityFileLoaded = new AbilitiesFile();
            act_read();
            Console.WriteLine("DEBUG > AbilitiesPageHandler > File processed!");
        }
Пример #10
0
        public void findAddress()
        {
            if (AddressFound)
            {
                return;
            }
            Pcsx2Memory.findProcess();

            // Find by pointers
            long autoAddress = -1;

            if (fileType == FileType.KH2_00OBJENTRY)
            {
                autoAddress = Pcsx2Memory.getAddressOfSubBar(fileType, null);
            }
            else if (subBarName != null && subSubBarName != null)
            {
                autoAddress = Pcsx2Memory.getAddressOfSubSubBar(fileType, subBarName, subSubBarName);
            }
            else if (subBarName != null)
            {
                autoAddress = Pcsx2Memory.getAddressOfSubBar(fileType, subBarName);
            }
            // Find by string search
            if (autoAddress <= 0 && fileType != FileType.KH2_00OBJENTRY)
            {
                autoAddress = Pcsx2Memory.findBarFileAddress(stringToFind);
            }

            // If address was found
            if (autoAddress > 0)
            {
                AddressFound = true;
                MemOffset    = FormatHandler.getHexString(autoAddress, ProcessType.PCSX2);
                if (Pcsx2Memory.process_current_Type == ProcessType.PCSX2 && autoAddress > 0x2FFFFFFF)
                {
                    MemOffset = NOT_FOUND;
                }
            }
            else
            {
                MemOffset = NOT_FOUND;
            }
        }
Пример #11
0
        public InventoryPageHandler()
        {
            Pcsx2Memory.findProcess();
            if (Pcsx2Memory.process_current_Type == Enum.ProcessType.PCSX2)
            {
                MemOffset = "2032F0B0";
            }
            else if (Pcsx2Memory.process_current_Type == Enum.ProcessType.EGS)
            {
                MemOffset = (Pcsx2Memory.startingAddressEGS + 0x9AA5F0).ToString("X12");
            }

            ItemCount          = "312";
            NameFilter         = "";
            InventoryFileItems = new ObservableCollection <Item>();
            Console.WriteLine("DEBUG > InventoryPageHandler > Processing file...");
            InventoryFileLoaded = new InventoryFile();
            loadList();
            Console.WriteLine("DEBUG > InventoryPageHandler > File processed!");
        }
Пример #12
0
        public void findAddressDirect()
        {
            if (AddressFound)
            {
                return;
            }

            long addressInt = Pcsx2Memory.findAddressOf(stringToFind);

            AddressFound = true;

            if (addressInt == -1)
            {
                MemOffset = MemOffsetFallback;
            }
            else
            {
                MemOffset = FormatHandler.getHexString(addressInt, ProcessType.PCSX2);
            }
            if (procType == ProcessType.PCSX2 && addressInt > 0x2FFFFFFF)
            {
                MemOffset = MemOffsetFallback;
            }
        }
Пример #13
0
 private void findFileOffset(object sender, EventArgs e)
 {
     Console.WriteLine("DEBUG > 03system Offset: " + FormatHandler.getHexString(Pcsx2Memory.getFileOffset(Enum.FileType.KH2_03SYSTEM), ProcessType.PCSX2));
     //Console.WriteLine("DEBUG > 00battle Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_00BATTLE));
     //Console.WriteLine("DEBUG > 00objentry Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_00OBJENTRY));
     //Console.WriteLine("DEBUG > jiminy Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_JIMINY));
     //Console.WriteLine("DEBUG > mixdata Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_MIXDATA));
     //Console.WriteLine("DEBUG > SUBBAR: " + Pcsx2Memory.getOffsetOfSubBar(0x20000000 + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_03SYSTEM), "cmd\0"));
     //Console.WriteLine("DEBUG > SUBSUBBAR: " + FormatHandler.getHexString(Pcsx2Memory.getAddressOfSubSubBar(Enum.FileType.KH2_03SYSTEM, "pref", "magi"), ProcessType.PCSX2));
 }
Пример #14
0
 public void act_write()
 {
     Console.WriteLine("DEBUG > AbilitiesPageHandler > Writing to Pcsx2...");
     Pcsx2Memory.writePcsx2(long.Parse(MemOffset, System.Globalization.NumberStyles.HexNumber), Int32.Parse(AbilityCount) * 2, AbilityFileLoaded.getData());
     Console.WriteLine("DEBUG > AbilitiesPageHandler > Finished writing!");
 }
Пример #15
0
 private void findKHProcesses(object sender, EventArgs e)
 {
     Pcsx2Memory.findProcessContainingString("KINGDOM");
 }
Пример #16
0
 private void findKH3(object sender, EventArgs e)
 {
     Pcsx2Memory.findKH3();
 }
Пример #17
0
 private void findPCSX2(object sender, EventArgs e)
 {
     Pcsx2Memory.findPCSX2();
 }