Jump to content

cbox


Recommended Posts

Posted

I was wanting to make a app that when you load the file into it, and you hit a button it atuomatically looks and changes the Value for the EP on a prototype save. Anyone know how i can make that happen?

 

Mainly the reason i want to do this is because i am still learning and want to try something like this xD

 

Thanks for the help ppl

Jrjonanddad1

Posted

Or ask me, lmfao. I did code in VB for along time. :o

 

Imports System.IO
Imports System.Text

Public Class Form1

   Public fileName

   Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
       Dim ofd As New OpenFileDialog
       If ofd.ShowDialog() = DialogResult.OK Then
           fileName = ofd.FileName
           Dim fs As New FileStream(ofd.FileName, FileMode.Open)
           Dim br As New BinaryReader(fs)
           Dim length As Long = fs.Length

           br.BaseStream.Position = &H666 'HeX Offset
           Dim EP As Byte() = br.ReadBytes(666) 'lengh of EP allowed
           txtEP.Text = ASCIIEncoding.ASCII.GetString(EP)

       End If
   End Sub

   Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
       Dim bw As New BinaryWriter(New FileStream(fileName, FileMode.Open))

       bw.BaseStream.Position = &H666 'EP Offset
       Dim EP As Byte() = ASCIIEncoding.ASCII.GetBytes(txtEP.Text)
       bw.Write(EP)
   End Sub
End Class

 

Source Download: http://ibotmodz.rogue-mods.com/upload/uploaded/example.rar

  • Like 2
Posted (edited)

Yeah, i don't do Endian for VB, anyway for something this easy, BR/BW is good enough.

 

Lmfao, yungbol +reps me, some random fag -reps me. hahaha. Halodude i bet.

 

Funny story, when we were "friends" he would always get jealous that i could program and he couldn't, says 1 of his friends i still talk to. So that is a lol. :p

Edited by Dakote

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...