elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  Leer archivo ROM y obtener información
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Leer archivo ROM y obtener información  (Leído 5,152 veces)
Meta


Desconectado Desconectado

Mensajes: 3.438



Ver Perfil WWW
Leer archivo ROM y obtener información
« en: 5 Junio 2015, 09:46 am »

Hola:



He hecho un boceto no funcional, que tiene que leer una ROM de una Super Nintendo, en este caso uso el juego Ultimate Mortal Kombat 3. Toda l ainformación que se indica arriba nada más cargar el archivo este programa tiene que mostrarlo. No se la mejor manera de hacerlo. Por ejemplo, en la cabecera ROM del programa aparece el título que encuentra dentro de la ROM. Mirando con este editor hexadecimal gratuito lo he encontrado en la posición de dirección de memoria concretament esta 101C0 muestar el título como indica en la imagen de abajo.



Siempre son de longituda 15 carácteres o bytes contando hasta los espacios en blanco. Así que cualquier ROM debe buscar ese título dentro del juego.



Quiero hacer este programa poco a poco y tome forma, así que abajo les dejo las descargas y hagan pruebas. Pensé en buscar la posición de memoria que casi siempre es el mismo en los 4 MB que pesa el archivo, en otros programas que funciona de maravilla los detecta aunque la posición de memoria sea diferente, no todas las ROM son iguales, así que creo que busca los 15 bytes del título.

El programa original lo descargas aquí que este si es funcional y quiero hacer lo mismo. ¿Por qué iba ahcer lo mismo si ya existe?

La respuesta es que en cada pestaña haré funcione de cada programa para hacerlo todo en uno, este es el primero de los cuantos que hay por ahí. ;)

¿Alguna ayuda para hacerlo?

Descargas:

Editor Hexadecimal

Proyecto Visual C# para facilitar los ejemplos.

ROM funcional de SNES para cargarlo en el proyecto y verlo en el editor hexadecimal.

Saludos.


En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Leer archivo ROM y obtener información
« Respuesta #1 en: 5 Junio 2015, 12:01 pm »

¿Cual es la pregunta en cuestión?, imagino que en Google podrás encontrar las especificaciones del formato SMC aun hoy en día, y sabiendo eso sería suficiente para localizar e identificar toda la información que necesitas.

Si la pregunta es "¿cómo obtener el nombre?":
Código
  1. Public Function GetRomName(ByVal filepath As String) As String
  2.  
  3.    Dim buffer As Byte() = Enumerable.Repeat(New Byte, capacidadDelNombre).ToArray
  4.  
  5.    Using fs As New FileStream(filepath, FileMode.Open)
  6.  
  7.        fs.Seek(offset, SeekOrigin.Begin)
  8.        fs.Read(buffer, 0, capacidadDelNombre)
  9.        fs.Close()
  10.  
  11.    End Using
  12.  
  13.    Return String.Join("", From b As Byte In buffer Select Convert.ToChar(b)).TrimEnd({" "c})
  14.  
  15. End Function

Saludos!


« Última modificación: 5 Junio 2015, 12:07 pm por Eleкtro » En línea

Meta


Desconectado Desconectado

Mensajes: 3.438



Ver Perfil WWW
Re: Leer archivo ROM y obtener información
« Respuesta #2 en: 5 Junio 2015, 12:51 pm »

Hola:

Lo he pasado a C#, espero que no importe.
Código
  1. public string GetRomName(string filepath)
  2. {
  3.  
  4. byte[] buffer = Enumerable.Repeat(new byte(), capacidadDelNombre).ToArray;
  5.  
  6. using (FileStream fs = new FileStream(filepath, FileMode.Open)) {
  7.  
  8. fs.Seek(offset, SeekOrigin.Begin);
  9. fs.Read(buffer, 0, capacidadDelNombre);
  10. fs.Close();
  11.  
  12. }
  13.  
  14. return string.Join("", from b in bufferConvert.ToChar(b)).TrimEnd({ ' ' });
  15.  
  16. }

http://converter.telerik.com/

¿Cómo ese código encuentre el nombre?

Da error en C#.
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. using System.IO; // No olvidar.
  12.  
  13. namespace SNES_EP
  14. {
  15.    public partial class Form_Principal : Form
  16.    {
  17.        public Form_Principal()
  18.        {
  19.            InitializeComponent();
  20.        }
  21.  
  22.        private void button_Abrir_Click(object sender, EventArgs e)
  23.        {
  24.            Abrir_Archivo();
  25.            Leer_ROM();
  26.        }
  27.  
  28.  
  29.  
  30.            public string GetRomName(string filepath)
  31.    {
  32.                int capacidadDelNombre = 15;
  33.                string offset = "101C0";
  34.  
  35.     byte[] buffer = Enumerable.Repeat(new byte(), capacidadDelNombre).ToArray;
  36.  
  37.     using (FileStream fs = new FileStream(filepath, FileMode.Open)) {
  38.  
  39.     fs.Seek(offset, SeekOrigin.Begin);
  40.     fs.Read(buffer, 0, capacidadDelNombre);
  41.     fs.Close();
  42.  
  43.     }
  44.  
  45.     return string.Join("", from b in bufferConvert.ToChar(b)).TrimEnd({ ' ' });
  46.  
  47.    }
  48.        void Leer_ROM()
  49.        {
  50.  
  51.        }
  52.  
  53.        void Abrir_Archivo()
  54.        {
  55.            if (openFileDialog1.ShowDialog() == DialogResult.OK)
  56.            {
  57.                textBox_Archivo.Text = openFileDialog1.FileName.ToString();
  58.            }
  59.        }
  60.  
  61.        private void checkBox_Información_CheckedChanged(object sender, EventArgs e)
  62.        {
  63.            if (checkBox_Información.Checked == true)
  64.            {
  65.                Width = 643;
  66.                Height = 783;
  67.            }
  68.  
  69.            else
  70.            {
  71.                Width = 643;
  72.                Height = 508;
  73.            }
  74.        }
  75.  
  76.        private void abrirArchivoToolStripMenuItem_Click(object sender, EventArgs e)
  77.        {
  78.  
  79.        }
  80.    }
  81. }
  82.  

En VB.
Código
  1. Imports System.Collections.Generic
  2. Imports System.ComponentModel
  3. Imports System.Data
  4. Imports System.Drawing
  5. Imports System.Linq
  6. Imports System.Text
  7. Imports System.Threading.Tasks
  8. Imports System.Windows.Forms
  9.  
  10. Imports System.IO
  11. ' No olvidar.
  12. Namespace SNES_EP
  13. Public Partial Class Form_Principal
  14. Inherits Form
  15. Public Sub New()
  16. InitializeComponent()
  17. End Sub
  18.  
  19. Private Sub button_Abrir_Click(sender As Object, e As EventArgs)
  20. Abrir_Archivo()
  21. Leer_ROM()
  22. End Sub
  23.  
  24.  
  25. Private Sub Leer_ROM()
  26.  
  27. End Sub
  28.  
  29. Private Sub Abrir_Archivo()
  30. If openFileDialog1.ShowDialog() = DialogResult.OK Then
  31. textBox_Archivo.Text = openFileDialog1.FileName.ToString()
  32. End If
  33. End Sub
  34.  
  35. Private Sub checkBox_Información_CheckedChanged(sender As Object, e As EventArgs)
  36. If checkBox_Información.Checked = True Then
  37. Width = 643
  38. Height = 783
  39. Else
  40.  
  41. Width = 643
  42. Height = 508
  43. End If
  44. End Sub
  45.  
  46. Private Sub abrirArchivoToolStripMenuItem_Click(sender As Object, e As EventArgs)
  47.  
  48. End Sub
  49. End Class
  50. End Namespace

Vamos haber si esto sale.
En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.788



Ver Perfil
Re: Leer archivo ROM y obtener información
« Respuesta #3 en: 5 Junio 2015, 13:45 pm »

Da error

Si un código te da error, al menos especifica que error, el mensaje de error, y donde se produce, se te ha dicho ya en varias ocasiones en otros posts.

Dicho esto, el error que tienes es obvio, los valores hexadecimales en .Net no se manejan cómo strings, el datatype que espera el parámetro "offset" del método "FileStream.Seek()" es un entero (Int64/Long), por ende, debes usar un valor de ese tipo.

De todas formas te comento que la manera de utilizar valores hexadecimales es escribiendo enteros literales (menos aquellos métodos que acepten un formato de String hexadecimal).

En VB.Net:
Código:
Dim value as Integer = &H101C0

En C#:
Código:
int value = 0x101c0;

FileStream.Seek Method - MSDN
Convert.ToInt64(String, Int32) Method - MSDN

Hexadecimal literals (C#) - MSDN
Hexadecimal literals (Visual Basic) - MSDN

Saludos
« Última modificación: 5 Junio 2015, 13:57 pm por Eleкtro » En línea

Meta


Desconectado Desconectado

Mensajes: 3.438



Ver Perfil WWW
Re: Leer archivo ROM y obtener información
« Respuesta #4 en: 5 Junio 2015, 23:47 pm »

Hola:

Gracias por la información. Me he olvidado de comentar los errores. Sorry.

He encontrado un código hecho en C#, lo que veo que es muy viejo, ya que la programación tiene cosas diferente, algunos detalles básicos. Te dejo el archivo original.
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10.  
  11. namespace SnesKit
  12. {
  13.    public enum BankTypeEnum { Lo, Hi };
  14.    public class RomDump
  15.    {
  16.        // Indica si la ROM tiene el smc header o no
  17.        bool SmcHeader;
  18.  
  19.        // Indica la localización del header de SNES
  20.        int HeaderLocation;
  21.  
  22.        // Array con los datos de la ROM
  23.        public byte[] Data;
  24.  
  25.        // Los diferentes datos que obtenemos de la ROM
  26.        public string Name;
  27.        public byte Layout;
  28.        public byte CartridgeType;
  29.        public byte RomSize;
  30.        public byte RamSize;
  31.        public byte CountryCode;
  32.        public byte LicenseCode;
  33.        public byte VersionNumber;
  34.        ushort Checksum;
  35.        ushort ChecksumCompliment;
  36.        public BankTypeEnum BankType;
  37.  
  38.        // Esta funcion permite el analisis de ROMS de SNES con extensiones SMC y SFC
  39.        public RomDump(byte[] rom)
  40.        {
  41.            this.Data = rom;
  42.            // Comprobamos si existe el header smc
  43.            if (this.Data.Length % 1024 == 512)
  44.                SmcHeader = true;
  45.            else if (this.Data.Length % 1024 == 0)
  46.                SmcHeader = false;
  47.            else
  48.                throw new Exception("Archivo de rom invalida.");
  49.            this.HeaderLocation = 0x81C0;
  50.  
  51.            if (HeaderIsAt(0x07FC0)) // La Rom es LoROM
  52.            {
  53.                this.BankType = BankTypeEnum.Lo;
  54.            }
  55.            else if (HeaderIsAt(0x0FFC0))
  56.            {
  57.                this.BankType = BankTypeEnum.Hi;
  58.            }
  59.  
  60.            // Leemos el Header
  61.            ReadHeader();
  62.  
  63.        }
  64.        // Función para comprobar si el header esta en la dirección correcta
  65.        private bool HeaderIsAt(ushort addr)
  66.        {
  67.            this.HeaderLocation = addr;
  68.            return VerifyChecksum();
  69.        }
  70.  
  71.        // Offset 0x07FC0 in a headerless LoROM image (LoROM rom sin smc header)
  72.        // Offset 0x0FFC0 in a headerless HiROM image (HiROM rom sin smc header)
  73.        // verifica el checksum
  74.        private bool VerifyChecksum()
  75.        {
  76.            // La rom tiene header smc
  77.            if (SmcHeader)
  78.                this.HeaderLocation += 512;
  79.  
  80.            this.ChecksumCompliment = BitConverter.ToUInt16(this.Get(0x1C, 0x1D), 0);
  81.            this.Checksum = BitConverter.ToUInt16(this.Get(0x1E, 0x1F), 0);
  82.            ushort ver = (ushort)(this.Checksum ^ this.ChecksumCompliment);
  83.            return (ver == 0xFFFF);
  84.        }
  85.  
  86.        private void ReadHeader()
  87.        {
  88.            this.Name = Encoding.ASCII.GetString(this.Get(0x00, 0x14)); // 21 chars
  89.            this.Layout = this.At(0x15);
  90.            this.CartridgeType = this.At(0x16);
  91.            this.RomSize = this.At(0x17);
  92.            this.RamSize = this.At(0x18);
  93.            this.CountryCode = this.At(0x19);
  94.            this.LicenseCode = this.At(0x1A);
  95.            this.VersionNumber = this.At(0x1B);
  96.        }
  97.  
  98.        private string GetROmB()
  99.        {
  100.            return String.Format("{0}", this.RomSize);
  101.        }
  102.        private byte[] Get(int from, int to)
  103.        {
  104.            return this.Data.Skip(this.HeaderLocation + from).Take(to - from + 1).ToArray();
  105.        }
  106.        private byte At(int addr)
  107.        {
  108.            return this.Data[this.HeaderLocation + addr];
  109.        }
  110.    }
  111. }
  112.  

En Visual Basic convertido.
Código
  1. Imports System.Collections.Generic
  2. Imports System.ComponentModel
  3. Imports System.Data
  4. Imports System.Drawing
  5. Imports System.Linq
  6. Imports System.Text
  7. Imports System.Windows.Forms
  8. Imports System.IO
  9.  
  10. Namespace SnesKit
  11. Public Enum BankTypeEnum
  12. Lo
  13. Hi
  14. End Enum
  15. Public Class RomDump
  16. ' Indica si la ROM tiene el smc header o no
  17. Private SmcHeader As Boolean
  18.  
  19. ' Indica la localización del header de SNES
  20. Private HeaderLocation As Integer
  21.  
  22. ' Array con los datos de la ROM
  23. Public Data As Byte()
  24.  
  25. ' Los diferentes datos que obtenemos de la ROM
  26. Public Name As String
  27. Public Layout As Byte
  28. Public CartridgeType As Byte
  29. Public RomSize As Byte
  30. Public RamSize As Byte
  31. Public CountryCode As Byte
  32. Public LicenseCode As Byte
  33. Public VersionNumber As Byte
  34. Private Checksum As UShort
  35. Private ChecksumCompliment As UShort
  36. Public BankType As BankTypeEnum
  37.  
  38. ' Esta funcion permite el analisis de ROMS de SNES con extensiones SMC y SFC
  39. Public Sub New(rom As Byte())
  40. Me.Data = rom
  41. ' Comprobamos si existe el header smc
  42. If Me.Data.Length Mod 1024 = 512 Then
  43. SmcHeader = True
  44. ElseIf Me.Data.Length Mod 1024 = 0 Then
  45. SmcHeader = False
  46. Else
  47. Throw New Exception("Archivo de rom invalida.")
  48. End If
  49. Me.HeaderLocation = &H81c0
  50.  
  51. If HeaderIsAt(&H7fc0) Then
  52. ' La Rom es LoROM
  53. Me.BankType = BankTypeEnum.Lo
  54. ElseIf HeaderIsAt(&Hffc0) Then
  55. Me.BankType = BankTypeEnum.Hi
  56. End If
  57.  
  58. ' Leemos el Header
  59.  
  60. ReadHeader()
  61. End Sub
  62. ' Función para comprobar si el header esta en la dirección correcta
  63. Private Function HeaderIsAt(addr As UShort) As Boolean
  64. Me.HeaderLocation = addr
  65. Return VerifyChecksum()
  66. End Function
  67.  
  68. ' Offset 0x07FC0 in a headerless LoROM image (LoROM rom sin smc header)
  69. ' Offset 0x0FFC0 in a headerless HiROM image (HiROM rom sin smc header)
  70. ' verifica el checksum
  71. Private Function VerifyChecksum() As Boolean
  72. ' La rom tiene header smc
  73. If SmcHeader Then
  74. Me.HeaderLocation += 512
  75. End If
  76.  
  77. Me.ChecksumCompliment = BitConverter.ToUInt16(Me.[Get](&H1c, &H1d), 0)
  78. Me.Checksum = BitConverter.ToUInt16(Me.[Get](&H1e, &H1f), 0)
  79. Dim ver As UShort = CUShort(Me.Checksum Xor Me.ChecksumCompliment)
  80. Return (ver = &Hffff)
  81. End Function
  82.  
  83. Private Sub ReadHeader()
  84. Me.Name = Encoding.ASCII.GetString(Me.[Get](&H0, &H14))
  85. ' 21 chars
  86. Me.Layout = Me.At(&H15)
  87. Me.CartridgeType = Me.At(&H16)
  88. Me.RomSize = Me.At(&H17)
  89. Me.RamSize = Me.At(&H18)
  90. Me.CountryCode = Me.At(&H19)
  91. Me.LicenseCode = Me.At(&H1a)
  92. Me.VersionNumber = Me.At(&H1b)
  93. End Sub
  94.  
  95. Private Function GetROmB() As String
  96. Return [String].Format("{0}", Me.RomSize)
  97. End Function
  98. Private Function [Get](from As Integer, [to] As Integer) As Byte()
  99. Return Me.Data.Skip(Me.HeaderLocation + from).Take([to] - from + 1).ToArray()
  100. End Function
  101. Private Function At(addr As Integer) As Byte
  102. Return Me.Data(Me.HeaderLocation + addr)
  103. End Function
  104. End Class
  105. End Namespace

Creo un proyecto nuevo que se llama igual SnesKit.
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SnesKit
  8. {
  9.    class Program
  10.    {
  11.        static void Main(string[] args)
  12.        {
  13.  
  14.        }
  15.    }
  16. }

Indicado arriba, justo donde pone class Program lo llamaré como el archivo original public class RomDump como indica abajo. No se si esto es obligatorio. Ver código justo abajo.
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SnesKit
  8. {
  9.    public class RomDump
  10.    {
  11.        static void Main(string[] args)
  12.        {
  13.  
  14.        }
  15.    }
  16. }

El código original no veo que use este código que se crea indicado abajo.
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SnesKit
  8. {
  9.    public class RomDump
  10.    {
  11.        static void Main(string[] args)
  12.        {
  13.  
  14.        }
  15.    }
  16. }

He intentado incrustar el código para que me funcione y no me sale.

¿Hay alguna posibilidad?

Saludos.
En línea

43H4FH44H45H4CH49H56H45H
Wiki

Desconectado Desconectado

Mensajes: 502



Ver Perfil
Re: Leer archivo ROM y obtener información
« Respuesta #5 en: 6 Junio 2015, 05:41 am »

Lo primero es que debes empezar a estudiar desde el comienzo lo que es .NET, generalidades de namespace, clases, métodos, diferencias entre proyectos con Windows Forms y de consola, etc.

Pero si no quieres aprender nada de eso y solo quieres copiar y pegar, te basta con crear una clase en un proyecto de Windows Forms con ese código y utilizarla desde el formulario principal.
En línea


-R IP
:0100
-A 100 
2826:0100 MOV AH,09
2826:0102 MOV DX,109
2826:0105 INT 21
2826:0105 MOV AH,08
2826:0105 INT 21
2826:0107 INT 20
2826:0109 DB 'MI NICK ES CODELIVE.$' 
2826:0127 
-R BX
:0000
-R CX
:20
-N CODELIVE.COM
-W
Meta


Desconectado Desconectado

Mensajes: 3.438



Ver Perfil WWW
Re: Leer archivo ROM y obtener información
« Respuesta #6 en: 6 Junio 2015, 21:18 pm »

Hola:

Verdad. Ahora quiero probar esto cuanto antes. ;)

Empecé otra vez.
Creé una nueva referencia.


Añadí el código dentro.
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10.  
  11. namespace SnesKit
  12. {
  13.    public enum BankTypeEnum { Lo, Hi };
  14.    public class RomDump
  15.    {
  16.        // Indica si la ROM tiene el smc header o no
  17.        bool SmcHeader;
  18.  
  19.        // Indica la localización del header de SNES
  20.        int HeaderLocation;
  21.  
  22.        // Array con los datos de la ROM
  23.        public byte[] Data;
  24.  
  25.        // Los diferentes datos que obtenemos de la ROM
  26.        public string Name;
  27.        public byte Layout;
  28.        public byte CartridgeType;
  29.        public byte RomSize;
  30.        public byte RamSize;
  31.        public byte CountryCode;
  32.        public byte LicenseCode;
  33.        public byte VersionNumber;
  34.        ushort Checksum;
  35.        ushort ChecksumCompliment;
  36.        public BankTypeEnum BankType;
  37.  
  38.        // Esta funcion permite el analisis de ROMS de SNES con extensiones SMC y SFC
  39.        public RomDump(byte[] rom)
  40.        {
  41.            this.Data = rom;
  42.            // Comprobamos si existe el header smc
  43.            if (this.Data.Length % 1024 == 512)
  44.                SmcHeader = true;
  45.            else if (this.Data.Length % 1024 == 0)
  46.                SmcHeader = false;
  47.            else
  48.                throw new Exception("Archivo de rom invalida.");
  49.            this.HeaderLocation = 0x81C0;
  50.  
  51.            if (HeaderIsAt(0x07FC0)) // La Rom es LoROM
  52.            {
  53.                this.BankType = BankTypeEnum.Lo;
  54.            }
  55.            else if (HeaderIsAt(0x0FFC0))
  56.            {
  57.                this.BankType = BankTypeEnum.Hi;
  58.            }
  59.  
  60.            // Leemos el Header
  61.            ReadHeader();
  62.  
  63.        }
  64.        // Función para comprobar si el header esta en la dirección correcta
  65.        private bool HeaderIsAt(ushort addr)
  66.        {
  67.            this.HeaderLocation = addr;
  68.            return VerifyChecksum();
  69.        }
  70.  
  71.        // Offset 0x07FC0 in a headerless LoROM image (LoROM rom sin smc header)
  72.        // Offset 0x0FFC0 in a headerless HiROM image (HiROM rom sin smc header)
  73.        // verifica el checksum
  74.        private bool VerifyChecksum()
  75.        {
  76.            // La rom tiene header smc
  77.            if (SmcHeader)
  78.                this.HeaderLocation += 512;
  79.  
  80.            this.ChecksumCompliment = BitConverter.ToUInt16(this.Get(0x1C, 0x1D), 0);
  81.            this.Checksum = BitConverter.ToUInt16(this.Get(0x1E, 0x1F), 0);
  82.            ushort ver = (ushort)(this.Checksum ^ this.ChecksumCompliment);
  83.            return (ver == 0xFFFF);
  84.        }
  85.  
  86.        private void ReadHeader()
  87.        {
  88.            this.Name = Encoding.ASCII.GetString(this.Get(0x00, 0x14)); // 21 chars
  89.            this.Layout = this.At(0x15);
  90.            this.CartridgeType = this.At(0x16);
  91.            this.RomSize = this.At(0x17);
  92.            this.RamSize = this.At(0x18);
  93.            this.CountryCode = this.At(0x19);
  94.            this.LicenseCode = this.At(0x1A);
  95.            this.VersionNumber = this.At(0x1B);
  96.        }
  97.  
  98.        private string GetROmB()
  99.        {
  100.            return String.Format("{0}", this.RomSize);
  101.        }
  102.        private byte[] Get(int from, int to)
  103.        {
  104.            return this.Data.Skip(this.HeaderLocation + from).Take(to - from + 1).ToArray();
  105.        }
  106.        private byte At(int addr)
  107.        {
  108.            return this.Data[this.HeaderLocation + addr];
  109.        }
  110.    }
  111. }
  112.  

Ahora a investigar com lo llamo y lo ejecute.

https://msdn.microsoft.com/es-es/library/z2kcy19k.aspx?f=255&MSPPError=-2147217396
https://msdn.microsoft.com/es-es/library/ee461504.aspx
https://www.youtube.com/watch?v=Mu2LYOhEMpM

Si que tengo que leer. ;)

Gracias por todo.



« Última modificación: 6 Junio 2015, 21:24 pm por Meta » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines