易截截图软件、单文件、免安装、纯绿色、仅160KB

经典C程序求解

Problem 1
Read Ken Thompson's article ...

char s[] = {
'\t',
'0',
'\n',
'}',
';",
'\n',
'\n',
'/',
'*',
'\n',
(213 lines deleted)
0
};

/* The string s is a
* representation of the body
* of this program from '0'
* to the end.
*/

main(){
  int i;
  printf("char\ts{ } = {\n");
  for(i=0; s[i]; i++)
      printf("\t%d,\n",s[i]);
  printf("%s",s);
}
Compile and run this program. You will have to figure out what goes in the 213 deleted lines. If you want, you can leave the comment out of the string s and out of the program. Explain the output. By itself, this program does not pose any sort of security threat. Explain in your own words what this program has to do with Thompson's Trojan Horse attack.
没看懂。
printf("%s",s); 执行这句的时候,s[1]的'0'为什么没打出来呢?

up

找到那个'0'了,刚才看错行了。
不过还是没看明白木马是怎么回事

mark

找到原文了,这是Ken Thompson获得图灵奖的演讲的一部分。
这段代码是一个例子,它可以产生具有自我复制能力的程序。
不过……还是没看懂

Figure 1 shows a s


相关问答:

jsp中 <c:if test> 相关问题

在查询后将查询出来的值赋给各输入框
<c:if test="${not empty dataValue}">
      fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......

ftp上传下载c文件方式

在ue中从远程unix用二进制方式下载c文件到本地,修改之后用二进制方式上传到unix中,再用vi打开该文件,每行后面就会有一个^M的换行符,如果采用ascii方式下载,二进制方式上传的话就没有^M,那请问这样会对程序文件 ......

c/c++每条指令和函数的执行时间是多少?

想知道每条指令或函数的系统消耗。比如系统执行int a=0;的开销是多少。有没有类似的文档之类的。不要和我说用什么clock()函数来测试。我想要相关总结好的文档
先反汇编,然后拿着cpu的指令手册查每条指令的时间周期 ......

你们现在还在用C吗?C有前途吗?

你们现在还在用C吗?C有前途吗?
一定,并永远坚持

引用
一定,并永远坚持



有用。

楼主何出此言

楼主来c版问这个问题是踢馆用意吗哈哈

越来越冷是肯定的,完全淘汰倒也没那么容易

c ......

上海地区招聘C工程师[

要求: 计算机或者通信专业
      熟悉C语言,有嵌入式开发经验
      1-2年工作经验(应届生如侧重系统、底层也可以)
            &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号