Tutorials Navigation

Tutorials :: New :: Popular :: Top Rated

Tutorials: 18,357 Categories: 12

Total Tutorial Views: 42,331,718

{Tut} How to Make A Modding Program using Package.IO search

Tutorial Name: {Tut} How to Make A Modding Program using Package.IO search  

Category: PC Tutorials

Submitted By: Sega

Date Added:

Comments: 0

Views: 1,728

Related Forum: PC Building Forum

Share:

Things you need:
Package.IO (thanks feudalnate): [ Register or Signin to view external links. ] [ Register or Signin to view external links. ]
Visual Basic 2008 Express Edition

For this tutorial ill be making a tool on getting 1 million dollars in Red Dead Redemption
Step 1:
Make A New Windows Form

Step 2:
Add Package.IO as A Reference

Step 3:
Double click your form then add this code above Public Class Form1
Imports Package.IO


Step 4:
Add this code under Public Class Form 1
Private FilePath As String = Nothing
       Dim Money As String


Step 5:
Add 2 Buttons
Name the buttons Open and Mod

Step 6:
Code the Open Button Like So:
    Dim open As New OpenFileDialog
      open.Filter = "RDR2MPSAVE.SAV (*.*)|*.*"
      open.Title = "RDR2MPSAVE.SAV"
      If open.ShowDialog = Windows.Forms.DialogResult.OK Then
         Try
            FilePath = open.FileName
            UseWaitCursor = True
            ReadFile(FilePath)
         Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
         End Try
      End If
   End Sub
It will give you 1 one error. Don't worry about this we will fix it.

Step 7:
After End Sub Add This Code:
 Private Sub ReadFile(ByVal FilePath As String)
      Try
         Dim reader As New PackageIO.Reader(FilePath, PackageIO.Endian.Little)
         Money = ScanForString(FilePath, "gRDR2", 67, 0, 0)
         Money += 20
         reader.Position = Money
         reader.ReadString(4)
         UseWaitCursor = False
         reader.Close()
      Catch ex As Exception
         MsgBox("Error", MsgBoxStyle.Critical)
      End Try
 
   End Sub


Now For the Code:
Money = ScanForString(FilePath, "gRDR2", 67, 0, 0)
Money += 20

Each thing means something different. Ill explain... the gRDR2 is the text you want it to search for, the 67 is the starting hex it the thing your searching for begins at. Now the Money +=20 is how many bytes for it to go AFTER the second 2 in gRDR2. For this tut it write the text BACKWORDS. (thats just cause we are using text if you want to know how to do it differently just tell me).

Step 8:
Now Code The Mod Button Like So:
 Try
         WriteFile(FilePath)
         MsgBox("File Saved, Remember To Rehash!", MsgBoxStyle.Information, "")
      Catch ex As Exception
         MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
      End Try
   End Sub


Step 9: Add this code after the End Sub:
Private Sub WriteFile(ByVal FilePath As String)
      Try
         Dim writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Little)
         writer.Position = Money
         Money += 20
         writer.WriteString("Nnk(")
         writer.Close()
      Catch ex As Exception
         MsgBox("Error", MsgBoxStyle.Critical)
      End Try
   End Sub
End Class


Your Done!!

If your lazy here is the source:
RDR Source.zip
[ Register or Signin to view external links. ] "]

Ratings

Current rating: 2.00 by 1 user
Please take one second and rate this tutorial...

Not a Chance
1
2
3
4
5
6
7
8
9
10
Absolutely

Comments

"{Tut} How to Make A Modding Program using Package.IO search" :: Login/Create an Account :: 0 comments

If you would like to post a comment please signin to your account or register for an account.