【发布时间】:2019-07-04 14:48:36
【问题描述】:
我正在学习反编译和分析一个名为 d3d9.dll 的 dll 文件,据我所知,字符串常量存储在 dll 的 .rdata 部分中,但如下所示(IDA 字符串窗口),它们存储在 .text 部分中。我不知道为什么会这样。它们何时存储在 .rdata 中,何时存储在 .text 中?
.text:4FE45850 00000050 C Declaration can't map to legacy FVF because a nonzero stream index is used: %d.
.text:4FE458A0 0000007B C Declaration can't map to fixed function FVF because fixed function pipeline does not support generation methods %s or %s.
.text:4FE45920 000000B9 C Declaration can't map to fixed function FVF because fixed function requires that generation methods %s, %s or %s can only be used with type %s and usage being one of: %s, %s, %s or %s.
.text:4FE459E0 0000008D C Declaration can't map to fixed function FVF because fixed function requires that generation method %s can only be used with usages %s or %s.
.text:4FE45A70 000000A3 C Declaration can't map to fixed function FVF because gaps or overlap between vertex elements are not allowed. Offset encountered is: %d, but expected offset is %d.
.text:4FE45B18 0000005E C Declaration can't map to fixed function FVF because the type for this element is unsupported.
.text:4FE45B78 00000072 C Declaration can't map to fixed function FVF because a generation method other than D3DDECLMETHOD_DEFAULT is used.
【问题讨论】:
-
我相信答案是 Windows。
-
这是怎么复制的?!它专门讨论
.rdata中的事情,而不是.text,而这个问题涵盖了 100% 的反向 - do 进入.text的事情,即使链接的答案表明这些字符串应该是在rdata. -
一个短字符串可以作为代码的一部分直接放入寄存器。编译器可以将任何东西放在任何地方,只要它可以工作。
-
我认为这两个问题是不同的,我想知道为什么以及何时将字符串常量存储在 .text 部分而不是 .rdata 中。此外,我认为如果字符串和 int 变量之间存在差异,我尝试了第一种情况 'const char foo[] = "fdsafdsa";',字符串仍然在 const 数据部分而不是文本部分。
标签: c++ c dll compilation