VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Hex Editing Protection

by Joel Zimmerman (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

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!

Rate Hex Editing Protection


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

Next

If Encrypt Then

HexEncrypt = Chr(163) & sHex

Else

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

Download this snippet    Add to My Saved Code

Hex Editing Protection Comments

No comments have been posted about Hex Editing Protection. Why not be the first to post a comment about Hex Editing Protection.

Post your comment

Subject:
Message:
0/1000 characters