/[RomCheater]/trunk/RomCheater.CorePlugins/Config/PCSX2Config.cs
ViewVC logotype

Diff of /trunk/RomCheater.CorePlugins/Config/PCSX2Config.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- 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 RomCheater.PluginFramework.Core;
 using System.IO;
 using System.Diagnostics;
+using RomCheater.Logging;
 
 namespace RomCheater.CorePlugins.Config
 {
@@ -26,7 +27,16 @@
         {
             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 @@
                 r.Close();
                 if (!isExe)
                 {
+                    logger.Debug.WriteLine("  Process: {0} is not a valid executable file", filename);
                     isValid = false;
                 }
                 else
@@ -87,6 +98,7 @@
                     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 @@
                     if (found_string.ToLower().Contains("DebugBreak".ToLower()))
                     {
                         isDebug = true;
+                        logger.Debug.WriteLine("  Process: {0} found DebugBreak", filename);
                     }
                     sr.Close();
                 }
@@ -121,6 +134,7 @@
                 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 @@
                             {
                                 //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
                             }
                         }

 

  ViewVC Help
Powered by ViewVC 1.1.22