IDA pro“this”关键字 我想知道“这个”关键字的确切含义是在IDA Pro伪C++代码中。< /P>
假设我有一个函数调用:IDA pro“this”关键字 我想知道“这个”关键字的确切含义是在IDA Pro伪C++代码中。< /P>,c++,visual-studio-2008,decompiling,ida,C++,Visual Studio 2008,Decompiling,Ida,假设我有一个函数调用: 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;
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;
}
好的,在函数中我们可以看到定义“intthis”,根据文档,它是指向用于调用对象的对象的指针。我想知道的是,我如何重写函数,使它们操作相同,但不需要传递“this”参数?this调用意味着它是类成员函数,因此您希望将其重写为
class MyClass {
int sub_100010B3(const char* Str1);
};
MyClass::sub_100010B3(const char* Str1)
{
// .. implementation
}
thiscall表示它是一个类成员函数,因此您希望将其重写为
class MyClass {
int sub_100010B3(const char* Str1);
};
MyClass::sub_100010B3(const char* Str1)
{
// .. implementation
}
sub_100010B3是IDA Pro在分解二进制文件时给出的例程名称。它与函数的原始名称无关。谢谢jcopenha。类可以是静态的吗?类的存储限定符应该很重要。只需确保实现的函数不是静态的。sub_100010B3是IDA Pro在分解二进制文件时给出的例程名称。它与函数的原始名称无关。谢谢jcopenha。类可以是静态的吗?类的存储限定符应该很重要。只需确保实现的函数不是静态的。