Beispiel #1
0
        public T GetStruct <T>(int offset, int num) where T : struct
        {
            int size = Marshal.SizeOf(typeof(T));

            byte[] data = ReadBytes(offset, num, size);
            return((T)StructsUtil.ByteToStruct(data, typeof(T)));
        }
Beispiel #2
0
        public Object GetStruct(int offset, int num, Type type)
        {
            int size = Marshal.SizeOf(type);

            byte[] data = ReadBytes(offset, num, size);
            return(StructsUtil.ByteToStruct(data, type));
        }
Beispiel #3
0
 private Evo[] getEvo(ReadAndWrite rw, int num)
 {
     //Console.WriteLine(Operation.Hex(rw.getStructOffset(typeof(Evo), evo_table, num * EVO_PER_POKE)));
     rw.Seek(rw.getStructOffset(typeof(Evo), evo_table, num * EVO_PER_POKE));
     for (int x = 0; x < EVO_PER_POKE; x++)
     {
         byte[] data = rw.Br.ReadBytes(8);
         evo[x] = (Evo)StructsUtil.ByteToStruct(data, typeof(Evo));
     }
     return(evo);
 }