Search Tools Links Login

Hex Editing Protection

Visual Basic 6, or VB Classic

Have you ever had one of your Programs, VIOLATED? By little punk kids that HEXED it? Well this Tutorial Shows you how to Protect against this!

Original Author: Joel Zimmerman


Public Function HexEncrypt(ByVal sString As String) As String

Dim sHex As String

Dim i As Long

Dim pos As Long

Dim Encrypt As Boolean

Dim sNew As String

Dim sTmp As String

Dim iDec As Long

pos = 1

For i = 1 To Len(sString) 'loop through the string however needed

If Mid(sString, 1, 1) <> Chr(163) Then 'check if the string is already encrypted

'Turn Char into hex

sHex = sHex & Hex$(Asc(Mid(sString, i, 1)))

'pad hex with zeros

If Len(sHex) = 1 Then sHex = "0" & sHex

Encrypt = True

Else 'turn hex into text

sTmp = Mid(sString, 2, Len(sString))

sHex = Mid(sTmp, pos, 2)

iDec = Val("&H" & sHex)

If iDec > 0 Then

sNew = sNew & Chr(iDec)

End If

pos = pos + 2

Encrypt = False

End If


If Encrypt Then

HexEncrypt = Chr(163) & sHex


HexEncrypt = sNew

End If

End Function

*************************** EXAMPLE: ***************************

Dim Creator as string

Creator = HexEncrypt("?42614444424C6F6F44")

which actually means Creator = BaDDBLooD.

When people hex edit, They'll see the Hex of ?42614444424C6F6F44, This will fake most inexperience users. Considering most people who hex programs are complete dumbdumb's ( Bad word Filter ) who can't make there own programs. Sometimes Experience users hex programs, to make them work under updated circumstances. If you want to Protect against this, just change the encryption to something more complex.
Tutorial Created by Joel Zimmerman, or Wu~En][g(v)a~uW@useast on

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 166 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.