예제 #1
0
 public static GClass927.GStruct3 smethod_2(IntPtr intptr_0, IntPtr intptr_1, out int int_0)
 {
     int_0 = 0;
     GClass927.GStruct3 result = default(GClass927.GStruct3);
     if (GClass927.smethod_1())
     {
         GClass927.GStruct2 gstruct = default(GClass927.GStruct2);
         if (GClass927.VirtualQueryEx(intptr_0, intptr_1, out gstruct, (uint)Marshal.SizeOf(typeof(GClass927.GStruct2))) != 0)
         {
             result.intptr_1 = gstruct.intptr_1;
             result.int_0    = gstruct.int_0;
             result.intptr_0 = gstruct.intptr_0;
             result.int_1    = gstruct.int_2;
             result.long_0   = (long)gstruct.int_1;
             result.State    = gstruct.State;
             result.int_2    = gstruct.int_3;
             return(result);
         }
         int_0 = Marshal.GetLastWin32Error();
     }
     else
     {
         if (GClass927.VirtualQueryEx_1(intptr_0, intptr_1, out result, (uint)Marshal.SizeOf(typeof(GClass927.GStruct3))) != 0)
         {
             return(result);
         }
         int_0 = Marshal.GetLastWin32Error();
     }
     return(result);
 }
예제 #2
0
    public static bool smethod_1(IntPtr intptr_0, Action <int> action_0 = null)
    {
        List <IntPtr> list = new GClass928(intptr_0).method_0();
        uint          num;

        GClass927.GetWindowThreadProcessId(intptr_0, out num);
        Process processById = Process.GetProcessById((int)num);

        list.Reverse();
        List <uint> list2 = list.Select(new Func <IntPtr, uint>(GClass926.< > c.< > c_0.method_0)).ToList <uint>();

        list2.Add(num);
        if (processById.ProcessName.StartsWith("chrome"))
        {
            list2 = Process.GetProcessesByName("chrome").Select(new Func <Process, uint>(GClass926.< > c.< > c_0.method_1)).ToList <uint>();
            List <uint> list3 = new List <uint>();
            foreach (uint num2 in list2)
            {
                string text = GClass927.smethod_3(num2);
                if (text != null && text.Contains("flash"))
                {
                    list3.Add(num2);
                    Debug.WriteLine(string.Format("Found chrome flash player @{0:X2}", num2));
                }
            }
            list2 = list3;
        }
        list2 = list2.GroupBy(new Func <uint, uint>(GClass926.< > c.< > c_0.method_2)).Select(new Func <IGrouping <uint, uint>, uint>(GClass926.< > c.< > c_0.method_3)).ToList <uint>();
        bool flag = false;
        long num3 = 0L;

        foreach (uint int_ in list2)
        {
            GClass925 gclass = new GClass925((int)int_);
            if (!gclass.method_6())
            {
                MessageBox.Show("Your browser is compiled for different architecture. Please use the " + (GClass927.smethod_1() ? "64" : "32") + "-bit version of PErkava.");
                return(false);
            }
            foreach (GClass927.GStruct3 gstruct in gclass.method_4())
            {
                foreach (IntPtr intptr_ in GClass926.smethod_0(gclass, gstruct, Encoding.UTF8.GetBytes("cc0306d7b0f0c671000bd655485744417a868b29dd77619e42b51f70c28e67d0bbc2caf9dd364cb0419217bcfba86c33735b543fae2b666059b59c631955962afa1f97e0f49f92bf1a5463ae89c751a661e0485c2ec6e011634abfb4a4142157")))
                {
                    flag = true;
                    gclass.method_7(intptr_, Encoding.UTF8.GetBytes("ef09b1bcec67808eeff374b1b51fb155edaac4fcc7a78ed75d5848d6e9eaabee41dec018bb5482d01acea8ce13688bfe33076dde70f06febb80cf3b7327953fb32c08889b815587ded2cdd056d0ec9965b894751848766c27fdee32c707b6fc9"));
                }
                num3 += gstruct.long_0;
                if (action_0 != null)
                {
                    action_0((int)(num3 / 1024L / 1024L));
                }
            }
            if (flag)
            {
                PErkava.hashSet_0.Add((uint)gclass.method_0());
            }
        }
        return(flag);
    }
예제 #3
0
    private void timer_0_Tick(object sender, EventArgs e)
    {
        IntPtr    foregroundWindow = GClass927.GetForegroundWindow();
        GClass932 proxy            = null;

        PErkava.concurrentDictionary_0.TryGetValue(foregroundWindow, out proxy);
        this.Proxy = proxy;
    }
예제 #4
0
    public GClass5()
    {
        GClass5.smethod_0();
        this.logger_0 = LogManager.GetLogger("DOPE");
        this.logger_0.Info("Loading DOPE {arch} {version} on {architecture} ({os})", new object[]
        {
            GClass927.smethod_1() ? "x86" : "x64",
            Constants.VersionString,
            Environment.Is64BitOperatingSystem ? "x64" : "x86",
            Environment.OSVersion.VersionString
        });
        AppDomain.CurrentDomain.FirstChanceException += this.method_0;
        AppDomain.CurrentDomain.UnhandledException   += this.method_2;
        base.ShutdownMode = ShutdownMode.OnMainWindowClose;
        GClass82.smethod_2();
        bool flag;

        using (WindowsIdentity current = WindowsIdentity.GetCurrent())
        {
            flag = new WindowsPrincipal(current).IsInRole(WindowsBuiltInRole.Administrator);
        }
        PErkava.IsSupported = flag;
        try
        {
            PErkava.smethod_3();
        }
        catch
        {
            PErkava.IsSupported = false;
        }
        if (flag && PErkava.IsSupported)
        {
            try
            {
                GClass933 gclass = new GClass933();
                gclass.Start();
                PErkava.Host = gclass;
            }
            catch
            {
            }
        }
        this.logger_0.Info("PErkava support status: {status}", PErkava.IsSupported);
        if (PErkava.IsSupported)
        {
            this.logger_0.Info("Use legacy proxy: {proxy}", PErkava.smethod_2());
        }
        AppDomain.CurrentDomain.ProcessExit += this.method_1;
    }
예제 #5
0
    public bool method_6()
    {
        this.method_5(new List <GClass927.GStruct3>());
        GClass927.GStruct1 gstruct = default(GClass927.GStruct1);
        GClass927.GetSystemInfo(out gstruct);
        this.intptr_0 = gstruct.intptr_0;
        this.intptr_1 = gstruct.intptr_1;
        long   num  = (long)this.intptr_0;
        long   num2 = (long)this.intptr_1;
        IntPtr intPtr;

        this.method_3(intPtr = GClass927.OpenProcess(5176, false, this.method_0()));
        IntPtr intPtr2 = intPtr;

        GClass927.GStruct3 gstruct2 = default(GClass927.GStruct3);
        if (GClass927.smethod_0(intPtr2))
        {
            num2 = Math.Min(2147483647L, num2);
        }
        this.intptr_1 = (IntPtr)num2;
        int num3 = 0;

        while (num < num2)
        {
            int num4;
            gstruct2 = GClass927.smethod_2(intPtr2, this.intptr_0, out num4);
            if (num4 == 0)
            {
                if (gstruct2.int_1 == 4 && gstruct2.State == 4096)
                {
                    this.method_4().Add(gstruct2);
                }
                num          += gstruct2.long_0;
                this.intptr_0 = new IntPtr(num);
                num3++;
            }
            else
            {
                if (num3 == 0)
                {
                    throw new Win32Exception(num4);
                }
                return(true);
            }
        }
        return(true);
    }
예제 #6
0
 private void method_10(GClass91 gclass91_0, BinaryStream binaryStream_0, byte[] byte_0, int int_0)
 {
     if (this.method_1() == IntPtr.Zero)
     {
         this.method_2(GClass927.GetForegroundWindow());
     }
     if (int_0 == 23 && Encoding.UTF8.GetString(byte_0).Contains("policy"))
     {
         byte[] bytes = Encoding.ASCII.GetBytes("<cross-domain-policy><allow-access-from domain=\"*\" to-ports=\"*\" /></cross-domain-policy>\0");
         gclass91_0.method_3().GetStream().Write(bytes, 0, bytes.Length);
         try
         {
             gclass91_0.method_8();
         }
         catch
         {
         }
         PErkava.concurrentDictionary_2[this.method_1()] = false;
         if (!this.method_9())
         {
             Debug.WriteLine("Patching failed");
             MessageBox.Show("Could not patch the client. This could mean that PErkava doesn't yet support this client version.");
             return;
         }
         PErkava.concurrentDictionary_2[this.method_1()] = true;
         return;
     }
     else
     {
         if (this.bool_3)
         {
             this.bool_3 = false;
             int_0--;
             long position = binaryStream_0.Position;
             binaryStream_0.Position = position + 1L;
         }
         GClass84 <GClass857> gclass = this.gclass84_0;
         if (gclass == null)
         {
             return;
         }
         gclass.method_10(binaryStream_0, byte_0, int_0);
         return;
     }
 }
예제 #7
0
    public bool method_9()
    {
        IntPtr foregroundWindow = GClass927.GetForegroundWindow();

        this.method_2(foregroundWindow);
        this.Status = "Getting ready.";
        PErkava.concurrentDictionary_0[foregroundWindow] = this;
        try
        {
            this.Status = "Patching result: " + "success";
            return(true);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message + ex.StackTrace + ex.ToString());
        }
        return(false);
    }
예제 #8
0
    public bool method_7(IntPtr intptr_3, byte[] byte_0)
    {
        int num = 0;

        return(GClass927.WriteProcessMemory(this.method_2(), intptr_3, byte_0, byte_0.Length, ref num));
    }
예제 #9
0
    public bool method_8(IntPtr intptr_3, byte[] byte_0, int int_1)
    {
        int num = 0;

        return(GClass927.ReadProcessMemory(this.method_2(), intptr_3, byte_0, int_1, ref num));
    }
예제 #10
0
    public static bool smethod_0(IntPtr intptr_0)
    {
        bool flag;

        return(!Environment.Is64BitOperatingSystem || ((Environment.OSVersion.Version.Major > 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1)) && (GClass927.IsWow64Process(intptr_0, out flag) && flag)));
    }