Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace JRiddle
  5. {
  6. class MainClass
  7. {
  8. static void JRiddle()
  9. {
  10. var message = new byte[] {
  11.  
  12. 181, 18, // XXX, XXX,
  13. 181, 45, // XXX, XXX,
  14. 181, 59, // XXX, XXX,
  15. 181, 60, // XXX, XXX,
  16. 181, 45, // XXX, XXX,
  17. 182, 35, // XXX, XXX,
  18. 180, 232, // XXX, XXX,
  19. 181, 11, // XXX, XXX,
  20. 180, 235, // XXX, XXX,
  21. 181, 23, // XXX, XXX,
  22. 181, 20, // XXX, XXX,
  23. 181, 13, // XXX, XXX,
  24. 181, 26, // XXX, XXX,
  25. 181, 22, // XXX, XXX,
  26. 181, 17, // let the 8086's word XXX, XXX,
  27. 181, 13, // cross his boundary XXX, XXX,
  28. 180, 232, // at Little Bighorn XXX, XXX,
  29. 181, 44, // +1876*6*25 XXX, XXX,
  30. 181, 55, // XXX, XXX,
  31. 181, 42, 181, 58, // XXX, XXX, XXX, XXX,
  32. 181, 65, 180, 233, // XXX, XXX, XXX, XXX,
  33. 180, 232, 181, 48, // XXX, XXX, XXX, XXX,
  34. 181, 60, 181, 60, // XXX, XXX, XXX, XXX,
  35. 181, 56, 181, 2, // XXX, XXX, XXX, XXX,
  36. 180, 247, 180, 247, // XXX, XXX, XXX, XXX,
  37. 181, 50, 181, 43, // XXX, XXX, XXX, XXX,
  38. 181, 55, 181, 53, // XXX, XXX, XXX, XXX,
  39. 181, 53, 181, 45, // XXX, XXX, XXX, XXX,
  40. 181, 58, 181, 43, // XXX, XXX, XXX, XXX,
  41. 181, 45, 180, 246, // XXX, XXX, XXX, XXX,
  42. 181, 56, 181, 52, // XXX, XXX, XXX, XXX,
  43. 180, 247, 181, 44, // XXX, XXX, XXX, XXX,
  44. 181, 55, 181, 42, // XXX, XXX, XXX, XXX,
  45. 181, 58, 181, 65, // XXX, XXX, XXX, XXX,
  46. 181, 44, 181, 45, // XXX, XXX, XXX, XXX,
  47. 181, 62, 180, 247, // XXX, XXX, XXX, XXX,
  48. 181, 7, 181, 46, // XXX, XXX, XXX, XXX,
  49. 181, 41, 181, 59, // XXX, XXX, XXX, XXX,
  50. 181, 44, 181, 45, // XXX, XXX, XXX, XXX,
  51. 180, 252, 180, 253 // XXX, XXX, XXX, XXX
  52.  
  53. // (68k) (x86)
  54. };
  55.  
  56. Array.Reverse (message);
  57.  
  58. int weirdSum = 1876 * 6 * 25;
  59.  
  60. short[] shortMessage = new short[message.Length / sizeof(short)];
  61. Buffer.BlockCopy(message, 0, shortMessage, 0, shortMessage.Length);
  62.  
  63. for (int i = 0; i < shortMessage.Length; ++i) {
  64. shortMessage[i] = (short)(shortMessage[i] + weirdSum);
  65. }
  66.  
  67. byte[] newMessage = new byte[shortMessage.Length];
  68. Buffer.BlockCopy(shortMessage, 0, newMessage, 0, newMessage.Length);
  69.  
  70. Console.WriteLine(Reverse(Encoding.Unicode.GetString(newMessage)));
  71. }
  72.  
  73. public static string Reverse( string s )
  74. {
  75. char[] charArray = s.ToCharArray();
  76. Array.Reverse( charArray );
  77. return new string( charArray );
  78. }
  79.  
  80. public static void Main (string[] args)
  81. {
  82. JRiddle ();
  83. }
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement