简体   繁体   English

IDA pro'this'关键字

[英]IDA pro 'this' keyword

I am wondering what the exact meaning of the 'this' keyword is in the IDA pro pseudo c++ code. 我想知道'this'关键字在IDA pro伪c ++代码中的确切含义是什么。

Lets say that I have a function call: 让我们说我有一个函数调用:

v2 = sub_100010B3((int)&v12, "QtGui4.dll");

Which call this function: 哪个叫这个功能:

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;
}

Ok, so in the function we can see the definition 'int this' which according to the docs is a pointer to the object which is used to invoke the object. 好的,所以在函数中我们可以看到定义'int this',根据docs是一个指向用于调用对象的对象的指针。 What I am wondering is how I can rewrite the function so that they will operate the same but do not need to pass the 'this' parameter? 我想知道的是我如何重写函数以便它们将运行相同但不需要传递'this'参数?

The thiscall means it is a Class member function so you would want to rewrite it as thiscall表示它是一个Class成员函数,因此您需要将其重写为

class MyClass {
   int sub_100010B3(const char* Str1);
};

MyClass::sub_100010B3(const char* Str1)
{
  // .. implementation
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM