Ejemplo n.º 1
0
        private bool VerifyAllMatchedKeys(CryptoPatchContainer patches)
        {
            var samplePatch    = CryptoPatches.Find(p => !p.Inlined);
            var inlinedPatches = CryptoPatches.Where(p => p.Inlined);

            foreach (var inlinedPatch in inlinedPatches)
            {
                if (inlinedPatch.Keys[0].Key != samplePatch.Keys[0].Key)
                {
                    return(false);
                }

                if (inlinedPatch.Keys[2].Key != samplePatch.Keys[2].Key)
                {
                    return(false);
                }
            }

            var regularPatches = CryptoPatches.Where(p => !p.Inlined);

            foreach (var patch in regularPatches)
            {
                for (int i = 0; i < CryptoPatch.KEYS_COUNT; i++)
                {
                    if (patch.Keys[i].Key != samplePatch.Keys[i].Key)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool VerifyAllMatchedKeys(CryptoPatchContainer patches)
        {
            var samplePatch    = CryptoPatches.Find(p => !p.Inlined);
            var inlinedPatches = CryptoPatches.Where(p => p.Inlined);

            foreach (var inlinedPatch in inlinedPatches)
            {
                if (inlinedPatch.Keys[0].Key != samplePatch.Keys[0].Key)
                {
                    var keyVA = Calculator.OffsetToVA((ulong)inlinedPatch.Keys[0].Offset);
                    Log.Error($"Unmatched results. Inlined patch key1 (0x{keyVA:X8}) not equals to sample patch key1.");
                    return(false);
                }

                if (inlinedPatch.Keys[2].Key != samplePatch.Keys[2].Key)
                {
                    var keyVA = Calculator.OffsetToVA((ulong)inlinedPatch.Keys[2].Offset);
                    Log.Error($"Unmatched results. Inlined patch key3 (0x{keyVA:X8}) not equals to sample patch key3.");
                    return(false);
                }
            }

            var regularPatches = CryptoPatches.Where(p => !p.Inlined);

            foreach (var patch in regularPatches)
            {
                for (int i = 0; i < CryptoPatch.KEYS_COUNT; i++)
                {
                    if (patch.Keys[i].Key != samplePatch.Keys[i].Key)
                    {
                        var keyVA = Calculator.OffsetToVA((ulong)patch.Keys[i].Offset);
                        Log.Error($"Unmatched results. Regular patch key (0x{keyVA:X8}) not equals to sample patch key.");
                        return(false);
                    }
                }
            }

            return(true);
        }