/[RomCheater]/trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs
ViewVC logotype

Diff of /trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs

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

--- trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs	2014/04/15 14:30:48	811
+++ trunk/Win32/Sojaner.MemoryScanner/MemoryScanner.cs	2014/04/15 14:52:10	812
@@ -26,6 +26,7 @@
 using ManagedWinapi;
 using RomCheater.PluginFramework.Events;
 using RomCheater.Core;
+using Enterprise.Logging;
 
 namespace Sojaner.MemoryScanner
 {
@@ -290,19 +291,19 @@
             }
             catch (SEHException ex)
             {
-                logger.Error.WriteLine("ReadFirstNonZeroByte() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("ReadFirstNonZeroByte() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
             catch (OutOfMemoryException ex)
             {
-                logger.Error.WriteLine("ReadFirstNonZeroByte(): OutOfMemoryException");
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("ReadFirstNonZeroByte(): OutOfMemoryException");
+                gLog.Verbose.Error.WriteLine(ex.ToString());
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("ReadFirstNonZeroByte(): Exception");
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("ReadFirstNonZeroByte(): Exception");
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
             return false;
@@ -382,7 +383,7 @@
             data.Initialize();
             Buffer.BlockCopy(buffer_list.ToArray(), 0, data, 0, (int)bytesToRead);
             st.Stop();
-            logger.Profiler.WriteLine("ReadProcessMemoryAtOnce(): start=0x{0:x8} end=0x{1:x8} took {2:0.0000} seconds", MemoryAddress, MemoryAddress + bytesToRead, st.Elapsed.TotalSeconds);
+            gLog.Profiler.WriteLine("ReadProcessMemoryAtOnce(): start=0x{0:x8} end=0x{1:x8} took {2:0.0000} seconds", MemoryAddress, MemoryAddress + bytesToRead, st.Elapsed.TotalSeconds);
         }
         #region public void ReadProcessMemory(int MemoryAddress, uint bytesToRead, out int bytesRead, out byte[] data)
         public void ReadProcessMemory(long MemoryAddress, long bytesToRead, out ulong bytesRead, out byte[] data)
@@ -397,14 +398,14 @@
             }
             catch (SEHException ex)
             {
-                logger.Error.WriteLine("ReadProcessMemory() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("ReadProcessMemory() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("ReadProcessMemory(): Exception");
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("ReadProcessMemory(): Exception");
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
         }
@@ -434,15 +435,15 @@
             }
             catch (SEHException ex)
             {
-                logger.Error.WriteLine("WriteProcessMemory() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("WriteProcessMemory() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
             catch (Exception ex)
             {
 
-                logger.Error.WriteLine("WriteProcessMemory() Exception");
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("WriteProcessMemory() Exception");
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 bytesWritten = 0;
                 throw ex;
             }
@@ -496,24 +497,24 @@
                     }
                     bytesRead = _bytesRead;
                 }
-                logger.Info.WriteLine("Succefully dumped memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", MemoryAddress, MemoryAddress + bytesToRead, filename, string.Format("0x{0:x4} {1}.exe", ReadProcess.Id, ReadProcess.ProcessName));
+                gLog.Info.WriteLine("Succefully dumped memory (0x{0:x8}-0x{1:x8}) from pid=({3}) to file {2}", MemoryAddress, MemoryAddress + bytesToRead, filename, string.Format("0x{0:x4} {1}.exe", ReadProcess.Id, ReadProcess.ProcessName));
                 return true;
             }
             catch (SEHException ex)
             {
-                logger.Error.WriteLine("WriteProcessMemoryToFile() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("WriteProcessMemoryToFile() SEHException was thrown: (0x{0:x8}) - {1}", ex.ErrorCode, ex.Message);
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
             catch (OutOfMemoryException ex)
             {
-                logger.Error.WriteLine("WriteProcessMemoryToFile(): Exception");
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("WriteProcessMemoryToFile(): Exception");
+                gLog.Verbose.Error.WriteLine(ex.ToString());
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("WriteProcessMemoryToFile(): Exception");
-                logger.Error.WriteLine(ex.ToString());
+                gLog.Error.WriteLine("WriteProcessMemoryToFile(): Exception");
+                gLog.Verbose.Error.WriteLine(ex.ToString());
                 throw ex;
             }
             return false;

 

  ViewVC Help
Powered by ViewVC 1.1.22