Assembly language - third element points to

这一生的挚爱 提交于 2019-12-24 14:33:56

问题


would really appreciate if someone can tell me what the third element in the strong list reads.

This is NOT HW, I am merely preparing myself.

Thank you.


回答1:


Our StringList is a linked list. The 1st pointer goes to the string value of the current element, the 2nd pointer goes to the next node. The head of the list is at location 0x000010000:

  1. at 0x00001000: value = ..., next = 0x00003000 (the head element)
  2. at 0x00003000: value = ..., next = 0x00000010
  3. at 0x00000010: value = 0x4024FFA4, next = ... (our target element)

The string at position 0x4024FFA4 reads 43 4F 4D 50 55 54 45 52 00 which when interpreted as ASCII can be decoded to "COMPUTER". Notice that the byte order at each address means we have to read the bytes right to left.




回答2:


I believe that amon has produced the intended answer but I thought that, for the sake of completeness, I would follow the logic as described in the original question. Again, I believe that the question itself is worded incorrectly and this is why.

  1. Head is defined as being a pointer/address to the first element in the StringList and Head is at address 0x00001000.
  2. Therefore, Head (defined as a pointer and not a StringList) points to the first element (FirstElement) at 0x00238480.
  3. FirstElement.next is the address to the second element (SecondElement) at 0x0A00C84C.
  4. SecondElement.next is the address to the third element (ThirdElement) at 0x415A494E.
  5. However, from the memory map given, we cannot see what is stored at address 0x415A494E and therefore, cannot answer the question.


来源:https://stackoverflow.com/questions/23118559/assembly-language-third-element-points-to

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!