Advertisement
luckytyphlosion

vc factory code

Jan 26th, 2017
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.16 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. code = [0x08,0x3e,0x10,0xea,0x49,0xcc,0x21,0xb5,0xd2,0x11,0x91,0xcf,0x0e,0x01,0xcd,0x96,0xd5,0x3e,0x05,0x12,0xea,0x95,0xcf,0xea,0x63,0xd1,0xcd,0x27,0x39,0x54,0x01,0x04,0x4f,0xcd,0x95,0xd5,0x23,0x01,0x02,0x62,0xcd,0x95,0xd5,0x01,0x02,0x53,0xcd,0x95,0xd5,0x2e,0xec,0x0e,0x03,0xcd,0x96,0xd5,0x1e,0xd6,0x2e,0xec,0xcd,0x29,0x38,0x1e,0xe1,0x2e,0xaa,0xcd,0x29,0x38,0xaf,0xea,0x80,0xda,0xcd,0x68,0x3a,0x30,0xfc,0x06,0x1c,0x21,0x48,0x78,0xc3,0xd6,0x35,0x58,0x2a,0x87,0x86,0x23,0x12,0x13,0x0d,0x20,0xf7,0xc9]
  3.  
  4. char_conversion = [
  5. (0x7f, " "),
  6. (0x80, "A"),
  7. (0x81, "B"),
  8. (0x82, "C"),
  9. (0x83, "D"),
  10. (0x84, "E"),
  11. (0x85, "F"),
  12. (0x86, "G"),
  13. (0x87, "H"),
  14. (0x88, "I"),
  15. (0x89, "J"),
  16. (0x8a, "K"),
  17. (0x8b, "L"),
  18. (0x8c, "M"),
  19. (0x8d, "N"),
  20. (0x8e, "O"),
  21. (0x8f, "P"),
  22. (0x90, "Q"),
  23. (0x91, "R"),
  24. (0x92, "S"),
  25. (0x93, "T"),
  26. (0x94, "U"),
  27. (0x95, "V"),
  28. (0x96, "W"),
  29. (0x97, "X"),
  30. (0x98, "Y"),
  31. (0x99, "Z"),
  32. (0x9a, "("),
  33. (0x9b, ")"),
  34. (0x9c, ":"),
  35. (0x9d, ";"),
  36. (0x9e, "["),
  37. (0x9f, "]"),
  38. (0xa0, "a"),
  39. (0xa1, "b"),
  40. (0xa2, "c"),
  41. (0xa3, "d"),
  42. (0xa4, "e"),
  43. (0xa5, "f"),
  44. (0xa6, "g"),
  45. (0xa7, "h"),
  46. (0xa8, "i"),
  47. (0xa9, "j"),
  48. (0xaa, "k"),
  49. (0xab, "l"),
  50. (0xac, "m"),
  51. (0xad, "n"),
  52. (0xae, "o"),
  53. (0xaf, "p"),
  54. (0xb0, "q"),
  55. (0xb1, "r"),
  56. (0xb2, "s"),
  57. (0xb3, "t"),
  58. (0xb4, "u"),
  59. (0xb5, "v"),
  60. (0xb6, "w"),
  61. (0xb7, "x"),
  62. (0xb8, "y"),
  63. (0xb9, "z"),
  64. (0xe1, "[pk]"),
  65. (0xe2, "[mn]"),
  66. (0xe3, "-"),
  67. (0xe6, "?"),
  68. (0xe7, "!"),
  69. (0xef, "β™‚"),
  70. (0xf1, "Γ—"),
  71. (0xf2, "."),
  72. (0xf3, "/"),
  73. (0xf4, ","),
  74. (0xf5, "♀"),
  75. ]
  76.  
  77. char_conversion_dict = dict(char_conversion)
  78.  
  79. def hex_to_twochar(num, lastchar):
  80.     twochar = None
  81.     for char in char_conversion:
  82.         doubled_char = (char[0] * 2) & 0xff
  83.         required_num = ((num - doubled_char) & 0xff)
  84.         if required_num in char_conversion_dict:
  85.             twochar = [char[1],char_conversion_dict[required_num]]
  86.             if char[1] == lastchar:
  87.                 return twochar
  88.    
  89.     return twochar
  90.  
  91. lastchar = "A"
  92. output = ""
  93.  
  94. for i, byte in enumerate(code):
  95.     twochar = hex_to_twochar(byte, lastchar)
  96.     lastchar = twochar[1]
  97.     output += twochar[0] + twochar[1]
  98.     if i % 5 == 4:
  99.         output += "\n"
  100.         lastchar = "A"
  101.         if i % 30 == 29:
  102.             output += "===\n"
  103.        
  104. print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement