网上流传的绿坝关键字解码程序源代码 gddec.c 文件终于被找到了!
庆祝一下 这个电脑没有VC 找个有的编译一下 哈哈 绿坝 "不限制言论自由" ? 你们看着吧
下面是源代码
gddec.c
// gddec.c -- Decode encrypted data files from Green Dam Chinese censorware.
// By J. Alex Halderman (jhalderm@eecs.umich.edu) and Scott Wolchok (swolchok@umich.edu)
// June 10, 2009
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
void dec(unsigned char *buf, int len, unsigned char *out)
{
int i;
for (i=0; i < len; i += 2 ) {
unsigned int r = (buf[i] << 4) | (buf[i+1] & 0xF);
out[i/2] = ~r ^ (r ^ (unsigned char)~r) & 0x33;
}
out[i/2] = '\0';
}
void decfile(char *file)
{
FILE *f = fopen(file, "rb");
char buf[512], out[512];
while (fgets(buf, sizeof(buf), f) > 0) {
//printf("%s\n", buf);
memset(out, 0, sizeof(out));
dec(buf, strlen(buf), out);
printf("%s\n", out);
}
fclose(f);
}
int main(int argc, char *argv[])
{
if (argc < 2) {
fprintf(stderr, "usage: dec [file]\n");
return -1;
}
int i;
for (i=1; i < argc; i++)
decfile(argv[i]);
return 0;
}
代码来自网络 本人不承担任何责任
没有评论:
发表评论