你能解释一下这段代码吗? [英] can u explain this code?

查看:70
本文介绍了你能解释一下这段代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的朋友给了我这个代码.....它工作得很好....怎么来的?


如果你能理解,请解释我.....


#include< stdio.h>

#include< conio.h>

#define _(__, ___)\

___ ## __

_(id,vo)_8(_(

ar,ch)a,_( ar,ch

)* _ 2){_(ile,wh)(a

- )_(ntf,pri)("%s"

,_2);} _(id,vo)_1(_

(nt,i)s,_(nt,i)n,

_(nt,i)k = 1,_(ar,ch

)* _3 =" *"){_ 8(k,

" \ n"); _ 8(s,""); _ 8(

n,_3);} _(id,vo)_6(_(nt,i)k,_(nt,i )

l,_(ar,ch)* _9 _){_ 8(k," \ n"); _ 8(l,""); _(ile

,wh)(* _ 9 _)_(ntf,pri)("%c",* _ 9 _ ++ - 12);} _(id,

vo)_(in, ma)(){_(ar,ch)_1_1 _ [] =" cu?" t,nq?"

"?,~qsm~p?8",_ 2_2 _ [] =" X {wm"; _(ar,ch)_22 [] =

{240,32,0},_ 4; _1(20,3,6); _ 1(19,1)

; _1(4,1,0); _1(19,1); _1(1,1,0,

_22); _ 1(1,1,0); _ 1(19,1);

_1(4,1,0 ); _ 1(15,8);

_1(13,10); _ 1(0,1,0," *"); _

(或,f)(_ 4 = 0; _4< 4; _4 ++){_ 1(15 + _4 * 2,

8-_4 * 2); _(f,i)(_ 4 == 0) _1(0,2,0," *");} _(

或,f)(_ 4 = 2; _4> = 0; _4 - )_ 1(15 + _4 * 2,8-_4 * 2); _ 6(3,

26,_1_1 _); _ 6(2,40,_2_2 _); _(ile,wh)(!_(it,kbh)( ));}

my friend gave this code to me..... it is working fine....how come?

please explain me if u can understand.....

#include <stdio.h>
#include <conio.h>
#define _(__,___)\
___##__
_(id,vo) _8(_(
ar,ch)a,_(ar ,ch
)*_2){_(ile,wh) (a
--)_(ntf, pri)("%s"
,_2);}_(id,vo) _1(_
(nt,i) s,_(nt,i) n,
_(nt,i) k=1,_(ar,ch
) *_3="* "){_8 ( k,
"\n");_8(s," ");_8(
n,_3);}_(id,vo) _6(_(nt,i) k,_(nt,i)
l,_(ar,ch) *_9_){_8(k,"\n");_8(l, " ");_(ile
,wh)(*_9_)_(ntf,pri)("%c",*_9_++-12);} _(id,
vo) _(in,ma)(){_(ar,ch) _1_1_[]="cu?" "t,nq"
"?,~qsm~p8",_2_2_[]="X{wm";_(ar,ch) _22[]=
{240,32,0},_4;_1(20,3,6);_1(19,1)
;_1(4,1,0);_1(19,1); _1(1,1, 0,
_22);_1(1,1,0);_1(19,1);
_1(4,1,0);_1(15,8);
_1(13,10);_1(0,1,0,"*");_
(or,f)(_4=0;_4<4;_4++) {_1(15+_4*2,
8-_4*2);_(f,i)(_4==0) _1(0,2,0," *");}_(
or,f)(_4=2;_4>=0;_4--)_1(15+_4*2,8-_4*2);_6(3,
26,_1_1_);_6(2,40,_2_2_);_(ile,wh)(!_(it,kbh)());}

推荐答案

ka ************** @ gmail.com 说:

我的朋友把这个代码给了我.....它工作得很好....怎么来的?
my friend gave this code to me..... it is working fine....how come?



foo.c:2:conio.h:没有这样的文件或目录


看起来好像没有毕竟工作正常。


即使你忽略了这一点,它也会导致入口点的返回类型错误,所以

程序的行为未定义。关于这个节目,没有什么可以远的。

罚款。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)

foo.c:2: conio.h: No such file or directory

Looks like it doesn''t work fine after all.

And even if you ignore that, it gets the entry point''s return type wrong, so
the behaviour of the program is undefined. There''s nothing even remotely
fine about this program.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


2006年8月8日星期二 ka ************** @ gmail.com 写道:
On Tue, 8 Aug 2006 ka**************@gmail.com wrote:

我的朋友给了我这个代码.....它工作正常......怎么回事?


如果你能理解,请解释我......


#include< stdio.h>

#include< conio.h>


#define _(_ _,___)\

___ ## __

_(id,vo)_8(_ (

ar,ch)a,_(ar,ch

)* _ 2){_(ile,wh)(a

- - )_(ntf,pri)("%s"

,_2);} _(id,vo)_1(_

(nt,i)s ,_(nt,i)n,

_(nt,i)k = 1,_(ar,ch

)* _3 =" *") {_8(k,

" \ n"); _ 8(s," "); _ 8(

n,_3);} _(id,vo)_6(_(nt,i)k,_(nt,i)

l, _(ar,ch)* _9 _){_ 8(k," \ n"); _ 8(l," "); _(ile

,wh)(* _ 9 _)_(ntf,pri)("%c",* _ 9 _ ++ - 12);} _(id,

vo)_(in,ma)(){_(ar,ch)_1_1 _ [] =" cu?" t,nq?"

"?,~qsm~p?8",_ 2_2 _ [] =" X {wm"; _(ar,ch)_22 [] =

{240,32,0},_ 4; _1(20,3,6); _ 1(19,1)

; _1(4,1,0); _1(19,1); _1(1,1,0,

_22); _ 1(1,1,0); _ 1(19,1);

_1(4,1,0 ); _ 1(15,8);

_1(13,10); _ 1(0,1,0," *"); _

(或,f)(_ 4 = 0; _4< 4; _4 ++){_ 1(15 + _4 * 2,

8-_4 * 2); _(f,i)(_ 4 == 0) _1(0,2,0," *");} _(

或,f)(_ 4 = 2; _4> = 0; _4 - )_ 1(15 + _4 * 2,8-_4 * 2); _ 6(3,

26,_1_1 _); _ 6(2,40,_2_2 _); _(ile,wh)(!_(it,kbh)( ));}
my friend gave this code to me..... it is working fine....how come?

please explain me if u can understand.....

#include <stdio.h>
#include <conio.h>
#define _(__,___)\
___##__
_(id,vo) _8(_(
ar,ch)a,_(ar ,ch
)*_2){_(ile,wh) (a
--)_(ntf, pri)("%s"
,_2);}_(id,vo) _1(_
(nt,i) s,_(nt,i) n,
_(nt,i) k=1,_(ar,ch
) *_3="* "){_8 ( k,
"\n");_8(s," ");_8(
n,_3);}_(id,vo) _6(_(nt,i) k,_(nt,i)
l,_(ar,ch) *_9_){_8(k,"\n");_8(l, " ");_(ile
,wh)(*_9_)_(ntf,pri)("%c",*_9_++-12);} _(id,
vo) _(in,ma)(){_(ar,ch) _1_1_[]="cu?" "t,nq"
"?,~qsm~p8",_2_2_[]="X{wm";_(ar,ch) _22[]=
{240,32,0},_4;_1(20,3,6);_1(19,1)
;_1(4,1,0);_1(19,1); _1(1,1, 0,
_22);_1(1,1,0);_1(19,1);
_1(4,1,0);_1(15,8);
_1(13,10);_1(0,1,0,"*");_
(or,f)(_4=0;_4<4;_4++) {_1(15+_4*2,
8-_4*2);_(f,i)(_4==0) _1(0,2,0," *");}_(
or,f)(_4=2;_4>=0;_4--)_1(15+_4*2,8-_4*2);_6(3,
26,_1_1_);_6(2,40,_2_2_);_(ile,wh)(!_(it,kbh)());}



非可支持性[1]除此之外,这里的实际混淆是

相当简单:#define _(__,___) ___ ## __反向连接两个

参数。因此,_(id,vo)给出了无效,

_(ar,ch)* _ 2给你char * _2(等等)。


Tak-Shing


[1]我会留给学生们列举它们。

Nonportabilities [1] aside, the actual obfuscation here is
fairly simple: #define _(__,___) ___##__ concatenates its two
arguments in reverse. Thus, _(id,vo) gives gives you void,
_(ar,ch)*_2 gives you char*_2 (and so forth).

Tak-Shing

[1] I would leave it to the pedants to enumerate them.


Tak-Shing Chan (
Pi ****************************** @ scorpio.gold.ac.uk )说:


| 2006年8月8日星期二, ka ************** @ gmail.com 写道:

|

||我的朋友给了我这个代码.....它工作得很好....怎么来的?

||

||如果你能理解,请解释我.....

||

|| #include< stdio.h>

|| #include< conio.h>

||

||

|| #define _(__,___)\

|| ___ ## __

|| _(id,vo)_8(_(

|| ar,ch)a,_(ar,ch

||)* _ 2){_(ile, wh)(a

|| - )_(ntf,pri)("%s"

||,_ 2);} _(id,vo) _1(_

||(nt,i)s,_(nt,i)n,

|| _(nt,i)k = 1,_( ar,ch

||)* _3 =" *"){_ 8(k,

||" \ n"); _ 8(s, ""); _ 8(

|| n,_3);} _(id,vo)_6(_(nt,i)k,_(nt,i)

|| l,_(ar,ch)* _9 _){_ 8(k," \ n"); _ 8(l,""); _(ile

||,wh)(* _ 9 _)_(ntf,pri)("%c",* _ 9 _ ++ - 12);} _(id,

|| vo)_( in,ma)(){_(ar,ch)_1_1 _ [] =" cu?" t,nq?"

|| "?,~qsm~p?8",_ 2_2 _ [] =" X {wm"; _(ar,ch)_22 [] =

|| {240,32,0},_ 4; _1(20,3,6); _ 1(19,1)

|| ; _1(4,1,0); _ 1(19,1); _1(1,1,0,

|| _22); _ 1(1,1,0); _ 1(19,1);

|| _1(4,1,0); _ 1(15,8);

|| _1(13,10); _ 1(0,1,0," *"); _

|| (或,f)(_ 4 = 0; _4< 4; _4 ++){_ 1(15 + _4 * 2,

|| 8-_4 * 2); _(f,i)(_ 4 == 0)_1(0,2,0," *");} _(

||或,f)(_ 4 = 2; _4> = 0; _4--) _1(15 + _4 * 2,8-_4 * 2); _ 6(3,

|| 26,_1_1 _); _ 6(2,40,_2_2 _); _(ile,wh)( !_(它,kbh)());}

|

|除了非便携性[1]之外,这里的实际混淆是

|相当简单:#define _(__,___)___ ## __连接两个

|相反的论点。因此,_(id,vo)给出了无效,

| _(ar,ch)* _ 2给你char * _2(等等)。

|

|德成

|

| [1]我会把它留给学生来列举它们。


呃,不漂亮!随着自由重命名,我得到了:


#include< stdio.h>

#include< conio.h>


void fna(char a,char * s)

{while(a--)printf("%s",s);

}


void fnb(int k,int l,char * 9)

{fna(k," \ n");

fna(l,"");

while(* 9)printf("%c",* 9 ++ - 12);

} $ />

void fnc(int s,int n,int k = 1,char * t =" *")

{fna(k, " \ n");

fna(s,"");

fna(n,t);

}


void main()

{char v1 [] =" cu?t,nq ??,~qsm~p?8",br />
v2 [] =" X {wm",

v3 [] = {240,32,0},

i;


fnc(20,3,6);

fnc(19,1);

fnc(4,1,0);

fnc(19,1);

fnc(1,1,0,v3);

fnc(1,1,0);

fnc(19,1);

fnc(4,1,0);

fnc(15,8);

fnc(13,10);

fnc(0,1,0," *");

for(i = 0; I< 4; i ++)

{fnc(15 + i * 2,8-i * 2);

if(i == 0)fnc(0,2,0," ; *");

}

for(i = 2; i> = 0; i--)fnc(15 + i * 2,8-i * 2);

fnb(3,26,v1);

fnb(2,40,v2);

while(!kbhit( ));

}


留下作为OP的练习来列举问题。


-

Morris Dovey

DeSoto Solar

德索托,爱荷华州美国
http://www.iedu.com/DeSoto
Tak-Shing Chan (in
Pi******************************@scorpio.gold.ac.u k) said:

| On Tue, 8 Aug 2006 ka**************@gmail.com wrote:
|
|| my friend gave this code to me..... it is working fine....how come?
||
|| please explain me if u can understand.....
||
|| #include <stdio.h>
|| #include <conio.h>
||
||
|| #define _(__,___)\
|| ___##__
|| _(id,vo) _8(_(
|| ar,ch)a,_(ar ,ch
|| )*_2){_(ile,wh) (a
|| --)_(ntf, pri)("%s"
|| ,_2);}_(id,vo) _1(_
|| (nt,i) s,_(nt,i) n,
|| _(nt,i) k=1,_(ar,ch
|| ) *_3="* "){_8 ( k,
|| "\n");_8(s," ");_8(
|| n,_3);}_(id,vo) _6(_(nt,i) k,_(nt,i)
|| l,_(ar,ch) *_9_){_8(k,"\n");_8(l, " ");_(ile
|| ,wh)(*_9_)_(ntf,pri)("%c",*_9_++-12);} _(id,
|| vo) _(in,ma)(){_(ar,ch) _1_1_[]="cu?" "t,nq"
|| "?,~qsm~p8",_2_2_[]="X{wm";_(ar,ch) _22[]=
|| {240,32,0},_4;_1(20,3,6);_1(19,1)
|| ;_1(4,1,0);_1(19,1); _1(1,1, 0,
|| _22);_1(1,1,0);_1(19,1);
|| _1(4,1,0);_1(15,8);
|| _1(13,10);_1(0,1,0,"*");_
|| (or,f)(_4=0;_4<4;_4++) {_1(15+_4*2,
|| 8-_4*2);_(f,i)(_4==0) _1(0,2,0," *");}_(
|| or,f)(_4=2;_4>=0;_4--)_1(15+_4*2,8-_4*2);_6(3,
|| 26,_1_1_);_6(2,40,_2_2_);_(ile,wh)(!_(it,kbh)());}
|
| Nonportabilities [1] aside, the actual obfuscation here is
| fairly simple: #define _(__,___) ___##__ concatenates its two
| arguments in reverse. Thus, _(id,vo) gives gives you void,
| _(ar,ch)*_2 gives you char*_2 (and so forth).
|
| Tak-Shing
|
| [1] I would leave it to the pedants to enumerate them.

Ugh, not pretty! With liberal renaming I got:

#include <stdio.h>
#include <conio.h>

void fna(char a,char *s)
{ while (a--) printf("%s",s);
}

void fnb(int k,int l,char *9)
{ fna(k,"\n");
fna(l, " ");
while(*9) printf("%c",*9++-12);
}

void fnc(int s,int n,int k=1,char *t="* ")
{ fna(k,"\n");
fna(s," ");
fna(n,t);
}

void main()
{ char v1[] = "cu?t,nq?,~qsm~p8",
v2[] = "X{wm",
v3[] = { 240,32,0 },
i;

fnc(20,3,6);
fnc(19,1);
fnc(4,1,0);
fnc(19,1);
fnc(1,1, 0,v3);
fnc(1,1,0);
fnc(19,1);
fnc(4,1,0);
fnc(15,8);
fnc(13,10);
fnc(0,1,0,"*");
for (i=0; i<4; i++)
{ fnc(15+i*2,8-i*2);
if (i==0) fnc(0,2,0," *");
}
for (i=2; i>=0; i--) fnc(15+i*2,8-i*2);
fnb(3,26,v1);
fnb(2,40,v2);
while (!kbhit()) ;
}

Left as an exercise for the OP to enumerate the problems.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto


这篇关于你能解释一下这段代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆