Résolu [AIDE] Besoin d'aide Fonction

Statut
N'est pas ouverte pour d'autres réponses.

F3F3_64

Membre
Inscription
12 Mai 2012
Messages
43
Réactions
10
Points
13 679
RGCoins
25
SUJET PEUT ETRE CLOSE
Bonjour,


Voila je voudrait savoir comment insérer une fonction dans un menu HUD ELEM pour ghost bien sur le menu il est fonctionnel mes il manque les offset et les byte je ne voit pas ou est comment insérer
si pouvait donner un exemple comment mètre exmple dans ( fun menu / option1 mètre juste redbox ou radar activer et désactiver et les offset et byte ou il vont )

je mes le code en 2 parti car il contient plus de 40000 caractère
PHP:
using System;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        //Booleans
        decimal[] jetcount = new decimal[18];
        decimal[] count = new decimal[18];
        bool[] MenuOpen = new bool[18];
        int[] MenuScroll = new int[18];
        string[] SubMenu = new string[18];
        string[] LoadedMenuString = new string[18];
        public static string[] Status = new string[18];
        public static bool[] IsVerified = new bool[18];
        public static string[] LoadedTitleString = new string[18];

        public Form1()
        {
            InitializeComponent();
            DEX.ChangeAPI(SelectAPI.TargetManager);
            textBox2.Enabled = false;
        }

        private static PS3API DEX = new PS3API();

        //Functions

        public byte[] GetMemory2(uint address, int length)
        {
            byte[] buffer = new byte[length];
            DEX.GetMemory(address, buffer);
            return buffer;
        }

        public static void SetMemory(uint Address, byte[] Bytes)
        {
            DEX.SetMemory(Address, Bytes);
        }

        public static void GetMemoryHUD(uint Address, ref byte[] Bytes)
        {
            DEX.GetMemory(Address, Bytes);
        }
        public static void GetMemory1(uint Address, ref byte[] bytes)
        {
            DEX.GetMemory(Address, bytes);
        }

        class PS3
        {
            public static uint[] ProcessIDs;
            public static uint ProcessID;
            public static void Connect()
            {
                PS3TMAPI.InitTargetComms();
                PS3TMAPI.Connect(0, null);
            }
            public static void TurnOFF()
            {
                PS3TMAPI.PowerOff(0, true);
            }
            public static void Attach()
            {
                PS3TMAPI.GetProcessList(0, out ProcessIDs);
                ulong uProcess = ProcessIDs[0];
                ProcessID = Convert.ToUInt32(uProcess);
                PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
                PS3TMAPI.ProcessContinue(0, ProcessID);
            }

            public static void SetMemory(uint Address, byte[] Bytes)
            {
                PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, Bytes);
            }
            public static byte[] ReadMemory(uint addr, int lenght)
            {
                byte[] Get = new byte[lenght];
                GetMemory(addr, ref Get);
                return Get;
            }
            public static void GetMemory(uint Address, ref byte[] bytes)
            {
                DEX.GetMemory(Address, bytes);
            }

            public static string ReadString(uint addr)
            {
                byte[] Reader = new byte[1]; uint i = 0;
                List<byte> StringBuilder = new List<byte>();
                while (true)
                {
                    GetMemory(addr + i, ref Reader);
                    if (Reader[0] == 0x00)
                        break;
                    else
                        StringBuilder.Add(Reader[0]);
                    i++;
                }
                System.Text.UTF8Encoding Encode = new System.Text.UTF8Encoding();
                return Encode.GetString(StringBuilder.ToArray());
            }
            public static void WriteFloat(uint addr, float f)
            {
                byte[] Float = BitConverter.GetBytes(f);
                Array.Reverse(Float);
                SetMemory(addr, Float);
            }
            public static float ReadFloat(uint addr, int lenght)
            {
                byte[] F = ReadMemory(addr, 4);
                if (BitConverter.IsLittleEndian)
                {
                    Array.Reverse(F);
                }
                float myFloat = BitConverter.ToSingle(F, 0);
                return myFloat;
            }


        }
        class Conversions
        {
            public static byte[] ReverseBytes(byte[] input)
            {
                Array.Reverse(input);
                return input;
            }
            public static byte[] RandomizeRGBA()
            {
                byte[] RGBA = new byte[4];
                Random randomize = new Random();
                RGBA[0] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
                RGBA[1] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
                RGBA[2] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
                RGBA[3] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
                return RGBA;
            }
        }

        public static class Hud
        {
            public static class HElems
            {
                public static uint
                ELEM = 0xD55F88,
                FIX_ELEM = 0x3314F,
                FPS = 0x363148,
                xOffset = 0x04,
                yOffset = 0x08,
                textOffset = 0x40,
                fontOffset = 0x24,
                fontSizeOffset = 0x14,
                colorOffset = 0x30,
                relativeOffset = 0x28,
                widthOffset = 0x44,
                heightOffset = 0x48,
                shaderOffset = 0x4C,
                GlowColor = 0x8C,
                clientOffset = 0x10,
                alignOffset = 0x2C;
            }


            public static void Enable_Cacher()
            {
              SetMemory(0x2100000, new byte[32]);
                SetMemory(0x2105000, new byte[32]);
                SetMemory(Hud.HElems.FPS, new byte[] { 0x3C, 0x60, 0x02, 0x10, 0x80, 0x63, 0x00, 0x00, 0x2C, 0x03, 0x00, 0x00, 0x40, 0x82, 0x00, 0x08, 0x48, 0x00, 0x00, 0x88, 0x3C, 0x60, 0x02, 0x10, 0x4B, 0xCC, 0xFF, 0xA9, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x50, 0x00, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x6C });
                SetMemory(HElems.FIX_ELEM, new byte[] { 0x01 });
            }

            public static void ActivateIndex(int index, int type)
            {

                byte[] Typ = BitConverter.GetBytes(type);
                Array.Reverse(Typ);
                SetMemory(Hud.HElems.ELEM + 0xb8 * (uint)index, Typ);
            }

            public static byte[] ToHexFloat(float Axis)
            {
                byte[] bytes = BitConverter.GetBytes(Axis);
                Array.Reverse(bytes);
                return bytes;
            }

            public static byte[] RGBA(decimal R, decimal G, decimal B, decimal A)
            {
                byte[] RGBA = new byte[4];
                byte[] RVal = BitConverter.GetBytes(Convert.ToInt32(R));
                byte[] GVal = BitConverter.GetBytes(Convert.ToInt32(G));
                byte[] BVal = BitConverter.GetBytes(Convert.ToInt32(B));
                byte[] AVal = BitConverter.GetBytes(Convert.ToInt32(A));
                RGBA[0] = RVal[0];
                RGBA[1] = GVal[0];
                RGBA[2] = BVal[0];
                RGBA[3] = AVal[0];
                return RGBA;
            }

            public static void StoreIcon(int elemIndex, uint client, int shader, int width, int height, float x, float y, uint align, float sort, int r, int g, int b, int a)
            {
                uint elem = 0xD55F88 + (((uint)elemIndex) * 0xb8);
                byte[] ClientID = ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(client)));
                SetMemory(elem, new byte[0xB8]);
                SetMemory(elem, new byte[] { 0x00, 0x00, 0x00, 0x04 });
                SetMemory(elem + HElems.shaderOffset, ReverseBytes(BitConverter.GetBytes(shader)));
                SetMemory(elem + HElems.heightOffset, ReverseBytes(BitConverter.GetBytes(height)));
                SetMemory(elem + HElems.widthOffset, ReverseBytes(BitConverter.GetBytes(width)));
                SetMemory(elem + HElems.alignOffset, ReverseBytes(BitConverter.GetBytes(0)));
                SetMemory(elem + HElems.relativeOffset, ReverseBytes(BitConverter.GetBytes(0)));
                SetMemory(elem + HElems.xOffset, ToHexFloat(x));
                SetMemory(elem + HElems.yOffset, ToHexFloat(y));
                SetMemory(elem + HElems.colorOffset, RGBA(r, g, b, a));
                SetMemory(elem + HElems.clientOffset, ClientID);
            }

            public static byte[] CacheString(string Text)
            {
                SetMemory(HElems.FIX_ELEM, new byte[] { 0x01 }); //must patch this to make it work
                SetMemory(0x2100000, Encoding.ASCII.GetBytes(Text + "\0"));
                byte[] result = new byte[4];
                Thread.Sleep(100);
                GetMemory1(0x2105000, ref result);
                return result;
            }

            public static void SetGlow(uint elemIndex, int client,int r, int g, int b, int a)
            {
                uint elem = HElems.ELEM + ((elemIndex) * 0xB8);
                byte[] ClientID = ReverseBytes(BitConverter.GetBytes(client));
                SetMemory(elem + HElems.GlowColor, RGBA(r, g, b, a));
                SetMemory(elem + HElems.clientOffset, ClientID);
            }

            public static void SetGlowText(uint elemIndex, int client, string Text, int font, float fontScale, int x, int y, uint align, float sort, int r, int g, int b, int a, int r1, int g1, int b1, int a1)
            {
                uint elem = HElems.ELEM + ((elemIndex) * 0xB8);
                byte[] ClientID = ReverseBytes(BitConverter.GetBytes(client));
                SetMemory(elem, new byte[0xB4]);
                SetMemory(elem, new byte[] { 0x00, 0x00, 0x00, 0x01 });
                SetMemory(elem + HElems.textOffset, CacheString(Text));
                SetMemory(elem + HElems.fontOffset, ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(font))));
                SetMemory(elem + HElems.alignOffset, ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(0))));
                SetMemory(elem + HElems.relativeOffset, ReverseBytes(BitConverter.GetBytes(0)));
                SetMemory(elem + HElems.fontSizeOffset, ToHexFloat(fontScale));
                SetMemory(elem + HElems.xOffset, ToHexFloat(x));
                SetMemory(elem + HElems.yOffset, ToHexFloat(y));
                SetMemory(elem + HElems.colorOffset, RGBA(r, g, b, a));
                SetMemory(elem + HElems.GlowColor, RGBA(r1, g1, b1, a1));
                SetMemory(elem + HElems.clientOffset, ClientID);
            }

            public static void StoreTextElem(int elemIndex, int client, string Text, int font, float fontScale, int x, int y, uint align, float sort, int r, int g, int b, int a)
            {
                string setText = Text + "\0";
                byte[] TextIndex = Hud.CacheString(setText);
                uint elem = Hud.HElems.ELEM + ((Convert.ToUInt32(elemIndex)) * 0xB8);
                byte[] ClientID = ReverseBytes(BitConverter.GetBytes(client));
                SetMemory(elem, new byte[0xB4]);
                SetMemory(elem, new byte[] { 0x00, 0x00, 0x00, 0x01 });
                SetMemory(elem + HElems.textOffset, CacheString(Text));
                SetMemory(elem + HElems.fontOffset, ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(font))));
                SetMemory(elem + HElems.alignOffset, ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(0))));
                SetMemory(elem + HElems.relativeOffset, ReverseBytes(BitConverter.GetBytes(0)));
                SetMemory(elem + HElems.fontSizeOffset, ToHexFloat(fontScale));
                SetMemory(elem + HElems.xOffset, ToHexFloat(x));
                SetMemory(elem + HElems.yOffset, ToHexFloat(y));
                SetMemory(elem + HElems.colorOffset, RGBA(r, g, b, a));
                //SetMemory(elem + HElems.GlowColor, RGBA(r1, g1, b1, a1));
                SetMemory(elem + HElems.clientOffset, ClientID);
            }

            public static byte[] UInt32ToBytes(uint input)
            {
                byte[] bytes = BitConverter.GetBytes(input);
                Array.Reverse(bytes);
                return bytes;
            }

            public static byte[] ReverseBytes(byte[] inArray)
            {
                Array.Reverse(inArray);
                return inArray;
            }
            public static byte[] uintBytes(uint input)
            {
                byte[] data = BitConverter.GetBytes(input);
                Array.Reverse(data);
                return data;
            }
        }
        public void SV_GameSendServerCommand(int Client, string Command)
        {
            GHOSTS.RPC.Call(0x005A610C, new object[] { (int)Client, (int)0, Command });
        }

        private void iPrintln(int client, string TextiPrintIn)
        {
            SV_GameSendServerCommand(client, "e \"" + TextiPrintIn + "\"");
        }

        private void iPrintlnBold(int clientNumber, string TextiPrintinBold)
        {
            SV_GameSendServerCommand(clientNumber, "c \"" + TextiPrintinBold + "\"");
        }

        public static byte[] UInt32ToBytes(uint input)
        {
            byte[] bytes = BitConverter.GetBytes(input);
            Array.Reverse(bytes);
            return bytes;
        }

        public static byte[] ReverseBytes(byte[] inArray)
        {
            Array.Reverse(inArray);
            return inArray;
        }
        public static byte[] uintBytes(uint input)
        {
            byte[] data = BitConverter.GetBytes(input);
            Array.Reverse(data);
            return data;
        }


        public class Buttons
        {
            public static UInt32
            X = 262144,
            Square = 805306368,
            L1 = 526336,
            L2 = 8388608,
            L3 = 35651584,
            R1 = 16777216,
            R2 = 4194304,
            R3 = 67108868,
            Crouch = 131072,
            Prone = 65536,
            StartButton = 32768;
        }
        public Boolean DetectButton(UInt32 clientIndex, UInt32 Button)
        {
            if (BitConverter.ToUInt32(GetMemory(0xF15B60 + (clientIndex * 0x3680), 4), 0) == Button)
                return true;
            else return false;
        }


        public SByte ReadSByte(UInt32 offset)
        {
            return (SByte)GetMemory2(offset, 1)[0];
        }

        public UInt32 ReadUInt32(UInt32 offset)
        {
            Byte[] uint32 = GetMemory2(offset, 4);
            Array.Reverse(uint32, 0, 4);
            return BitConverter.ToUInt32(uint32, 0);
        }
        public void WriteInt16(UInt32 offset, Int16 input)
        {
            Byte[] int16 = new Byte[2];
            BitConverter.GetBytes(input).CopyTo(int16, 0);
            Array.Reverse(int16, 0, 2);
            SetMemory(offset, int16);
        }
        public void WriteSByte(UInt32 Offset, SByte input)
        {
            SetMemory(Offset, new Byte[] { (Byte)input });
        }

        /// <summary>Write an integer 32 bits.</summary>
        public void WriteInt32(UInt32 offset, Int32 input)
        {
            Byte[] int32 = new Byte[4];
            BitConverter.GetBytes(input).CopyTo(int32, 0);
            Array.Reverse(int32, 0, 4);
            SetMemory(offset, int32);
        }
        public Single ReadFloat(UInt32 offset)
        {
            Byte[] single = GetMemory2(offset, 4);
            Array.Reverse(single, 0, 4);
            return BitConverter.ToSingle(single, 0);
        }
        public void WriteFloat(UInt32 offset, Single input)
        {
            Byte[] single = new Byte[4];
            BitConverter.GetBytes(input).CopyTo(single, 0);
            Array.Reverse(single, 0, 4);
            SetMemory(offset, single);
        }


        public static void MoveShader(uint index, double Y_, float TextSize_)
        {
            byte[] Y = new byte[4];
            byte[] TextSize = new byte[4];
            Y = BitConverter.GetBytes(Convert.ToSingle(Y_));
            TextSize = BitConverter.GetBytes(Convert.ToSingle(TextSize_));
            byte[] Width = new byte[4];
            byte[] Height = new byte[4];

            Array.Reverse(Y);
            Array.Reverse(TextSize);
            SetMemory(0xD55F88 + (index * 0xB8) + 8, Y);
            SetMemory(0xD55F88 + (index * 0xB8) + 12, TextSize);
        }

        public static bool IsAllowedInMenu(int client)
        {
            if (Status[client] != "Un-Verified" && IsVerified[client] == true)
                return true;
            else
                return false;
        }

        public static string NamesVer;
        public static string Names;
        public string GetNamesVer(int client)
        {
            NamesVer = method_4Ver(method_5((uint)client));
            return NamesVer;
        }

        private string getLocalName()
        {
            string host;
            byte[] yournamebytes = new byte[18];
            GetMemory1(0x017354b8, ref yournamebytes);
            host = Encoding.ASCII.GetString(yournamebytes);
            host.Replace(Convert.ToChar(0x0).ToString(), string.Empty);
            return host;
        }

        public string method_5(uint uint_8)
        {
            byte[] buffer = new byte[0x20];
            GetMemory1(0x00f15c1c + (uint_8 * 0x3600), ref buffer);
            return BitConverter.ToString(buffer).Replace("00", string.Empty).Replace("-", string.Empty).Replace("^0", string.Empty).Replace("^1", string.Empty).Replace("^2", string.Empty).Replace("^3", string.Empty).Replace("^4", string.Empty).Replace("^5", string.Empty).Replace("^6", string.Empty).Replace("^7", string.Empty).Replace("^8", string.Empty).Replace("^9", string.Empty) + "\0";
        }

        public string GetNames()
        {
            Names = "";
            for (int i = 0; i < 12; i++)
            {
                Names += method_4(method_5((uint)i), i);
            }
            return Names;
        }

        private string method_4(string string_5, int client)
        {
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i <= (string_5.Length - 2); i += 2)
            {
                builder.Append(Convert.ToString(Convert.ToChar(int.Parse(string_5.Substring(i, 2), NumberStyles.HexNumber))));
            }
            string str = string.Empty;
            if (builder.ToString() == str)
            {
                if (builder.ToString() == "")
                {
                    return "^1Not Connected\n";
                }
                else
                {
                    builder.Remove(builder.Length, 0);
                    return builder.ToString();
                }
            }
            return "[" + getVerColor(Status[client]) + Status[client] + "^7] " + builder.ToString() + "\n";
        }

        private string method_4Ver(string string_5)
        {
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i <= (string_5.Length - 2); i += 2)
            {
                builder.Append(Convert.ToString(Convert.ToChar(int.Parse(string_5.Substring(i, 2), NumberStyles.HexNumber))));
            }
            return builder.ToString();
        }

        private void ChangeAlpha(int index, int r, int g, int b, int alpha)
        {
            uint elem = 0xD55F88 + ((Convert.ToUInt32(index)) * 0xB8);
            SetMemory(elem + Hud.HElems.colorOffset, Hud.RGBA(r, g, b, alpha));
        }

        public static void ChangeTextSub(int index, string txt)
        {
            string NewText = txt + "\0";
            byte[] Textz = Hud.CacheString(NewText);
            uint elem = 0xD55F88 + ((Convert.ToUInt32(index)) * 0xB8);
            SetMemory(elem + Hud.HElems.textOffset, Textz);
        }

        public static void ChangeText(int index, string txt, int xAxis)
        {
            string NewText = txt + "\0";
            byte[] Textz = Hud.CacheString(NewText);
            uint elem = 0xD55F88 + ((Convert.ToUInt32(index)) * 0xB8);
            byte[] newX = new byte[4];
            newX = BitConverter.GetBytes(Convert.ToSingle(xAxis));
            Array.Reverse(newX);
            SetMemory(elem + Hud.HElems.xOffset, newX);
            SetMemory(elem + Hud.HElems.textOffset, Textz);
        }

        private void LoadSub(int client, string newSub)
        {
            TimeSpan span5 = TimeSpan.FromMilliseconds(20);
            MenuScroll[client] = 0;
            MoveScroller(client, MenuScroll[client]);
            //UpdateScrollBar(client);
            SubMenu[client] = newSub;
            LoadedTitleString[client] = getTitleString(SubMenu[client]);
            LoadedMenuString[client] = getMenuString(SubMenu[client], client);
            CallText(client, LoadedMenuString[client]);
            CallTitle(client, LoadedTitleString[client]);
        }

        //Sub Titles

        //Title of Sub Menu
        //What The Title Is When You Click Something In The Menu
        private string getTitleString(string sub)
        {
            if (sub == "Main Menu")
                return "Main Menu";
            else if (sub == "Host Menu")
                return "Host Menu";
            else if (sub == "Non Host")
                return "Non Host";
            else if (sub == "Account Menu")
                return "Account Menu";
            else if (sub == "Fun Menu")
                return "Fun Menu";
            else if (sub == "Stats Menu")
                return "Stats Menu";
            else if (sub == "Credits")
                return "Credits";
            else
                return "KRW OWNz";
        }

        //Ignore
        public static int IsVerText(int client)
        {
            if (Status[client] != "Un-Verified")
                return 1;
            else
                return 0;
        }

        //Ignore
        public static int IsVerShader(int client)
        {
            if (Status[client] != "Un-Verified")
                return 0;
            else
                return 0;
        }


        //Verification Start
        //Verification Has Some Other Parts of The Menu In It Aswell Like Max Scroll etc
        //I Put "Verification End" Where The Verification Parts Finish

        //Main Scroll Limit

        //How Far You Can Scroll Down On Main Menu
        //return 1; = you can scroll down twice, 2 = scroll down 3 times etc
        //This is for the main menu scroll
        //if you add anything to main menu change this to how many options so example 3 options make it return 2;
        //The else if is to tell how much the person can scroll if thats their status
        private int getMainScroll(int client)
        {
            if (Status[client] == "Host")
                return 5;
            else if (Status[client] == "Co-Host")
                return 1;
            else if (Status[client] == "VIP")
                return 1;
            else if (Status[client] == "Verified")
                return 1;
            else
                return 0;
        }

        //Main Options

        //Main Menu Options Here
        //What is shown on the main menu example, Account Menu, Host Menu shit like that
        //Use \n for a new line example: Line1\nLine2\nLine3 etc
        //Remember the options have to be in order with how your menu is.
        //Example you cant have it being Sub Menu 2\nCredits cause it will register Sub Menu 2 as sub menu and credits as sub menu 2
        //You gotta have it in order or change the if (scroll == 1) at Menu Selection Part
        private string getMainString(string status)
        {
            if (status == "Host")
                return "Host Menu\nNon Host\nAccount Menu\nFun Menu\nStats Menu\nCredits";
            else if (status == "Co-Host")
                return "Host Menu\nNon Host\nAccount Menu\nFun Menu\nStats Menu\nCredits";
            else if (status == "VIP")
                return "Host Menu\nNon Host\nAccount Menu\nFun Menu\nStats Menu\nCredits";
            else if (status == "Verified")
                return "Host Menu\nNon Host\nAccount Menu\nFun Menu\nStats Menu\nCredits";
            else
                return "KRW-1";
        }

        //This is the color it will set for that status
        private string getVerColor(string status)
        {
            if (status == "Host")
                return "^5";
            else if (status == "Co-Host")
                return "^6";
            else if (status == "VIP")
                return "^4";
            else if (status == "Verified")
                return "^5";
            else
                return "^1";
        }

        //Verification End

        //Sub Options

        //SubMenu Options Here
        //What Options are shown when you click a submenu (something from the main menu)
        //Example: if i click account it will show Sub Option 1 on line 1, Option 2 on line 2 and Option 3 on line 3
        private string getMenuString(string curSub, int client)
        {
            if (curSub == "Main Menu")
                return getMainString(Status[client]);
            else if (curSub == "Host Menu")
                return "Sub Option 1\nSub Option 2\nSub Option 3";
            else if (curSub == "Non Host")
                return "Sub Option 1\nSub Option 2\nSub Option 3";
            else if (curSub == "Account Menu")
                return "Sub Option 1\nSub Option 2\nSub Option 3";
            else if (curSub == "Fun Menu")
                return "Sub Option 1\nSub Option 2\nSub Option 3";
            else if (curSub == "Stats Menu")
                return "Sub Option 1\nSub Option 2\nSub Option 3";
            else if (curSub == "Credits")
                return "KRW-1\nShark\nBo\nxYARDSALEx";
            else
                return "N/A";
        }

        //Sub Scroll Limit

        //Determines How Far You Can Scroll In A Sub Menu
        //Since I have 3 Options in account menu I will make it return 2 (0 - Line 1, 1 - Line 2, 2 - Line 3 etc)
        private int getMaxScroll(string Submenu, int client)
        {
            if (Submenu == "Main Menu")
                return getMainScroll(client);
            else if (Submenu == "Host Menu")
                return 2;
            else if (Submenu == "Non Host")
                return 2;
            else if (Submenu == "Account Menu")
                return 2;
            else if (Submenu == "Fun Menu")
                return 2;
            else if (Submenu == "Stats Menu")
                return 2;
            else if (Submenu == "Credits")
                return 2;
            else
                return 0;
        }

        //Call Text

        //These two functions must be changed if you change the Title/Options Index
        private void CallTitle(int client, string titleTxt)
        {
            ChangeTextSub(126 + (15 * client), titleTxt);
        }

        private void CallText(int client, string txt)
        {
            ChangeTextSub(125 + (15 * client), txt);
        }
        //Call Text End

        private void MoveScroller(int client, int Scroll)
        {
            if (SmoothScroll == true)
            {
                float NewScroll = 0f;
                float CurrentIndex = ScrollbarY + (ScrollDistance * Scroll) - ScrollDistance;
                NewScroll = CurrentIndex + (ScrollDistance);

                for (float x = CurrentIndex; x < NewScroll + 1; x++)
                {
                    double math = x; //Fancy Scroll
                    MoveShader(123 + (15 * (uint)client), math, 0); //Moves Scroller
                }
            }

            if (SmoothScroll == false)
            {
                double math = ScrollbarY + (ScrollDistance * Scroll); //Non Fancy Scroll
                MoveShader(123 + (15 * (uint)client), math, 0); //Moves Scroller
            }
        }

        //Menu Design

        //Look of The Menu
        //Be Sure To Change It In ShowItem and HideItem or it wont work! (Only Modify Hide Item If You Add New Index's)
        //This Is Where You Set The X, Y, Width, Height, Index and anything else, ShowItem Is Where It Sets The Colour And Transparacy(Alpha)
        //If you move the Option text you must also change the scrollbar x and y depending on what variable(s) you changed
        //Change the y position from the scrollbar int, ScrollDistance is how far the scroller will move down this is good if you resize text or the scroller or something
        //SmoothScroll sets the scroll type

        int ScrollbarX = 200;
        int ScrollbarY = 62;
        int ScrollDistance = 25;
        bool SmoothScroll = false;
        public void DrawMenu(int client)
        {
            Thread.Sleep(100);
            Hud.StoreIcon(120 + (15 * client), (uint)client, 12, 1000, 500, -150, 0, 0, 0, 0, 0, 0, 0);//Wholescreen Background
            Hud.StoreIcon(121 + (15 * client), (uint)client, 12, 5, 500, 195, 0, 0, 0, 0, 0, 0, 0);//Sidebar Left
            Hud.StoreIcon(130 + (15 * client), (uint)client, 12, 5, 500, 400, 0, 0, 0, 0, 0, 0, 0);//Sidebar Right
            Hud.StoreIcon(131 + (15 * client), (uint)client, 12, 200, 5, 200, 45, 0, 0, 0, 0, 0, 0);//Topbar
            Hud.StoreIcon(122 + (15 * client), (uint)client, 12, 200, 999, 200, 0, 0, 0, 0, 0, 0, 0);//Menu Background
            Hud.StoreIcon(123 + (15 * client), (uint)client, 12, 200, 20, ScrollbarX, ScrollbarY, 0, 0, 0, 0, 0, 0);//Scrollbar
            Hud.StoreTextElem(126 + (15 * client), client, "Main Menu", 3, 3, 225, 10, 0, 0, 0, 0, 0, 0);//Title Text (The Title of Sub Menus aswell etc)
            Hud.StoreTextElem(125 + (15 * client), client, " ", 1, (float)0.9, 245, 60, 0, 0, 0, 0, 0, 0);//Options Text
            if (IsAllowedInMenu(client))
            {
                Hud.StoreIcon(133 + (15 * client), (uint)client, 12, 160, 80, -110, 210, 0, 0, 0, 0, 0, 260);//Instructions Background
                Hud.StoreTextElem(134 + (15 * client), client, "KRW-1's Menu\n[{+melee}] - Open Menu\n[{+activate}] - Close Menu\n[{+gostand}] - Select\n[{+attack}] - Scroll Down\n[{+speed_throw}] - Scroll Up", 1, (float)0.5, -80, 205, 0, 0, 0, 170, 255, 255);//Controls
            }
            HUDSet = false;
            ButtonMonitor.Start();//Starts Button Monitoring
        }

        //http://www.colorpicker.com - Get RGB From Here
        //Change Colour/Transperacy of Things Here
        //Example ChangeAlpha(index, r, g, b, a);
        //A - Alpha, Means Transparacy
        private void ShowItem(int client)
        {
            ChangeAlpha(120 + (15 * client), 0, 0, 0, 180);//Wholescreen Background
            ChangeAlpha(121 + (15 * client), 255, 0, 0, 255);//Sidebar Left
            ChangeAlpha(130 + (15 * client), 255, 0, 0, 255);//Sidebar Right
            ChangeAlpha(131 + (15 * client), 255, 0, 0, 255);//Topbar
            ChangeAlpha(122 + (15 * client), 0, 0, 0, 210);//Menu Background
            ChangeAlpha(123 + (15 * client), 255, 0, 0, 255);//Scrollbar
            ChangeAlpha(125 + (15 * client), 0, 170, 255, 255);//Options Text
            ChangeAlpha(126 + (15 * client), 0, 170, 255, 255);//Main Title Text
        }

        //Hides The Index's (Menu Items)
        //If You Add A New Index To DrawMenu You Have To Add It Here
        //Just Set The Transparacy/Alpha To 0
        //Example ChangeAlpha(index, 0, 0, 0, 0);
        private void HideItem(int client)
        {
            ChangeAlpha(120 + (15 * client), 0, 0, 0, 0);//Wholescreen Background
            ChangeAlpha(121 + (15 * client), 0, 175, 255, 0);//Sidebar Left
            ChangeAlpha(130 + (15 * client), 0, 175, 255, 0);//Sidebar Right
            ChangeAlpha(131 + (15 * client), 255, 255, 255, 0);//Topbar
            ChangeAlpha(122 + (15 * client), 0, 0, 0, 0);//Menu Background
            ChangeAlpha(123 + (15 * client), 0, 175, 255, 0);//Scrollbar
            ChangeAlpha(125 + (15 * client), 255, 255, 255, 0);//Options Text
            ChangeAlpha(126 + (15 * client), 255, 255, 255, 0);//Main Title Text
        }

        //Menu Look Ends Here

        public static byte[] GetMemory(uint offset, int length)
        {
            byte[] array = new byte[length];
            DEX.GetMemory(offset, array);
            return array;
        }

        private void freezeon(int ClientIndex)
        {
            byte[] freezeon = new byte[] { 0x04 };
            DEX.SetMemory(0xF15D9B + ((uint)ClientIndex * 0x3600), freezeon);
        }

        private void freezeoff(int ClientIndex)
        {
            byte[] freezeoff = new byte[] { 0x00 };
            DEX.SetMemory(0xF15D9B + ((uint)ClientIndex * 0x3600), freezeoff);
        }

        //Menu Selection

        //This is what happens when you click shit in the menu
        //Example if the sub is Account menu, option 0 (top line/option) it will print "test"
        private void MenuSelection(int client, int scroll, string Sub)
        {
            if (Sub == "Main Menu")
            {
                if (scroll == 0)
                {
                    LoadSub(client, "Host Menu");
                }
                if (scroll == 1)
                {
                    LoadSub(client, "Non Host");
                }
                if (scroll == 2)
                {
                    LoadSub(client, "Account menu");
                }
                if (scroll == 3)
                {
                    LoadSub(client, "Fun Menu");
                }
                if (scroll == 4)
                {
                    LoadSub(client, "Stats Menu");
                }
                if (scroll == 5)
                {
                    LoadSub(client, "Credits");
                }
            }
            if (Sub == "Host Menu")
            {
                if (scroll == 0)
                {
                    iPrintln(client, "^2Sub Option 1");

                }
                if (scroll == 1)
                {
                    iPrintln(client, "^2Sub Option 2");
                }
                if (scroll == 2)
                {
                    iPrintln(client, "^2Sub Option 3");
                }
            }
            if (Sub == "Non Host")
            {
                if (scroll == 0)
                {
                    iPrintln(client, "^5TEST 1");
                }
                if (scroll == 1)
                {
                    iPrintln(client,"^5TEST 2");
                }
                if (scroll == 2)
                {
                    iPrintln(client, "^5TEST 3");
                }
            }
            if (Sub == "Account Menu")
            {
                if (scroll == 0)
                {
                    iPrintln(client, "");
                }
                if (scroll == 1)
                {
                    iPrintln(client, "^5www.youtube.com/PiscesHD");
                }
                if (scroll == 2)
                {
                    iPrintln(client, "^0www.youtube.com/PiscesHD");
                }
            }
            if (Sub == "Fun Menu")
            {
                if (scroll == 0)
                {
                    iPrintln(client, "^2Sub Option 1");
                }
                if (scroll == 1)
                {
                    iPrintln(client, "^2Sub Option 2");
                }
                if (scroll == 2)
                {
                    iPrintln(client, "^2Sub Option 3");
                }
            }
            if (Sub == "Stats Menu")
            {
                if (scroll == 0)
                {
                    iPrintln(client, "^2Sub Option 1");
                }
                if (scroll == 1)
                {
                    iPrintln(client, "^2Sub Option 2");
                }
                if (scroll == 2)
                {
                    iPrintln(client, "^2Sub Option 3");
                }
            }
            if (Sub == "Credits")
            {
                if (scroll == 0)
                {
                    iPrintln(client, "byte[] NAME = new byte[] { 0x0F133D6 }");
                }
                if (scroll == 1)
                {
                    iPrintln(client, "^2Sub Option 2");
                }
                if (scroll == 2)
                {
                    iPrintln(client, "^2Sub Option 3");
                }
            }
        }

        //Main
        //Connection
        private void button1_Click(object sender, EventArgs e)
        {

        }

        //Change Name
        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("If You Have ''^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8'' In Your Name, The Menu WILL Not Work!", "Notice!");
            byte[] buffer = Encoding.ASCII.GetBytes(textBox1.Text); Array.Resize(ref buffer, buffer.Length + 1);
            SetMemory(0x017354b8, buffer);

            byte[] GetName = new byte[16];
            GetMemory1(0x017354b8, ref GetName);
            textBox1.Text = Encoding.ASCII.GetString(GetName);
        }
 
Dernière édition:
PHP:
        //Int Menu
        bool HUDSet;
        private void button3_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 18; i++)
            {
                jetcount[i] = (decimal)0.0;
                MenuOpen[i] = false;
                count[i] = (decimal)4.5;
                SubMenu[i] = "Main Menu";

                if (GetNamesVer(i) == textBox1.Text)
                {
                    IsVerified[i] = true;
                    iPrintln(-1, "^7Menu By ^0KRW-1!\n\n^7Subscribe To: ^5PiscesHD");
                    //Thread.Sleep(3000);
                    Status[i] = "Host"; //Currents Status's Un-Verified, Verified, VIP, Co-Host, Host
                    iPrintln(i, " ");
                    iPrintln(i, "Status: " + getVerColor(Status[i]) + Status[i]);
                    iPrintln(i, "Welcome ^5" + getLocalName());
                    HUDSet = false;
                }

                else if (GetNamesVer(i) == "PENY_Creation" || GetNamesVer(i) == " ")
                {
                    IsVerified[i] = true;
                    Status[i] = "Co-Host";
                    iPrintln(i, " ");
                    iPrintln(i, "Status: " + getVerColor(Status[i]) + Status[i]);
                    iPrintln(i, "Welcome ^5" + GetNamesVer(i));
                }

                else
                {
                    Status[i] = "Un-Verified";
                    IsVerified[i] = false;
                    iPrintln(i, "Welcome ^5" + GetNamesVer(i));
                    iPrintln(i, "Status: ^1" + Status[i]);
                }
            }

            if (HUDSet == false)
            {
                Hud.Enable_Cacher();
                iPrintln(-1, " ");
                iPrintln(-1, "Menu Status: ^2Initiating...");
                DrawMenu(0);
                DrawMenu(1);
                DrawMenu(2);
                DrawMenu(3);
                DrawMenu(4);
                iPrintln(-1, " ");
                iPrintln(-1, "Menu Status: ^2Initiating...");
                DrawMenu(5);
                DrawMenu(6);
                DrawMenu(7);
                DrawMenu(8);
                DrawMenu(9);
                DrawMenu(10);
                iPrintln(-1, " ");
                iPrintln(-1, "Menu Status: ^2Initiating...");
                DrawMenu(11);
                DrawMenu(12);
                DrawMenu(13);
                DrawMenu(14);
                DrawMenu(15);
                DrawMenu(16);
                DrawMenu(17);
                iPrintln(-1, " ");
                iPrintln(-1, "Menu Status: ^2Loaded!");
                HUDSet = true;
            }
        }

        //Stop Menu
        private void button4_Click(object sender, EventArgs e)
        {
            ButtonMonitor.Stop();
            iPrintln(-1, " ");
            iPrintln(-1, "^1Destroying HUDS...");
            iPrintln(-1, " ");
            iPrintln(-1, " ");
            Thread.Sleep(500);
            SetMemory(Hud.HElems.ELEM, new byte[99000]);
            iPrintln(-1, " ");
            iPrintln(-1, "^2HUDS Successfully Destroyed!");
            iPrintln(-1, " ");
            iPrintln(-1, " ");
            for (int a = 0; a < 18; a++)
            {
                HideItem(a);
                freezeoff(a);
                HUDSet = false;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < 18; i++)
            {
                if (DetectButton((uint)i, Buttons.R3) && MenuOpen[i] == false && IsVerified[i] == true && Status[i] != "Un-Verified")
                {
                    LoadSub(i, "Main Menu");
                    ShowItem(i);
                    freezeon(i);
                    MenuOpen[i] = true;
                }
                if (DetectButton((uint)i, Buttons.Square) && MenuOpen[i] == true && SubMenu[i] == "Main Menu" && IsVerified[i] == true && Status[i] != "Un-Verified")
                {
                    HideItem(i);
                    freezeoff(i);
                    MenuOpen[i] = false;
                }
                if (DetectButton((uint)i, Buttons.Square) && MenuOpen[i] == true && SubMenu[i] != "Main Menu" && IsVerified[i] == true && Status[i] != "Un-Verified")
                {
                    LoadSub(i, "Main Menu");
                }
                if (DetectButton((uint)i, Buttons.R1) && MenuOpen[i] == true && IsVerified[i] == true && Status[i] != "Un-Verified")
                {
                    MenuScroll[i]++;
                    if (MenuScroll[i] > getMaxScroll(SubMenu[i], i))
                    {


                        MenuScroll[i] = 0;
                    }
                    MoveScroller(i, MenuScroll[i]);
                    //UpdateScrollBar(i);
                }
                if (DetectButton((uint)i, Buttons.L1) && MenuOpen[i] == true && IsVerified[i] == true && Status[i] != "Un-Verified")
                {
                    MenuScroll[i]--;
                    if (MenuScroll[i] < 0)
                    {
                        MenuScroll[i] = getMaxScroll(SubMenu[i], i);
                    }
                    MoveScroller(i, MenuScroll[i]);
                    //UpdateScrollBar(i);
                }
                if (DetectButton((uint)i, Buttons.X) && MenuOpen[i] == true && IsVerified[i] == true && Status[i] != "Un-Verified")
                {
                    MenuSelection(i, MenuScroll[i], SubMenu[i]);
                }
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            DEX.ChangeAPI(SelectAPI.ControlConsole);
            textBox2.Enabled = true;
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            DEX.ChangeAPI(SelectAPI.TargetManager);
            DEX.CCAPI.DisconnectTarget();
            textBox2.Enabled = false;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (DEX.GetCurrentAPI() == SelectAPI.TargetManager)
            {
                try
                {
                    DEX.ConnectTarget();
                    DEX.AttachProcess();
                    MessageBox.Show("Connected and Attached Successfully", "Thanks To KRW-1");
                    byte[] GetName = new byte[16];
                    GetMemory1(0x017354b8, ref GetName);
                    textBox1.Text = Encoding.ASCII.GetString(GetName);
                }
                catch
                {
                    MessageBox.Show("Connection Failed\nMake Sure Ghosts Is Running\nAlso Check Connectivity To Your PS3 Is Good!", "Failed");
                }
            }
            else
            {
                if (DEX.ConnectTarget(textBox2.Text))
                {
                    DEX.CCAPI.Notify(CCAPI.NotifyIcon.PEN, "PS3 Connected");
                    DEX.CCAPI.ClearTargetInfo();
                    Thread.Sleep(500);
                }
                else
                {
                    MessageBox.Show("Cannot Connect To PS3! (Check The IP Is Right)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                if (DEX.CCAPI.SUCCESS(DEX.CCAPI.AttachProcess()))
                {
                    DEX.CCAPI.Notify(CCAPI.NotifyIcon.PROGRESS, "Process Attached");
                    DEX.ConnectTarget(textBox2.Text);
                    DEX.AttachProcess();
                    byte[] GetName = new byte[16];
                    GetMemory1(0x017354b8, ref GetName);
                    textBox1.Text = Encoding.ASCII.GetString(GetName);
                    MessageBox.Show("Successfully Connected and Attached!", "Success");
                }
                else
                {
                    DEX.CCAPI.Notify(CCAPI.NotifyIcon.INFO, "Cannot Attach");
                    MessageBox.Show("Cannot Attach Process!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                int err = GHOSTS.PS3.Init();
            }
        }

        private void Scroller_DoWork(object sender, DoWorkEventArgs e)
        {

        }
    }
}
 
Statut
N'est pas ouverte pour d'autres réponses.
Retour
Haut