我想知道'this‘关键字在IDA伪c++代码中的确切含义是什么。
假设我有一个函数调用:
v2 = sub_100010B3((int)&v12, "QtGui4.dll");
它调用这个函数:
int __thiscall sub_100010B3(int this, const char *Str1)
{
int result; // eax@2
int v3; // eax@4
int v4; // [sp+0h] [bp-8h]@1
int v5; // [sp+4h] [bp-4h]@1
v4 = this;
v5 = sub_10001090(this, 1);
if ( v5 )
{
while ( *(_DWORD *)(v5 + 16) )
{
v3 = sub_10001470(v4, *(_DWORD *)(v5 + 12));
if ( !stricmp(Str1, (const char *)v3) )
return v5;
v5 += 20;
}
result = 0;
}
else
{
result = 0;
}
return result;
}
好的,在函数中我们可以看到定义'int this‘,根据文档,它是一个指向用于调用对象的对象的指针。我想知道的是,我如何重写函数,使它们的操作相同,但不需要传递'this‘参数?
发布于 2010-12-24 21:40:54
thiscall意味着它是一个类成员函数,因此您可能希望将其重写为
class MyClass {
int sub_100010B3(const char* Str1);
};
MyClass::sub_100010B3(const char* Str1)
{
// .. implementation
}
https://stackoverflow.com/questions/4528424
复制