fb:porticula NoPaste
GBA Header Viewer
Uploader: | Westbeam |
Datum/Zeit: | 06.11.2011 20:57:38 |
'GBA Header Viewer
'Offset 0xA0 - 0xAB = Game title
'Offset 0x108 - 0x11E = Alternative game title
'Offset 0xBC = Game version(always 1.0)
'Offset 0xAC - 0xAF = Game serial(starts alway with "AGB")
#Include "file.bi"
Type THeader
As String nam,shortnam
As Byte snamoffset(12),namoffset(23)
As String Serial
As Byte serialoffset(4)
As Integer nambit
End Type
Dim Shared As THeader Header
Dim Shared As String file
Dim As Integer ff = Freefile
Input "File: ",file
If Fileexists(file)=0 Then Print "File not found!":End
Print "Size: "+Str(Filelen(file))+" Bytes ("+Str(Filelen(file)/1024/1024)+"Mb)"
Open file For Binary As #ff
For i As Integer=1 To 12
Get #ff,&hA0+i,Header.snamoffset(i)
Header.shortnam+=Chr(Header.snamoffset(i))
Next
For i As Integer=1 To 23
Get #ff,&h108+i,Header.namoffset(i)
Header.nam+=Chr(Header.namoffset(i))
Next
If Header.namoffset(1)=112 Then Header.nambit=1
For i As Integer=1 To 4
Get #ff,&hAC+i,Header.Serialoffset(i)
Header.Serial+=Chr(Header.Serialoffset(i))
Next
Print "---------------------------------------"
Print "Shortname(Offset A0-AB): "+Header.shortnam
If Header.nambit=1 Then
Print "Longname(Offset 108-11E): "+Header.nam
Else
Print "Longname(Offset 108-11E): not found"
End If
Print "Version(Offset BC): 1.0"
Print ""
Print "Serial(Offset AC-AF): AGB-"+Header.Serial
Close #ff