Esempio n. 1
0
        public static object SearchMethodBy(CallHijacker.Function Function, MethodBase method, object[] Parameters)
        {
            bool flag = Function.SearchBy == "MethodName";

            if (flag)
            {
                bool flag2 = method.Name == Function.SearchFor.ToString();
                if (flag2)
                {
                    bool flag3 = Function.ContinueAdvanced != null;
                    if (flag3)
                    {
                        return(SearchMethodBy(Function.ContinueAdvanced, method, Parameters));
                    }
                    return(Function.ReplaceResultWith);
                }
            }
            bool flag4 = Function.SearchBy == "Parameters";

            if (flag4)
            {
                bool flag5 = Parameters[Function.Parameter].ToString().Contains(Function.SearchFor.ToString());
                if (flag5)
                {
                    bool flag6 = Function.ContinueAdvanced != null;
                    if (flag6)
                    {
                        return(SearchMethodBy(Function.ContinueAdvanced, method, Parameters));
                    }
                    return(Function.ReplaceResultWith);
                }
            }
            bool flag7 = Function.SearchBy == "MDToken";

            if (flag7)
            {
                bool flag8 = method.MetadataToken == Convert.ToInt32(Function.SearchFor);
                if (flag8)
                {
                    bool flag9 = Function.ContinueAdvanced != null;
                    if (flag9)
                    {
                        return(SearchMethodBy(Function.ContinueAdvanced, method, Parameters));
                    }
                    return(true);
                }
            }
            return("Rip");
        }
Esempio n. 2
0
 // Token: 0x06000002 RID: 2 RVA: 0x0000205C File Offset: 0x0000025C
 public static object HandleInvoke(MethodBase method, object obj2, object[] Parameters)
 {
     try {
         if (Utils.Configuration.Debug)
         {
             object objj = null;
             try {
                 objj = method.Invoke(obj2, Parameters);
             } catch {
                 objj = null;
             }
             string debug = "Calling Method: " + method.ToString() + "\nMethodName: " + method.Name + "\nParameters: \n";
             for (int i = 0; i < Parameters.Length; i++)
             {
                 debug += "Param[" + i + "]" + " Value: " + Parameters[i].ToString() + "\n";
             }
             debug += "MDToken: " + method.MetadataToken + "\n";
             System.IO.File.AppendAllText("Debug.txt", debug + Environment.NewLine + "------------------------" + Environment.NewLine);
             return(objj);
         }
         using (List <CallHijacker.Function> .Enumerator enumerator = Utils.Configuration.Functions.GetEnumerator()) {
             if (enumerator.MoveNext())
             {
                 CallHijacker.Function funct = enumerator.Current;
                 object shit = Utils.SearchMethodBy(funct, method, Parameters);
                 bool   flag = shit is string;
                 if (!flag)
                 {
                     return(shit);
                 }
                 bool flag2 = shit.ToString() == "Rip";
                 if (flag2)
                 {
                     return(method.Invoke(obj2, Parameters));
                 }
                 return(shit);
             }
         }
     } catch {
         return(null);
     }
     return(null);
 }