Esempio n. 1
0
        public void KeyEnable()
        {
            InputHooked.deaktivateFullControl(process);
            WriteEnabled = true;

            activeTB = this;
        }
Esempio n. 2
0
        public void KeyDisable()
        {
            InputHooked.activateFullControl(process);
            WriteEnabled = false;

            activeTB = null;
        }
Esempio n. 3
0
        public textArea(Process process, zCView view, int height)
        {
            this.process = process;
            this.view    = view;

            fontY = this.view.Font.GetFontY();
            fontY = InputHooked.PixelToVirtualY(process, fontY);

            int lines = height / fontY;

            zString empty = zString.Create(process, "");

            vt = new zCViewText[lines];
            for (int i = 0; i < lines; i++)
            {
                vt[i]       = view.CreateText(0, i * fontY, empty);
                vt[i].Timed = 0;
                vt[i].Timer = -1;
            }
            empty.Dispose();


            Inputenabled = true;
            InputHooked.receivers.Add(this);
        }
Esempio n. 4
0
        public void setValue(int value)
        {
            this.value = value;

            //Breite berechnen!
            int[] sizeB = InputHooked.PixelToVirtual(Process, new int[] { 180 - 7, 20 - 3 });

            double valProcent = 100.0 / (double)max * (double)value;
            double size       = (double)sizeB[0] / 100.0 * valProcent;

            frontView.SetSize((int)size, sizeB[1]);
        }
Esempio n. 5
0
        public void KeyPressed(int key)
        {
            if (!Inputenabled || (activeTB != null && activeTB != this) || (textBox.activeTB != null))
            {
                return;
            }
            if (WinApi.User.Window.GetWindowThreadProcessId(WinApi.User.Window.GetForegroundWindow()) != process.ProcessID ||
                zCConsole.Console(process).IsVisible() == 1)
            {
                return;
            }

            if (!WriteEnabled && key == startWritingKey)
            {
                KeyEnable();
                return;
            }

            if (!WriteEnabled)
            {
                return;
            }
            if (key == 8)
            {
                if (text.Length == 0)
                {
                    return;
                }
                text = text.Substring(0, text.Length - 1);
                setText(text);
                return;
            }

            if (key == newLineKey)
            {
                text += "\n";
                setText(text);
                return;
            }

            String keyVal = Convert.ToString((char)key);

            keyVal = GetCharsFromKeys((VirtualKeys)key, InputHooked.IsPressed((int)VirtualKeys.Shift), InputHooked.IsPressed((int)VirtualKeys.Control) && InputHooked.IsPressed((int)VirtualKeys.Menu));


            text += keyVal;
            setText(text);
        }
Esempio n. 6
0
        public Bar(Process process, int posX, int posY, String frontTex, String backTex)
        {
            Process = process;


            int[] size  = InputHooked.PixelToVirtual(process, new int[] { 180, 20 });
            int[] sizeB = InputHooked.PixelToVirtual(process, new int[] { 180 - 7, 20 - 3 });
            int[] posB  = InputHooked.PixelToVirtual(process, new int[] { 7, 3 });


            backView = zCView.Create(process, posX, posY, size[0], size[1]);
            zString tex = zString.Create(process, backTex);

            backView.InsertBack(tex);
            tex.Dispose();

            frontView = zCView.Create(process, posX + posB[0], posY + posB[1], sizeB[0], sizeB[1]);
            tex       = zString.Create(process, frontTex);
            frontView.InsertBack(tex);
            tex.Dispose();
        }
Esempio n. 7
0
        public static Int32 Update(String message)
        {
            try
            {
                cursor_fX += Process.ReadInt(9246300) * 40f * Process.ReadFloat(9019720);
                cursor_fY += Process.ReadInt(9246304) * 40f * Process.ReadFloat(9019724);



                if (cursor_fX < 0)
                {
                    cursor_fX = 0;
                }
                if (cursor_fX > 7950)
                {
                    cursor_fX = 7950;
                }
                if (cursor_fY > 7950)
                {
                    cursor_fY = 7950;
                }
                if (cursor_fY < 0)
                {
                    cursor_fY = 0;
                }

                InputHooked.WheelChanged(Process.ReadInt(9246300 + 8));

                int keyLeft  = Process.ReadInt(9246300 + 12);
                int keyMid   = Process.ReadInt(9246300 + 16);
                int keyRight = Process.ReadInt(9246300 + 20);

                if (keystats[0] == 1 && keyLeft == 0)
                {
                    InputHooked.SendKeyReleased((byte)VirtualKeys.LeftButton);
                }
                if (keystats[0] == 0 && keyLeft == 1)
                {
                    InputHooked.SendKeyPressed((byte)VirtualKeys.LeftButton);
                }
                keystats[0] = keyLeft;


                if (noHandle)
                {
                    Process.Write(new byte[24], 9246300);
                }

                if (pView == null)
                {
                    return(0);
                }

                pView.Top();
                pView.SetPos((int)cursor_fX, (int)cursor_fY);
            }
            catch (Exception ex)
            {
                zERROR.GetZErr(Process.ThisProcess()).Report(4, 'G', ex.ToString(), 0, "Program.cs", 0);
            }
            return(0);
        }
Esempio n. 8
0
        public void KeyPressed(int key)
        {
            if (!Inputenabled || (activeTB != null && activeTB != this) || (textArea.activeTB != null))
            {
                return;
            }
            if (WinApi.User.Window.GetWindowThreadProcessId(WinApi.User.Window.GetForegroundWindow()) != process.ProcessID ||
                zCConsole.Console(process).IsVisible() == 1)
            {
                return;
            }

            if (!WriteEnabled && key == startWritingKey)
            {
                KeyEnable();
                return;
            }

            if (!WriteEnabled)
            {
                return;
            }
            if (key == 8)
            {
                if (text.Length == 0)
                {
                    return;
                }
                text = text.Substring(0, text.Length - 1);
                vt.Text.Set(text);
                return;
            }
            //if (((int)key < 0x30 || (int)key > 0x5A) && (int)key != 0x20 && (int)key != 222 && (int)key != 192
            //    && (int)key != 186 && (int)key != 219 && (int)key != (int)VirtualKeys.OEMPeriod
            //    && (int)key != (int)VirtualKeys.OEMComma && (int)key != (int)VirtualKeys.OEMMinus)
            //    return;


            String keyVal = Convert.ToString((char)key);

            keyVal = GetCharsFromKeys((VirtualKeys)key, InputHooked.IsPressed((int)VirtualKeys.Shift), InputHooked.IsPressed((int)VirtualKeys.Control) && InputHooked.IsPressed((int)VirtualKeys.Menu));
            //if ((int)key == 222)
            //    keyVal = "Ä";
            //if ((int)key == 192)
            //    keyVal = "Ö";
            //if ((int)key == 186)
            //    keyVal = "Ü";
            //if ((int)key == 219)
            //    keyVal = "ß";

            //if ((int)key == (int)VirtualKeys.N1 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "!";
            //if ((int)key == (int)VirtualKeys.N2 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "\"";
            //if ((int)key == (int)VirtualKeys.N3 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "§";
            //if ((int)key == (int)VirtualKeys.N4 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "$";
            //if ((int)key == (int)VirtualKeys.N5 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "%";
            //if ((int)key == (int)VirtualKeys.N7 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "/";
            //if ((int)key == (int)VirtualKeys.N8 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "(";
            //if ((int)key == (int)VirtualKeys.N9 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = ")";
            //if ((int)key == (int)VirtualKeys.N0 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "=";
            //if ((int)key == 219 && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "?";


            //if ((int)key == (int)VirtualKeys.N7 && InputHooked.IsPressed((int)VirtualKeys.RightMenu))
            //    keyVal = "{";
            //if ((int)key == (int)VirtualKeys.N0 && InputHooked.IsPressed((int)VirtualKeys.RightMenu))
            //    keyVal = "}";
            //if ((int)key == 219 && InputHooked.IsPressed((int)VirtualKeys.RightMenu))
            //    keyVal = "\\";

            //if ((int)key == (int)VirtualKeys.OEMPeriod)
            //    keyVal = ".";
            //if ((int)key == (int)VirtualKeys.OEMPeriod && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = ":";
            //if ((int)key == (int)VirtualKeys.OEMComma)
            //    keyVal = ",";
            //if ((int)key == (int)VirtualKeys.OEMComma && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = ";";
            //if ((int)key == (int)VirtualKeys.OEMMinus)
            //    keyVal = "-";
            //if ((int)key == (int)VirtualKeys.OEMMinus && InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = "_";
            //if (!InputHooked.IsPressed((int)VirtualKeys.Shift))
            //    keyVal = keyVal.ToLower();

            text += keyVal;
            vt.Text.Add(keyVal);
        }
Esempio n. 9
0
 public void setPosition(int x, int y)
 {
     int[] sizeB = InputHooked.PixelToVirtual(Process, new int[] { 7, 3 });
     backView.SetPos(x, y);
     frontView.SetPos(x + sizeB[0], y + sizeB[1]);
 }