Skip to content

Instantly share code, notes, and snippets.

@juananpe
Created July 25, 2022 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juananpe/8624cd41842c6916e4e38910c3193fa4 to your computer and use it in GitHub Desktop.
Save juananpe/8624cd41842c6916e4e38910c3193fa4 to your computer and use it in GitHub Desktop.
HackIt 2022 / Level 1 vbs
REM ***** BASIC *****
Sub Main
Dim val
val = "pruebaprueba14"
If Len(val) <> 14 Then
MsgBox "Wrong!"
Else
Dim a(14)
Dim tmp
For i = 1 To 14
a(i) = Asc(Mid(val, i, 1))
Next
For j = 1 To 42
For i = 1 To 14
a(i) = (a(i) + j * a((i Mod 14) + 1)) Mod 256
Next
tmp = a(2)
a(2) = a(3)
a(3) = tmp
a(4) = (a(4) * 49) Mod 256
a(5) = (a(5) * ((j * 2) + 1)) Mod 256
a(6) = 255 - a(6)
tmp = a(1)
For i = 1 To 13
a(i) = a(i + 1)
Next
a(14) = tmp
Next
Dim s
s = ""
For i = 1 To 14
s = s + CStr(a(i)) + ","
Next
If s <> "101,107,164,102,76,232,0,57,122,139,112,36,17,205," Then
MsgBox "Wrong!"
Else
MsgBox "Nice!"
End If
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment