Visual Basic, Bin file help.

BxRKings Apr 13, 2012

  1. BxRKings

    BxRKings Developer XPG Developer Lifetime Gold TeamXPG
    0/47

    Joined:
    May 1, 2011
    Messages:
    2,161
    Likes Received:
    840
    Trophy Points:
    0
    Gender:
    Male
    Location:
    BxRCo., Ltd.™©
    Console:
    Xbox
    I'll keep this short.

    I'm just starting on programming and i'm trying to make a program that will open a .BIN file edit it and save it.

    But i need help with the Opening the .BIN file. I'm not sure how to go about opening that file. Any help would be appreciated.
     
  2. Iamcoolz

    Iamcoolz Global Mod Staff Member XPG Moderator
    145/188

    Joined:
    Mar 30, 2012
    Messages:
    821
    Likes Received:
    305
    Trophy Points:
    145
    Gender:
    Male
    Location:
    XPG
    Console:
    Xbox One
    Unsure of what you're asking but eh lol.. maybe this? This will basically allow you how to open a .bin only.. without the actual reading.. or maybe I interpreted wrong.

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    	    Dim Open As New OpenFileDialog
    	    Open.Filter = "bin (*.*)|*.*"
    	    Open.Title = "Open Ze Bin"
    	    If Open.ShowDialog =Windows.Forms.DialogResult.OK Then
    		    FilePath = Open.FileName
    		    ReadFile(FilePath)
    	    Else
    		    Return
    	    End If
        End Sub
     
  3. BxRKings

    BxRKings Developer XPG Developer Lifetime Gold TeamXPG
    0/47

    Joined:
    May 1, 2011
    Messages:
    2,161
    Likes Received:
    840
    Trophy Points:
    0
    Gender:
    Male
    Location:
    BxRCo., Ltd.™©
    Console:
    Xbox
    That's how i open the file. But i would like to read it, using HEX code. and of course i don't know how to build that yet.

    Basically i need to figure out how to open in it HEX the rest i can do for myself.
     
  4. Iamcoolz

    Iamcoolz Global Mod Staff Member XPG Moderator
    145/188

    Joined:
    Mar 30, 2012
    Messages:
    821
    Likes Received:
    305
    Trophy Points:
    145
    Gender:
    Male
    Location:
    XPG
    Console:
    Xbox One
    Code:
      Public Sub ReadFile(ByVal FilePath As String)
    	    Dim Reader As New PackageIO.Reader(FilePath, PackageIO.Endian.Big)
    	    Reader.Position = &HD032
    	    NumericUpDown1.Text = Reader.ReadInt32
        End Sub
    
    Something like this? Where D032 is the offset?
     
  5. Vash The Stampede

    Vash The Stampede Developer XPG Developer TeamXPG
    205/282

    Joined:
    Mar 13, 2011
    Messages:
    4,297
    Likes Received:
    2,227
    Trophy Points:
    205
    Gender:
    Male
    Console:
    Xbox
    hmm what game are you trying to open sence all .bin files are different that i know of so far

    (if you found out the offsets for the .bin you should be able to extract it)
     
  6. go

    goozgog Newbie
    0/47

    Joined:
    Jul 2, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Console:
    Xbox

Share This Page

Close