示例#1
0
        public static long PeekInt(this Stream s, Bitness bits, Endianness endian)
        {
            switch (bits)
            {
            case Bitness.B8: return(s.PeekInt8());

            case Bitness.B16: return(s.PeekInt16().FromEndian(endian));

            case Bitness.B32: return(s.PeekInt32().FromEndian(endian));

            case Bitness.B64: return(s.PeekInt64().FromEndian(endian));
            }
            throw new Exception("Peeking int not implemented for bitness " + bits.ToString());
        }
示例#2
0
        public static uint NumberOfBytes(this Bitness bits)
        {
            switch (bits)
            {
            case Bitness.B8: return(1);

            case Bitness.B16: return(2);

            case Bitness.B32: return(4);

            case Bitness.B64: return(8);
            }
            throw new Exception("Number of bits not implemented for bitness " + bits.ToString());
        }
示例#3
0
        public string To_XML()
        {
            var ret = "<os>";

            ret += "<type arch='" + Bitness.ToString() + "' machine='" + machine + "'>" + type.ToString() + "</type>";//is everything a pc? I dont know..
            foreach (var item in BootOrder)
            {
                ret += "<boot dev='" + item.ToString() + "'/>";
            }
            if (ShowBootMenu)
            {
                ret += "<bootmenu enable='yes' timeout='3000'/>";
            }
            ret += "</os>";
            return(ret);
        }