Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Request] Edit Bytes

Featured Replies

Posted

Hi, I'm GameOver and I have just registered to this website (So go easy on me, please :rolleyes: )

I am currently developing a patching application for some software.. I know the bytes that I need to change in order to turn the program from a trial into the full version.

Basically I need some VB code (or help me write some VB code) that changes the hex from 00 01 02 03 04 FF to 04 04 04 04 04 03

Any help? :help

Visual Basic Version = 10.0.26001.1

.Net Version = 4.3 Beta

Edited by GameOver

You can use various framework methods to read and alter files. Such as FileStream to read the file into a byte array like this:

(I converted this from C# so sorry if it's not 100% exact for VB.NET):

' Open, Read, Dump, and Close File
Dim fStream As New FileStream(strFilePath, FileMode.Open, FileAccess.Read)
Dim btFileDump As Byte() = New Byte(fStream.Length - 1) {}
fStream.Read(btFileDump, 0, CInt(fStream.Length))
fStream.Close()
fStream.Dispose()

You can then alter the bytes easily at the offset using stuff such as:

' Alter some data in the file
btFileDump(442) = 04
btFileDump(443) = 04
btFileDump(444) = 04
btFileDump(445) = 04
btFileDump(446) = 04
btFileDump(447) = 03

Afterward you can save the file using:

'Save file to disk.
Dim fStream = new File.Create(strFilePath)
fStream.Write(btFileDump, 0, btFileDump.Length);
fStream.Close()
fStream.Dispose()
  • Author

Cheers!

And will this work with non printable characters?

Cheers!

And will this work with non printable characters?

Yes, you are directly editing the bytes.

  • Author

Thanks! =)

  • Author

Urm.. I'm having some problems with the code.. =| It says that the FileStream does not support writing.

Urm.. I'm having some problems with the code.. =| It says that the FileStream does not support writing.

Odd, I've used it personally in some of my projects. I code in C# though rather then VB.NET when I'm using a manged language. But the code is basically the same. Check out this page on MSDN and see if you or I overlooked something. I converted what I posted from C# so I might have missed something VB.NET needs.


/>http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx

Whats the error/exception that you are getting?

Edited by atom0s

I code in C# though rather then VB.NET when I'm using a native language.

Native? That's confusing because i was under the impression that C# & VB.NET were managed code... Did you mean managed atom0s or am i not getting your meaning?

Native? That's confusing because i was under the impression that C# & VB.NET were managed code... Did you mean managed atom0s or am i not getting your meaning?

Whoops yea meant managed lol.

  • Author

Urm.. With this bit of code...

btFileDump(442) = 04

btFileDump(443) = 04

btFileDump(444) = 04

btFileDump(445) = 04

btFileDump(446) = 04

How would I change the value from 04 to FF?

When I change it to FF blue lines appear under it.. =|

In VB.NET you need to use &H in front of hex values, so for example:

FF would be &HFF

  • Author

In VB.NET you need to use &H in front of hex values, so for example:

FF would be &HFF

Genius! Cheers =)

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.