English 中文(简体)
Frame Pointer / Program Counter /Array Overflow
原标题:Frame Pointer / Program Counter / Array Overflow
  • 时间:2010-01-11 04:43:42
  •  标签:
  • c

我正在研究为C方案拟订确定的一个实践问题,我曾遇到这一问题。 我并不完全确定问题要求什么......因为教育与发展协会是停止教学,但我们却在什么地方注射死胎? 为什么菲律宾武装部队与这一问题相关? 谢谢!

You've被指派担任飞往Jupiter的行星间空间飞行任务的主要计算机工程师。 经过几个月的空间之后,该船的主要电脑HAL9000开始故障,并开始从船员中杀人。 你们最后的船员是否活着,你需要把HAL 9000计算机trick成执行HALT指令。 好消息是,你知道,停止教学的机器编码是(在六十九届)xDEADBEEF(在德西马尔,是559 038 737名)。 坏消息是,HAL 9000操作系统愿意实际运行的唯一方案是ches。 幸运的是,我们详细印刷了藏匿处方案的源代码(所有重要部分摘录如下)。 请注意,“电离层”功能是一套非零的电离层,在X阵列中按顺序排列。 该方案的原始作者显然期望我们只提供两个积极的数字,但该方案中没有任何东西可以阻止我们输入三个或更多数字。 我们还知道,这套子弹将使用8 000至8999年的记忆点,最初的参照点值将为8996。

void getValues(void) {
  int x[2]; // array to hold input values
  int k = 0;
  int n;
  n = readFromKeyboard(); // whatever you type on the keyboard is assigned to n
  while (n != 0) {
    x[k] = nextNumber;
    k = k + 1;
    n = readFromKeyboard();// whatever you type on the keyboard is assigned to n
  }
  /* the rest of this function is not relevant */
}

int main(void) {
  int x;
  getValues();
  /* the rest of main is not relevant */
}

贵国在迫使计算机执行停止指令的关键板上应当有什么样的编号?

页 次 解决办法

   One of the first three numbers should be -559038737.  The fourth number must be the address of where 0xdeadbeef was placed into memory.  Typical values for the 4th number are 8992 (0xdeadbeef is the second number) or 8991 (0xdeadbeef is first number).  
最佳回答

你们想要做的是overflow the content,这样,该方案将回到你在返回地址超写的一套指示中。

问题在于:

  int x[2]; // array to hold input values

你们通过超过3个价值观,就可以忘掉你们的记忆。 举例说明:

  1. First input -559,038,737 puts xDEADBEEF in memory
  2. Second input -559,038,737, why not.
  3. Third number -559,038,737 can t hurt
  4. Fourth number 8992 is the address we want the function to return into.

当这项职能要求返回时,它将返回地址,在 st(8992)的回去地址。

以下是一些手法资源,摘录如下:

实际的缓冲流舱工作类似:

  1. 具有超支潜力的成文法。

  2. Put the code to be executed in the buffer, i.e., on the stack.

  3. Point the return address to the same code you have just put on the stack.

关于这个专题的一本好书是:“Hacking:The art of exploitation,如果你喜欢围绕摇篮和电话程序做餐。

就你而言,他们似乎期望你在提交意见的分类中发出指示。

关于缓冲溢流的条款

问题回答

Hint: Read about buffer over exploitations。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签