问题
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:
- at
0x00001000:value = ..., next = 0x00003000(the head element) - at
0x00003000:value = ..., next = 0x00000010 - 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.
Headis defined as being a pointer/address to the first element in the StringList andHeadis at address 0x00001000.- Therefore,
Head(defined as a pointer and not a StringList) points to the first element (FirstElement) at0x00238480. - FirstElement.next is the address to the second element (SecondElement) at
0x0A00C84C. - SecondElement.next is the address to the third element (ThirdElement) at
0x415A494E. - However, from the memory map given, we cannot see what is stored at address
0x415A494Eand therefore, cannot answer the question.
来源:https://stackoverflow.com/questions/23118559/assembly-language-third-element-points-to