Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.86 KB | None | 0 0
  1. def not_(b):
  2.     return 255 - b
  3.  
  4.  
  5. def true_b_func(b, r):
  6.     for i in range(r):
  7.         b2 = (b & 128) // 128
  8.         b = ((b * 2) & 255) + b2
  9.     return b
  10.  
  11.  
  12. def true_d_func(b, r):
  13.     for i in range(r):
  14.         b2 = (b & 1) * 128
  15.         b = (b // 2 & 255) + b2
  16.     return b
  17.  
  18.  
  19. def true_e_func(b, k):
  20.     for i in range(8):
  21.         if (b >> i & 1) == (k >> i & 1):
  22.             b = b & not_(1 << i) & 255
  23.         else:
  24.             b = b | (1 << i & 255)
  25.     return b
  26.  
  27.  
  28. ##def true_g_func(idx):
  29. ##    b = ((idx+1)*-306674912)%256
  30. ##    k = ((idx+2)*1669101435)%256
  31. ##    return e_func(b, k)
  32.  
  33.  
  34. def true_g_func(idx):
  35.     g_lookup = [
  36.         63,
  37.         253,
  38.         187,
  39.         101,
  40.         55,
  41.         245,
  42.         139,
  43.         77,
  44.         15,
  45.         237,
  46.         171,
  47.         101,
  48.         215,
  49.         149,
  50.         91,
  51.         29,
  52.         223,
  53.         157,
  54.         91,
  55.         37,
  56.         151,
  57.         213,
  58.         11,
  59.         77,
  60.         143,
  61.         45,
  62.         107,
  63.         165,
  64.         247,
  65.         53,
  66.         123,
  67.         189,
  68.         255,
  69.         61,
  70.         123,
  71.         165,
  72.         247,
  73.         53,
  74.         139,
  75.         205,
  76.         15,
  77.         173,
  78.         107,
  79.         37,
  80.         215,
  81.         149,
  82.         91,
  83.         29,
  84.         223,
  85.         157,
  86.         91,
  87.         229,
  88.         151,
  89.         85,
  90.         11,
  91.         205,
  92.         143,
  93.         109,
  94.         43,
  95.         229,
  96.         183,
  97.         117,
  98.         59,
  99.         253,
  100.         63,
  101.         125,
  102.         187,
  103.         229,
  104.         55,
  105.         117,
  106.         139,
  107.         205,
  108.         15,
  109.         109,
  110.         171,
  111.         229,
  112.         87,
  113.         149,
  114.         219,
  115.         29,
  116.         95,
  117.         157,
  118.         219,
  119.         37,
  120.         151,
  121.         85,
  122.         11,
  123.         205,
  124.         143,
  125.         45,
  126.         235,
  127.         165,
  128.         119,
  129.         53,
  130.         251,
  131.         189,
  132.         127,
  133.         61,
  134.         251,
  135.         165,
  136.         119,
  137.         53,
  138.         139,
  139.         77,
  140.         15,
  141.         173,
  142.         235,
  143.         37,
  144.         87,
  145.         149,
  146.         219,
  147.         29,
  148.         95,
  149.         157,
  150.         219,
  151.         101,
  152.         151,
  153.         213,
  154.         11,
  155.         77,
  156.         143,
  157.         237,
  158.         43,
  159.         101,
  160.         183,
  161.         245,
  162.         59,
  163.         125,
  164.         63,
  165.         253,
  166.         187,
  167.         101,
  168.         55,
  169.         245,
  170.         139,
  171.         77,
  172.         15,
  173.         237,
  174.         171,
  175.         101,
  176.         215,
  177.         149,
  178.         91,
  179.         29,
  180.         223,
  181.         157,
  182.         91,
  183.         37,
  184.         151,
  185.         213,
  186.         11,
  187.         77,
  188.         143,
  189.         45,
  190.         107,
  191.         165,
  192.         247,
  193.         53,
  194.         123,
  195.         189,
  196.         255,
  197.         61,
  198.         123,
  199.         165,
  200.         247,
  201.         53,
  202.         139,
  203.         205,
  204.         15,
  205.         173,
  206.         107,
  207.         37,
  208.         215,
  209.         149,
  210.         91,
  211.         29,
  212.         223,
  213.         157,
  214.         91,
  215.         229,
  216.         151,
  217.         85,
  218.         11,
  219.         205,
  220.         143,
  221.         109,
  222.         43,
  223.         229,
  224.         183,
  225.         117,
  226.         59,
  227.         253,
  228.         63,
  229.         125,
  230.         187,
  231.         229,
  232.         55,
  233.         117,
  234.         139,
  235.         205,
  236.         15,
  237.         109,
  238.         171,
  239.         229,
  240.         87,
  241.         149,
  242.         219,
  243.         29,
  244.         95,
  245.         157,
  246.         219,
  247.         37,
  248.         151,
  249.         85,
  250.         11,
  251.         205,
  252.         143,
  253.         45,
  254.         235,
  255.         165,
  256.         119,
  257.         53,
  258.         251,
  259.         189,
  260.         127,
  261.         61,
  262.         251,
  263.         165,
  264.         119,
  265.         53,
  266.         139,
  267.         77,
  268.         15,
  269.         173,
  270.         235,
  271.         37,
  272.         87,
  273.         149,
  274.         219,
  275.         29,
  276.         95,
  277.         157,
  278.         219,
  279.         101,
  280.         151,
  281.         213,
  282.         11,
  283.         77,
  284.         143,
  285.         237,
  286.         43,
  287.         101,
  288.         183,
  289.         245,
  290.         59,
  291.         125,
  292.     ]
  293.     idx = idx % 256
  294.     return g_lookup[idx]
  295.  
  296.  
  297. def true_j_func(z):
  298.     b = 5
  299.     num = 0
  300.     value = ""
  301.     bytes_ = b""
  302.     while True:
  303.         if b == 1:
  304.             num += 4
  305.             b += 2
  306.         else:
  307.             if b == 2:
  308.                 num = (num * yy) & 0xFFFFFFFF
  309.                 b += 8
  310.             else:
  311.                 if b == 3:
  312.                     num += true_f_func(6)
  313.                     b += 1
  314.                 else:
  315.                     if b == 4:
  316.                         z = b_func(z, 1)
  317.                         b += 2
  318.                     else:
  319.                         if b == 5:
  320.                             num = int(ww, 16) & 0xFFFFFFFF
  321.                             b -= 3
  322.                         else:
  323.                             if b == 6:
  324.                                 break
  325.                             if b == 7:
  326.                                 num += (
  327.                                     int(value) & 0xFFFFFFFF
  328.                                 )
  329.                                 b -= 6
  330.                             else:
  331.                                 if b == 10:
  332.                                     bytes_ = binascii.a2b_base64(
  333.                                         zz
  334.                                     )
  335.                                     b += 4
  336.                                 else:
  337.                                     if b == 14:
  338.                                         value = bytes_.decode(
  339.                                             "ascii"
  340.                                         )
  341.                                         b -= 7
  342.     return e_func(z, num % 256)
  343.  
  344.  
  345. a_func = true_b_func
  346. b_func = true_b_func
  347. c_func = true_d_func
  348. d_func = true_d_func
  349. e_func = true_e_func
  350. f_func = true_g_func
  351. g_func = true_g_func
  352. j_func = true_j_func
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement