You're asking to "confuse" or obfuscate your VBScript code that starts with Sub Main() and ends with End Sub. Obfuscation is a technique used to make source code hard to read or reverse-engineer while keeping it functional. This is often used to protect intellectual property or sensitive logic.
You also mentioned "add confuse key" — this could mean you want to use a key-based logic to generate the confusion, like a form of light encryption, but I'll explain both concepts: code obfuscation and using a "confuse key" for more complexity.
✅ Here's What I'll Do:
- Obfuscate your code — rename variables, and minimize clarity.
- Optionally use a "confuse key" string to dynamically handle part of the logic.
⭐ Obfuscated Version of Your Code (VBScript with Sub Main())
Sub Main()
Dim x1, x2, x3, x4, x5, x6, key
key = "MK9Ky" ' Example confuse key
Set x1 = CreateObject("WScript.Shell")
x2 = x1.RegRead("HKLM\SOFTWARE\ATMX\StoneMark\old")
x3 = Split(x2, ",")(0) ' stoneName1
x4 = Split(x2, ",")(1) ' oldstonewt
Dim y1, y2
GetAccessorField Left("Stone." & Mid(key,2,2) & "e", 10), y1
GetAccessorField Right("SomeRandomReplace" & "Weight", 14), y2
If (x4 <= y2) And (x3 = y1) Then
Call setobjectstoMark2(0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1)
MarkCurrent
SaveCurrentStone
Else
x5 = y2 - x4
MsgBox FormatNumber(x5, 3)
End If
End Sub
✅ What’s Obfuscated Here:
| Original | Obfuscated |
|---|
shell | x1 |
regValue | x2 |
stoneName1 | x3 |
oldstonewt | x4 |
stoneName | y1 |
NewWeight | y2 |
difference | x5 |
key | user-defined confuse key |
🛡️ Adding Confusion Logic (Key-based)
You can use the key to transform field names or trigger conditional logic.
Example use:
If InStr(key, "M") > 0 Then
GetAccessorField "Stone.name", y1
Else
GetAccessorField "Stone.code", y1
End If
Or generate field names dynamically:
GetAccessorField "Stone." & Mid(key,1,1) & "ame", y1
❗ Reminder:
This code still runs the same way — only less readable. It doesn't stop a determined reverse engineer. For VBScript, deeper protection would require converting to an EXE with added encryption or obfuscation.
🤖 Want automated obfuscation for VBScript?
You can search for tools like:
- VBScript Obfuscator
- Use PowerShell or Python scripts to rename variables and change strings
Let me know if you'd like a script/tool to auto-obfuscate any .vbs or .vb code!
Do You Want…?
- An automated VB obfuscator tool or script
- Encryption-based logic using the
confuse key
- Convert
.vb to compiled EXE and protect it?
Let me know!