Ejemplo n.º 1
0
        public int decrypt(Blocks theBlocks)
        {
            if (!HasHandlers)
                return 0;
            try {
                blocks = theBlocks;
                callResults = new List<CallResult>();
                allBlocks = new List<Block>(blocks.MethodBlocks.getAllBlocks());

                findAllCallResults();
                inlineAllCalls();
                inlineReturnValues();
                return callResults.Count;
            }
            finally {
                blocks = null;
                callResults = null;
                allBlocks = null;
                variableValues = null;
            }
        }
Ejemplo n.º 2
0
		bool GetLocalVariableValue(Local variable, out object value) {
			if (variableValues == null)
				variableValues = new VariableValues(theMethod.Body.Variables, allBlocks);
			var val = variableValues.GetValue(variable);
			if (!val.IsValid()) {
				value = null;
				return false;
			}
			value = val.Value;
			return true;
		}
Ejemplo n.º 3
0
		public int Decrypt(MethodDef method, List<Block> allBlocks) {
			if (!HasHandlers)
				return 0;
			try {
				theMethod = method;
				callResults = new List<CallResult>();
				this.allBlocks = allBlocks;

				FindAllCallResults();
				InlineAllCalls();
				InlineReturnValues();
				return callResults.Count;
			}
			catch {
				errors++;
				throw;
			}
			finally {
				theMethod = null;
				callResults = null;
				this.allBlocks = null;
				variableValues = null;
			}
		}
Ejemplo n.º 4
0
 void getLocalVariableValue(VariableDefinition variable, out object value)
 {
     if (variableValues == null)
         variableValues = new VariableValues(blocks.Locals, allBlocks);
     var val = variableValues.getValue(variable);
     if (!val.isValid())
         throw new ApplicationException("Could not get value of local variable");
     value = val.Value;
 }
Ejemplo n.º 5
0
 bool getLocalVariableValue(VariableDefinition variable, out object value)
 {
     if (variableValues == null)
         variableValues = new VariableValues(blocks.Locals, allBlocks);
     var val = variableValues.getValue(variable);
     if (!val.isValid()) {
         value = null;
         return false;
     }
     value = val.Value;
     return true;
 }