예제 #1
0
        /// <summary>
        /// The NewStructure.
        /// </summary>
        /// <param name="structure">The structure<see cref="Type"/>.</param>
        /// <param name="binary">The binary<see cref="byte[]"/>.</param>
        /// <param name="offset">The offset<see cref="long"/>.</param>
        /// <returns>The <see cref="object"/>.</returns>
        public static object NewStructure(this Type structure, byte[] binary, long offset = 0)
        {
            //return _copier.PtrToStruct(binary, structure);

            // object o = Activator.CreateInstance(structure);
            return(Extractor.BytesToStructure(binary, structure, offset));
        }
예제 #2
0
 public unsafe static object ToStructure(this byte[] binary, object structure, long offset = 0)
 {
     return(Extractor.BytesToStructure(binary, structure, offset));
 }
예제 #3
0
 public unsafe static ValueType ToStructure(this byte[] binary, ValueType structure, long offset = 0)
 {
     return(Extractor.BytesToStructure(binary, structure, offset));
 }
예제 #4
0
 public static object NewStructure(this byte[] binary, Type structure, long offset = 0)
 {
     return(Extractor.BytesToStructure(binary, structure, offset));
 }