Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. char plain[132];
  8. int coded[] = {
  9. 0xcea0e991,
  10. 0x592c2490,
  11. 0x76fec1eb,
  12. 0
  13. };
  14. //{ 0x28a2e840,
  15. // 0x00ab0649,
  16. // 0x96d1e05b,
  17. // 0x6e17bae5,
  18. // 0x82fa648d,
  19. // 0xa0e1c0c3,
  20. // 0xa4b6735d,
  21. // 0xe759254f,
  22. // 0xef993fbc,
  23. // 0x46f8e1b0,
  24. // 0x750e6b70,
  25. // 0x83f1d488,
  26. // 0x473314cb,
  27. // 0x910b13d5,
  28. // 0x91e26003,
  29. // 0x05addcfb,
  30. // 0x8a52c750,
  31. // 0xec072a87,
  32. // 0x9b8298ee,
  33. // 0xbb325200,
  34. // 0x8923dace,
  35. // 0x87055ba1,
  36. // 0x62df6fb3,
  37. // 0x476dcca4,
  38. // 0x329e8cf4,
  39. // 0x151e4be7,
  40. // 0xdd317982,
  41. // 0xca945f4b,
  42. // 0x5e7c405f,
  43. // 0x2e2df171,
  44. // 0x97a93395,
  45. // 0x2af15979,
  46. // 0x7dbf61b1,
  47. // 0x5cf2f46c,
  48. // 0x355b1989,
  49. // 0xb0810ac8,
  50. // 0x7f99986e,
  51. // 0xb721b6f2,
  52. // 0x3e6592f0,
  53. // 0xb7c7f2e8,
  54. // 0x991780ac,
  55. // 0xb4053909,
  56. // 0x5757afbe,
  57. // 0xadd842bd,
  58. // 0x25fbdf48,
  59. // 0x05254034,
  60. // 0x3c49f606,
  61. // 0x69ab9b63,
  62. // 0x5a6f8f6b,
  63. // 0x0573d564,
  64. // 0x8e7ec9b0,
  65. // 0xb02e9235,
  66. // 0x09cfbfaa,
  67. // 0x6cff3594,
  68. // 0xf3676ced,
  69. // 0xc4d898ef,
  70. // 0xad7cb3c1,
  71. // 0xa0c38286,
  72. // 0x68c04bc5,
  73. // 0xcb247220,
  74. // 0x898644a5,
  75. // 0x99967ca2,
  76. // 0x621c3154,
  77. // 0x57341cb9,
  78. // 0x2fbc9787,
  79. // 0x5a90041b,
  80. // 0xa04ba652,
  81. // 0x4ef463d6,
  82. // 0x90444fa0,
  83. // 0x77bf078a,
  84. // 0xeff192c7,
  85. // 0xdca4b2a3,
  86. // 0xa4e8418b,
  87. // 0x7c2f707e,
  88. // 0xc9eacc29,
  89. // 0xce2a55ad,
  90. // 0x813b5ede,
  91. // 0xeb066a95,
  92. // 0x1425011b,
  93. // 0xa53ef6f6,
  94. // 0x54facdc1,
  95. // 0xb558a5de,
  96. // 0x9797ff17,
  97. // 0x64cb4d0b,
  98. // 0x7d727adc,
  99. // 0x40fe648a,
  100. // 0 };
  101.  
  102. int CountZero(unsigned int seed_addr);
  103. int codgen(int* seed_addr);
  104. int decode(int* wordarr, char* bytearr, int* seed_addr);
  105.  
  106. int main() {
  107.  
  108. int seed = 0x5374decc;
  109. codgen(&seed);
  110.  
  111. /*unsigned int seed = 0x50d084ca;
  112. decode(coded, plain, &seed);
  113. printf(plain);*/
  114.  
  115. return 0;
  116. }
  117.  
  118. int decode(int* wordarr, char* bytearr, int* seed_addr) {
  119. unsigned int m, r, x, y;
  120. x = ~(codgen(seed_addr));
  121. if (*wordarr == 0) {
  122. bytearr = 0;
  123. r = x;
  124. }
  125. else {
  126. wordarr++;
  127. bytearr++;
  128. y = decode(wordarr, bytearr, seed_addr);
  129. m = (x - y) + *wordarr;
  130. m = (m << 10) >> 24;
  131. cout << m << endl;
  132. *bytearr = m + '0';
  133. r = (~(codgen(seed_addr))) + 1;
  134. r = x + y + m + r + 5;
  135. }
  136. return r;
  137. }
  138.  
  139. int codgen(int* seed_addr) {
  140. unsigned int tempSeed = *seed_addr;
  141. int n;
  142. unsigned int x, y;
  143.  
  144. n = CountZero(tempSeed);
  145. x = tempSeed * 4;
  146. y = tempSeed >> 5;
  147. tempSeed = (x ^ y ^ n);
  148. *seed_addr = tempSeed;
  149. cout << tempSeed << endl;
  150. return (tempSeed ^ 0x5b84d0ff);
  151. }
  152.  
  153.  
  154. int CountZero(unsigned int seed_addr) {
  155. int i = 0;
  156. int controll = 0;
  157.  
  158. while (controll < 32) {
  159. if (!(seed_addr % 2 == 1)) {
  160. i++;
  161. }
  162. seed_addr = seed_addr / 2;
  163. controll++;
  164. }
  165. cout << "Zeros is : " << i << endl;
  166. return i;
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement