Jump to content
Tuts 4 You

Patching A File Using Visual Basic 6


Guest BooGLE

Recommended Posts

Guest BooGLE
Posted (edited)

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
Posted

If you upload your file here ... we can help you easier !

  • 1 year later...
Posted

&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

  • 3 months later...
Posted

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

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...