【问题标题】:C++ how to compile __thiscall in MS VC++ 6.0C++ 如何在 MS VC++ 6.0 中编译 __thiscall
【发布时间】:2012-01-24 01:28:58
【问题描述】:

假设我有这个使用 HexRays 生成的代码.. 但似乎 __thiscall 不能在 VC++ 6.0 中使用。

nonstandard extension used : '__thiscall' keyword reserved for future use

如何在 VC++ 6.0 中解决这个问题?

long v4 = 0x004AC370;
#define _DWORD long
(*(void (__thiscall **)(int, int))(*(_DWORD *)v4 + 76))(v4, 8);

如何在 MS VC++ 6.0 中调用上述内容。

我知道 __thiscall 用于类成员,但我有指针并希望避免任何类制作。

谢谢。

【问题讨论】:

  • 对于缺乏上下文的读者,这里是完整的问题:stackoverflow.com/questions/8980306/…
  • 好吧,格雷格我想..如果我不能在最后一个问题中调用整个函数..那么为什么不调用内部函数,因为它们是半 C++ 代码,然后是整个函数.. 看看会发生什么。

标签: c++ visual-c++ assembly calling-convention


【解决方案1】:

指向成员函数的指针(您需要定义一个类)是 C++ 中提供隐式 this 参数的唯一方法。除此之外,您还可以使用内联汇编。

【讨论】:

  • 如何在内联汇编中做到这一点? this 总是静态的吗?
猜你喜欢
  • 2010-12-26
  • 1970-01-01
  • 2012-06-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-25
相关资源
最近更新 更多