ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.CorePlugins/Config/PCSX2Config.cs
(Generate patch)

Comparing trunk/RomCheater.CorePlugins/Config/PCSX2Config.cs (file contents):
Revision 94 by william, Wed May 9 22:31:56 2012 UTC vs.
Revision 98 by william, Wed May 9 23:10:12 2012 UTC

--- trunk/RomCheater.CorePlugins/Config/PCSX2Config.cs	2012/05/09 22:31:56	94
+++ trunk/RomCheater.CorePlugins/Config/PCSX2Config.cs	2012/05/09 23:10:12	98
@@ -5,6 +5,7 @@ using System.Text;
 using RomCheater.PluginFramework.Core;
 using System.IO;
 using System.Diagnostics;
+using RomCheater.Logging;
 
 namespace RomCheater.CorePlugins.Config
 {
@@ -26,7 +27,16 @@ namespace RomCheater.CorePlugins.Config
         {
             bool isDebug = false;
             uint VTLB_RELEASE_OFFSET = 0;
-            return !IsValidPSX2Process(p.ProcessInfo.Id, out isDebug, out VTLB_RELEASE_OFFSET);
+            bool notvalid = !IsValidPSX2Process(p.ProcessInfo.Id, out isDebug, out VTLB_RELEASE_OFFSET);
+            if (notvalid)
+            {
+                logger.Debug.WriteLine("    Not Allowing process {0} to be added because it was filterd out", p.Name);
+            }
+            else
+            {
+                logger.Debug.WriteLine("    Allowing process {0} to be added", p.Name);
+            }
+            return notvalid;
         }
         #region IPluginBase Members
         public override Guid ID
@@ -76,6 +86,7 @@ namespace RomCheater.CorePlugins.Config
                 r.Close();
                 if (!isExe)
                 {
+                    logger.Debug.WriteLine("  Process: {0} is not a valid executable file", filename);
                     isValid = false;
                 }
                 else
@@ -87,6 +98,7 @@ namespace RomCheater.CorePlugins.Config
                     if (found_string.ToLower().Contains(PCXS2_LOOKUP_MAGIC_001.ToLower()) && found_string.ToLower().Contains(PCXS2_LOOKUP_MAGIC_002.ToLower()))
                     {
                         isValid = true;
+                        logger.Debug.WriteLine("  Process: {0} found MAGIC LOOKUP {1} and {2}", filename, PCXS2_LOOKUP_MAGIC_001.ToLower(), PCXS2_LOOKUP_MAGIC_002.ToLower());
                     }
                     sr.Close();
 
@@ -98,6 +110,7 @@ namespace RomCheater.CorePlugins.Config
                     if (found_string.ToLower().Contains("DebugBreak".ToLower()))
                     {
                         isDebug = true;
+                        logger.Debug.WriteLine("  Process: {0} found DebugBreak", filename);
                     }
                     sr.Close();
                 }
@@ -121,6 +134,7 @@ namespace RomCheater.CorePlugins.Config
                 byte[] check_data = reader.ReadProcessMemory((IntPtr)VTLB_VADDR_OFFSET_DEBUG, (uint)entrypoint_data.Length, out bytesReadSize);
 
                 isDebug = check_data.SequenceEqual(entrypoint_data);
+                logger.Debug.WriteLine("  Process: {0} isDebug: {1}", filename, isDebug.ToString());
                 //List<uint> addresses = new List<uint>();
                 if (!isDebug)
                 {
@@ -136,6 +150,7 @@ namespace RomCheater.CorePlugins.Config
                             {
                                 //addresses.Add(t);
                                 VTLB_RELEASE_OFFSET = t;
+                                logger.Debug.WriteLine("  Process: {0} found release build entrypoint at 0x{1:x8}", filename, t);
                                 break; //use only the first valid value
                             }
                         }