Пример #1
0
 public static void PatchCurrentProcess()
 {
     Process process = Process.GetCurrentProcess();
     using (ProcessMemoryScanner scanner = new ProcessMemoryScanner(process))
     {
         ScanResult scanResult = scanner.Scan(103000000, KW_EXTERNAL_GET_MASSA);
         ScanAndPatch(scanner, scanResult.ScanNext());
     }
 }
Пример #2
0
        private static void ScanAndPatch(ProcessMemoryScanner scanner, ScanResult scanResult)
        {
            try
            {
                AssertNull(scanResult);

                //Find KW_ADD keyword
                ScanResult patchScanResult = scanResult.ScanNext(KW_ADD);
                AssertNull(patchScanResult);

                //Change keyword KW_ADD value onto KW_DCT value
                uint patchResult = scanner.PatchMemory(patchScanResult, KW_DCT);
                AssertPatchMemoryResult(patchResult, (uint) KW_DCT.Length);

                //Looking for 'showAttackClaim' method call
                patchScanResult = scanResult.ScanNext(KD_SHOW_ATTACK_CLAIM);
                AssertNull(patchScanResult);

                //Call 'dct' method instead 'showAttackClaim' and change current procedure to method
                patchResult = scanner.PatchMemory(patchScanResult, KD_DCT);
                AssertPatchMemoryResult(patchResult, (uint) KD_DCT.Length);
            } catch {}
        }