Exemplo n.º 1
0
        public void LoadData(byte[] b, HSDStruct reference)
        {
            Data      = b;
            Reference = reference;

            PointerBox.SelectedItem = AllActions.Find(e => e._struct == Reference);

            Bitreader r = new Bitreader(Data);

            var sa = SubactionManager.GetSubaction((byte)r.Read(6));

            comboBox1.SelectedItem = sa.Name;

            for (int i = 0; i < sa.Parameters.Length; i++)
            {
                var p = sa.Parameters[i];

                if (p.Name.Contains("None"))
                {
                    continue;
                }

                var value = r.Read(p.BitCount);

                if (p.IsPointer)
                {
                    continue;
                }

                (panel1.Controls[sa.Parameters.Length - 1 - i].Controls[0] as SubactionValueEditor).SetValue(value);
            }

            CenterToScreen();
        }
Exemplo n.º 2
0
        public int[] GetParameters(byte[] data)
        {
            Bitreader r = new Bitreader(data);

            r.Read(6);

            List <int> param = new List <int>();

            for (int i = 0; i < Parameters.Length; i++)
            {
                var p = Parameters[i];

                if (p.Name.Contains("None"))
                {
                    continue;
                }

                var value = r.Read(p.BitCount);

                if (p.IsPointer)
                {
                    continue;
                }

                param.Add(value);
            }

            return(param.ToArray());
        }
Exemplo n.º 3
0
        public int[] GetParameters(byte[] data, int offset = 0)
        {
            Bitreader r = new Bitreader(data);

            r.Skip(offset * 8);
            r.Read(CodeSize);

            List <int> param = new List <int>();

            for (int i = 0; i < Parameters.Length; i++)
            {
                var p = Parameters[i];

                if (p.Name.Contains("None"))
                {
                    continue;
                }

                var value = p.Signed ? r.ReadSigned(p.BitCount) : r.Read(p.BitCount);

                if (p.IsPointer)
                {
                    continue;
                }

                param.Add(value);
            }

            return(param.ToArray());
        }