Jump to content
Tuts 4 You

Patching A File Using Visual Basic 6


Guest BooGLE

Recommended Posts

Guest BooGLE

Hey Guys,

I am having some trouble with patching a file in vb6.

I use the following code to try and patch the file:

Open "File.exe" For Binary As #1

Put #1, &H3BA1E, "EB" Format As: "Put #1, <offset>, <byte>

Close #1

But, This isnt working! I've also tried reversing the orders of things, but it just seems to screw up my file.

I also would like to know why "&H" is put before the offset?

Any help on this would be appriciated.

Best Regards,

BooGLE

Edited by BooGLE
Link to comment
  • 1 year later...

&H = hex value

I have made Vb6 exe patchers and vb6 memory patcher/loaders before, Its an old topic but if you still need help im sure I could write a sample code for you

Link to comment
  • 3 months later...

Try This

Private Sub Command1_Click()

Dim sFile

sFile = "C:\test.txt"

PatchBytes sFile, 2, &HFF

End Sub

Public Function PatchBytes(xFile, sOffSet, sByte As Byte)

Open xFile For Binary As #1

Put #1, sOffSet, sByte

Close #1

End Function

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...