Example #1
0
            public override void DeobfuscateBegin()
            {
                if (_constantDecrypter.Detected)
                {
                    _sbyteValueInliner  = new SByteValueInliner();
                    _byteValueInliner   = new ByteValueInliner();
                    _int16ValueInliner  = new Int16ValueInliner();
                    _uint16ValueInliner = new UInt16ValueInliner();
                    _int32ValueInliner  = new Int32ValueInliner();
                    _uint32ValueInliner = new UInt32ValueInliner();
                    _int64ValueInliner  = new Int64ValueInliner();
                    _uint64ValueInliner = new UInt64ValueInliner();
                    _singleValueInliner = new SingleValueInliner();
                    _doubleValueInliner = new DoubleValueInliner();
                    _arrayValueInliner  = new ArrayValueInliner(initializedDataCreator);
                    foreach (var info in _constantDecrypter.Decrypters)
                    {
                        staticStringInliner.Add(info.Method,
                                                (method, gim, args) => _constantDecrypter.DecryptString(info, gim, (uint)args[0]));
                        _sbyteValueInliner.Add(info.Method,
                                               (method, gim, args) => _constantDecrypter.DecryptSByte(info, gim, (uint)args[0]));
                        _byteValueInliner.Add(info.Method,
                                              (method, gim, args) => _constantDecrypter.DecryptByte(info, gim, (uint)args[0]));
                        _int16ValueInliner.Add(info.Method,
                                               (method, gim, args) => _constantDecrypter.DecryptInt16(info, gim, (uint)args[0]));
                        _uint16ValueInliner.Add(info.Method,
                                                (method, gim, args) => _constantDecrypter.DecryptUInt16(info, gim, (uint)args[0]));
                        _int32ValueInliner.Add(info.Method,
                                               (method, gim, args) => _constantDecrypter.DecryptInt32(info, gim, (uint)args[0]));
                        _uint32ValueInliner.Add(info.Method,
                                                (method, gim, args) => _constantDecrypter.DecryptUInt32(info, gim, (uint)args[0]));
                        _int64ValueInliner.Add(info.Method,
                                               (method, gim, args) => _constantDecrypter.DecryptInt64(info, gim, (uint)args[0]));
                        _uint64ValueInliner.Add(info.Method,
                                                (method, gim, args) => _constantDecrypter.DecryptUInt64(info, gim, (uint)args[0]));
                        _singleValueInliner.Add(info.Method,
                                                (method, gim, args) => _constantDecrypter.DecryptSingle(info, gim, (uint)args[0]));
                        _doubleValueInliner.Add(info.Method,
                                                (method, gim, args) => _constantDecrypter.DecryptDouble(info, gim, (uint)args[0]));
                        _arrayValueInliner.Add(info.Method,
                                               (method, gim, args) => _constantDecrypter.DecryptArray(info, gim, (uint)args[0]));
                    }
                    _deobfuscating = true;
                }
                if (_resourceDecrypter.Detected)
                {
                    _resourceDecrypter.Fix();
                }

                base.DeobfuscateBegin();
            }
Example #2
0
 public ConstantsInliner(SByteValueInliner sbyteValueInliner, ByteValueInliner byteValueInliner,
                         Int16ValueInliner int16ValueInliner, UInt16ValueInliner uint16ValueInliner,
                         Int32ValueInliner int32ValueInliner,
                         UInt32ValueInliner uint32ValueInliner, Int64ValueInliner int64ValueInliner,
                         UInt64ValueInliner uint64ValueInliner,
                         SingleValueInliner singleValueInliner, DoubleValueInliner doubleValueInliner,
                         ArrayValueInliner arrayValueInliner)
 {
     _sbyteValueInliner  = sbyteValueInliner;
     _byteValueInliner   = byteValueInliner;
     _int16ValueInliner  = int16ValueInliner;
     _uint16ValueInliner = uint16ValueInliner;
     _int32ValueInliner  = int32ValueInliner;
     _uint32ValueInliner = uint32ValueInliner;
     _int64ValueInliner  = int64ValueInliner;
     _uint64ValueInliner = uint64ValueInliner;
     _singleValueInliner = singleValueInliner;
     _doubleValueInliner = doubleValueInliner;
     _arrayValueInliner  = arrayValueInliner;
 }