Beispiel #1
0
        private void ExportFileHeader(LuaFile.LuaHeader header, FileStream fs)
        {
            // file name
            string bufStr = "Bytecode file: " + Global.fileName + "\r\n";

            bufStr += "<File Header>\r\n";

            // signature
            bufStr += "Signature: " + Encoding.ASCII.GetString(header.Signature) + "\r\n";

            string verStr    = header.Version.ToString("X");
            string headerStr = "Luac Version:\t\t" + verStr[0] + "." + verStr[1] + "\t\t";

            headerStr += "Format:\t\t\t\t\t" + header.Format + "\r\n";

            headerStr += "Endian:\t\t\t\t" + (header.IsLittleEndian != 0 ? "Little" : "Big") + "\t";
            headerStr += "Size Of Int:\t\t\t" + header.SizeOfInt + "\r\n";

            headerStr += "Size Of Sizet:\t\t" + header.SizeOfSizeT + "\t\t";
            headerStr += "Size Of Instruction:\t" + header.SizeOfInstruction + "\r\n";

            headerStr += "Size Of LuaNumber:\t" + header.SizeOfLuaNumber + "\t\t";
            headerStr += "LuaNumber Integral:\t\t" + (header.LuaNumIntegral != 0 ? "No" : "Yes") + "\r\n";

            headerStr += "\r\n";

            bufStr += headerStr;

            byte[] buffer = Encoding.UTF8.GetBytes(bufStr);
            fs.Write(buffer, 0, buffer.Length);
        }
Beispiel #2
0
        public FileInfoForm(LuaFile.LuaHeader header, string fileName)
        {
            InitializeComponent();

            _fileName = fileName;
            _header   = header;
        }