// 新的.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
int encode(const void* raw_in, void* raw_out, uint32_t password, size_t len)
{
const uint8_t* in = (const uint8_t*)raw_in;
uint8_t* out = (uint8_t*)raw_out;
uint32_t seed = password ^ 0x4e60d2fdu;
for (size_t i = 0 ; i < len; ++i) {
uint8_t a = ( in[i] ^ seed ) >> 3;
uint8_t b = ( ( ((uint32_t)in[i]) << 20 ) ^ seed ) >> (20-5);
a &= 31;
b &= 224;
out[i] = a | b;
seed = (((seed << 7) ^ seed ^ in[i]) + 84723701);
}
return 1;
}
int decode(const void* raw_in, void* raw_out, uint32_t password, size_t len)
{
const uint8_t* in = (const uint8_t*)raw_in;
uint8_t* out = (uint8_t*)raw_out;
uint32_t seed = password ^ 0x4e60d2fdu;
for (size_t i = 0 ; i < len; ++i) {
// 请在此处补全代码
uint8_t a=31&in[i];
uint8_t b=224&in[i];
a=((a<<3)^seed)&248;
b=(((((uint32_t)b)<<15)^seed)>>20)&(7);
out[i]=a|b;
seed = (((seed << 7) ^ seed ^ out[i]) + 84723701);
}
return 1;
}
int main()
{
const uint8_t buf1[] = {0xab, 0xd0, 0x79, 0x6e, 0x71, 0xc5, 0xcc, 0x43, 0x39, 0x56, 0xcc, 0xf6, 0x33, 0xbf, 0x15, 0xcd, 0x96, 0x63, 0xc5, 0x68, 0xee, 0xc7, 0x90, 0x18, 0x70, 0xb7, 0xcf, 0x28, 0x7e, 0x42, 0x36, 0x1f, 0x24, 0xd8, 0x40, 0xaa, 0xf0, 0x65, 0xd7, 0xd2, 0x94, 0x97, 0x71, 0x14, };
uint8_t buf2[100] = {};
const uint32_t password = 0x5d8ae36du;
const size_t len = sizeof(buf1);
decode(buf1, buf2, password, len);
printf("%s\n", buf2);
system("pause");
}
//
#include "stdafx.h"
#include <iostream>
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
int encode(const void* raw_in, void* raw_out, uint32_t password, size_t len)
{
const uint8_t* in = (const uint8_t*)raw_in;
uint8_t* out = (uint8_t*)raw_out;
uint32_t seed = password ^ 0x4e60d2fdu;
for (size_t i = 0 ; i < len; ++i) {
uint8_t a = ( in[i] ^ seed ) >> 3;
uint8_t b = ( ( ((uint32_t)in[i]) << 20 ) ^ seed ) >> (20-5);
a &= 31;
b &= 224;
out[i] = a | b;
seed = (((seed << 7) ^ seed ^ in[i]) + 84723701);
}
return 1;
}
int decode(const void* raw_in, void* raw_out, uint32_t password, size_t len)
{
const uint8_t* in = (const uint8_t*)raw_in;
uint8_t* out = (uint8_t*)raw_out;
uint32_t seed = password ^ 0x4e60d2fdu;
for (size_t i = 0 ; i < len; ++i) {
// 请在此处补全代码
uint8_t a=31&in[i];
uint8_t b=224&in[i];
a=((a<<3)^seed)&248;
b=(((((uint32_t)b)<<15)^seed)>>20)&(7);
out[i]=a|b;
seed = (((seed << 7) ^ seed ^ out[i]) + 84723701);
}
return 1;
}
int main()
{
const uint8_t buf1[] = {0xab, 0xd0, 0x79, 0x6e, 0x71, 0xc5, 0xcc, 0x43, 0x39, 0x56, 0xcc, 0xf6, 0x33, 0xbf, 0x15, 0xcd, 0x96, 0x63, 0xc5, 0x68, 0xee, 0xc7, 0x90, 0x18, 0x70, 0xb7, 0xcf, 0x28, 0x7e, 0x42, 0x36, 0x1f, 0x24, 0xd8, 0x40, 0xaa, 0xf0, 0x65, 0xd7, 0xd2, 0x94, 0x97, 0x71, 0x14, };
uint8_t buf2[100] = {};
const uint32_t password = 0x5d8ae36du;
const size_t len = sizeof(buf1);
decode(buf1, buf2, password, len);
printf("%s\n", buf2);
system("pause");
}
//搜狗浏览器提出了业界首创的全网加速功能!!!
你明白其中的奥妙了吗?