我已使用IDA Pro撤消了一个dll。看看IDA生成的伪代码我对QT库中的一组调用感兴趣,它是否试图找到函数的位置以便它可以调用它们?我想尝试重复发生的事情,但是我对IDA生成的代码感到有些困惑,有人可以给我一些关于真正需要的指示吗?在定义函数调用时,我对使用'this'特别感兴趣,因为我不确定它的含义。感谢。
int v2; // eax@10
int v3; // eax@10
char v12; // [sp+14h] [bp-368h]@10
int v13; // [sp+20h] [bp-35Ch]@10
...
v2 = sub_100010B3((int)&v12, "QtGui4.dll");
v19 = sub_10001115((int)&v12, v2, "?rowsInserted@QListView@@MAEXABVQModelIndex@@HH@Z");
Buf2 = -1;
v21 = 21;
v24 = (unsigned int)v19 >> 24;
v23 = (unsigned int)v19 >> 16;
v22 = v19;
v3 = sub_100010B3((int)&v12, "QtCore4.dll");
v13 = sub_10001115((int)&v12, v3, "?endInsertRows@QAbstractItemModel@@IAEXXZ");
int __thiscall sub_10001115(int this, int a1, const char *Str1)
{
int v3; // eax@5
int v5; // [sp+0h] [bp-10h]@1
char v6; // [sp+4h] [bp-Ch]@4
int *v7; // [sp+8h] [bp-8h]@1
int v8; // [sp+Ch] [bp-4h]@1
v5 = this;
v7 = (int *)sub_10001470(this, *(_DWORD *)a1);
v8 = 0;
while ( *v7 )
{
if ( *v7 & 0x80000000 )
{
v6 = (*v7 & 0xFFFF) == (_DWORD)Str1;
}
else
{
v3 = sub_10001470(v5, *v7);
v6 = stricmp(Str1, (const char *)(v3 + 2)) == 0;
}
if ( v6 )
return sub_10001470(v5, *(_DWORD *)(a1 + 16)) + 4 * v8;
++v7;
++v8;
}
return 0;
}
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 __thiscall sub_10001090(int this, int a2)
{
return sub_10001470(this, *(_DWORD *)(*(_DWORD *)(this + 4) + 8 * a2 + 120));
}
int __thiscall sub_10001470(int this, int a2)
{
int result; // eax@3
if ( *(_DWORD *)(this + 8) && a2 )
result = a2 + *(_DWORD *)(this + 8);
else
result = 0;
return result;
}
答案 0 :(得分:0)
看起来它首先在表中查找一些DLL条目,该表返回一个似乎具有该DLL提供的函数列表的结构。然后它查看可用函数列表中的Dll条目结构,通过序数(将str1视为DWORD)或名称(在Str1上执行stricmp)检查,然后可能返回它找到的函数指针。
答案 1 :(得分:0)
似乎v12是某个类的实例,它执行DLL查找。 sub_100010B3似乎与LoadLibrary和sub_10001115大致对应于GetProcAddress。 “this”指的是在调用C ++方法时传递的隐式“this”对象实例指针。
请参阅my article和talk,了解C ++在低级别的工作原理。