作者yellowfishie (喵喵喵喵~~~)
看板NTUGIEE_EDA
标题暗黑程式?
时间Tue Jun 13 07:09:17 2006
有没有人有兴趣把程式转成让人看不懂(不容易看懂),
但却可以正确执行的?
就是把有意义的变数/函数名称
转成无意义的变数/函数名称 (如 sum => xxx, answer => xxxx)
例如:
int main()
{
int s = sum(100);
return s;
}
int sum(int upper_bound)
{
int answer = 0;
for (int i = 1; i <= upper_bound; i++)
{ answer += i; }
return answer;
}
转成:
int main()
{
int Xx = xXx(100);
return Xx;
}
int xXx(int xXXx)
{
int xxxXx = 0;
for (int x = 1; x <= xXXx; x++)
{ xxxXx += x; }
return xxxXx;
}
看起来用 lex 加乱数就可以达到。
多的额外功能: 建一个 symbol table, 进行加密/解密。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.220.92.244
1F:→ yellowfishie:把常数也换掉 const int xXXXx 100 06/13 07:10
2F:→ yellowfishie:加一些redundant function 混淆, int xXxx(int xXXx) 06/13 07:12
3F:推 ye11owfish:release 成 "dark router" 06/13 07:16
4F:→ ye11owfish:"X" router = = 06/13 07:17
5F:推 meifc:好像有程式可以直接转?? 06/13 08:39
6F:推 moonshade:之前不是就有暗黑OOooOOOooOo 程式了... 06/13 10:32
7F:→ moonshade:你还可以用macro把其他syntax带换掉 06/13 11:11
8F:推 gwliao:找compiler construction的tool来改, 很快就达到目的了. 06/13 14:26
9F:→ gwliao:我之前改过, 将C变成C. 把所有语法变成A=B op C 06/13 14:27
10F:→ gwliao:和IF-ELSE-GOTO的语法, 然後把所有symbol换成s加数字. 06/13 14:29
11F:→ gwliao:这样很适合吧 XD 不过要转行做compiler才会学到这些. :P 06/13 14:30