Example #1
0
 private V1Disassembler(SmxFile file, SmxCodeV1Section code, int proc_offset)
 {
     data_         = file.Header.Data;
     code_start_   = code.CodeStart;
     proc_offset_  = proc_offset;
     cursor_       = proc_offset;
     cursor_limit_ = code.Header.CodeSize;
 }
Example #2
0
        public SmxRttiData(SmxFile file, FileHeader file_header, SectionEntry header)
            : base(file_header, header)
        {
            smx_file_ = file;
            var reader = file_header.SectionReader(header);

            bytes_ = reader.ReadBytes(header.Size);
        }
Example #3
0
 public static V1Instruction[] TryDisassemble(SmxFile file, SmxCodeV1Section code, int proc_offset)
 {
     try
     {
         return(Disassemble(file, code, proc_offset));
     }
     catch
     {
         return(null);
     }
 }
Example #4
0
 private void LoadFile(FileInfo fInfo)
 {
     try
     {
         using (var stream = fInfo.OpenRead())
         {
             using (var reader = new BinaryReader(stream))
             {
                 file_ = new SmxFile(reader);
             }
         }
     }
     catch (Exception e)
     {
         detailbox_.Text = "Error while loading and processing the file." + Environment.NewLine + Environment.NewLine + "Details: " + e.Message;
         return;
     }
     renderFile();
 }
Example #5
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog();
            dialog.Filter = "smx files (*.smx)|*.smx|All files (*.*)|*.*";
            dialog.FilterIndex = 1;
            dialog.RestoreDirectory = true;

            if (dialog.ShowDialog() != DialogResult.OK)
                return;

            Stream stream = null;
            try
            {
                stream = dialog.OpenFile();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Could not open file: " + ex.Message, "File error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                using (stream)
                using (var reader = new BinaryReader(stream))
                {
                    file_ = new SmxFile(reader);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Could not parse file: " + ex.Message);
                return;
            }

            renderFile();
        }
Example #6
0
 public SmxDebugLocals(SmxFile smx_file, FileHeader file, SectionEntry header, SmxNameTable names)
     : base(file, header, names)
 {
     smx_file_ = smx_file;
 }
Example #7
0
        public static V1Instruction[] Disassemble(SmxFile file, SmxCodeV1Section code, int proc_offset)
        {
            var disassembler = new V1Disassembler(file, code, proc_offset);

            return(disassembler.disassemble());
        }
Example #8
0
 public TypeBuilder(SmxFile file, byte[] bytes, int offset)
 {
     file_   = file;
     bytes_  = bytes;
     offset_ = offset;
 }
Example #9
0
 public static V1Instruction[] Disassemble(SmxFile file, SmxCodeV1Section code, int proc_offset)
 {
     var disassembler = new V1Disassembler(file, code, proc_offset);
     return disassembler.disassemble();
 }
Example #10
0
 private V1Disassembler(SmxFile file, SmxCodeV1Section code, int proc_offset)
 {
     data_ = file.Header.Data;
     code_start_ = code.CodeStart;
     proc_offset_ = proc_offset;
     cursor_ = proc_offset;
     cursor_limit_ = code.Header.CodeSize;
 }