易截截图软件、单文件、免安装、纯绿色、仅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}'/ ......

eclipse3.5+cdt编译c有问题

编译普通的c没问题啊,但编译javah生成的就报错:
gcc -O0 -g3 -Wall -c -fmessage-length=0 -oHelloWorld.o ..\HelloWorld.c
gcc -otest.exe HelloWorld.o
d:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../. ......

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

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

我很伤心,C即将被淘汰!

6月5日消息,XX网站日前评出了10项大势已去的计算机技术。其中,有些技术已经被淘汰,有些即将被淘汰。如著名的Cobol语言,以及IBM的OS/2系统。

  以下为XX网站评出的被淘汰的10项计算机技术:

   ......

上海地区招聘C工程师[

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