Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- char plain[132];
- int coded[] = {
- 0xcea0e991,
- 0x592c2490,
- 0x76fec1eb,
- 0
- };
- //{ 0x28a2e840,
- // 0x00ab0649,
- // 0x96d1e05b,
- // 0x6e17bae5,
- // 0x82fa648d,
- // 0xa0e1c0c3,
- // 0xa4b6735d,
- // 0xe759254f,
- // 0xef993fbc,
- // 0x46f8e1b0,
- // 0x750e6b70,
- // 0x83f1d488,
- // 0x473314cb,
- // 0x910b13d5,
- // 0x91e26003,
- // 0x05addcfb,
- // 0x8a52c750,
- // 0xec072a87,
- // 0x9b8298ee,
- // 0xbb325200,
- // 0x8923dace,
- // 0x87055ba1,
- // 0x62df6fb3,
- // 0x476dcca4,
- // 0x329e8cf4,
- // 0x151e4be7,
- // 0xdd317982,
- // 0xca945f4b,
- // 0x5e7c405f,
- // 0x2e2df171,
- // 0x97a93395,
- // 0x2af15979,
- // 0x7dbf61b1,
- // 0x5cf2f46c,
- // 0x355b1989,
- // 0xb0810ac8,
- // 0x7f99986e,
- // 0xb721b6f2,
- // 0x3e6592f0,
- // 0xb7c7f2e8,
- // 0x991780ac,
- // 0xb4053909,
- // 0x5757afbe,
- // 0xadd842bd,
- // 0x25fbdf48,
- // 0x05254034,
- // 0x3c49f606,
- // 0x69ab9b63,
- // 0x5a6f8f6b,
- // 0x0573d564,
- // 0x8e7ec9b0,
- // 0xb02e9235,
- // 0x09cfbfaa,
- // 0x6cff3594,
- // 0xf3676ced,
- // 0xc4d898ef,
- // 0xad7cb3c1,
- // 0xa0c38286,
- // 0x68c04bc5,
- // 0xcb247220,
- // 0x898644a5,
- // 0x99967ca2,
- // 0x621c3154,
- // 0x57341cb9,
- // 0x2fbc9787,
- // 0x5a90041b,
- // 0xa04ba652,
- // 0x4ef463d6,
- // 0x90444fa0,
- // 0x77bf078a,
- // 0xeff192c7,
- // 0xdca4b2a3,
- // 0xa4e8418b,
- // 0x7c2f707e,
- // 0xc9eacc29,
- // 0xce2a55ad,
- // 0x813b5ede,
- // 0xeb066a95,
- // 0x1425011b,
- // 0xa53ef6f6,
- // 0x54facdc1,
- // 0xb558a5de,
- // 0x9797ff17,
- // 0x64cb4d0b,
- // 0x7d727adc,
- // 0x40fe648a,
- // 0 };
- int CountZero(unsigned int seed_addr);
- int codgen(int* seed_addr);
- int decode(int* wordarr, char* bytearr, int* seed_addr);
- int main() {
- int seed = 0x5374decc;
- codgen(&seed);
- /*unsigned int seed = 0x50d084ca;
- decode(coded, plain, &seed);
- printf(plain);*/
- return 0;
- }
- int decode(int* wordarr, char* bytearr, int* seed_addr) {
- unsigned int m, r, x, y;
- x = ~(codgen(seed_addr));
- if (*wordarr == 0) {
- bytearr = 0;
- r = x;
- }
- else {
- wordarr++;
- bytearr++;
- y = decode(wordarr, bytearr, seed_addr);
- m = (x - y) + *wordarr;
- m = (m << 10) >> 24;
- cout << m << endl;
- *bytearr = m + '0';
- r = (~(codgen(seed_addr))) + 1;
- r = x + y + m + r + 5;
- }
- return r;
- }
- int codgen(int* seed_addr) {
- unsigned int tempSeed = *seed_addr;
- int n;
- unsigned int x, y;
- n = CountZero(tempSeed);
- x = tempSeed * 4;
- y = tempSeed >> 5;
- tempSeed = (x ^ y ^ n);
- *seed_addr = tempSeed;
- cout << tempSeed << endl;
- return (tempSeed ^ 0x5b84d0ff);
- }
- int CountZero(unsigned int seed_addr) {
- int i = 0;
- int controll = 0;
- while (controll < 32) {
- if (!(seed_addr % 2 == 1)) {
- i++;
- }
- seed_addr = seed_addr / 2;
- controll++;
- }
- cout << "Zeros is : " << i << endl;
- return i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement