取消引用 **this 并将 *this 设置为零?
Dereferencing **this and setting *this to zero?
**这是取消引用然后它的值设置为零。有人可以解释这里发生了什么吗?其中一个函数是某个结构的构造函数,我想知道是哪个。
void **__thiscall PossiblyCtor1(void **this)
{
void **ret;
ret = this;
*this = 0; // <- HERE
PossiblyCtor2(this);
return ret;
}
它是在 malloc 之后的某个其他函数中间调用的:
--- unimportant code ---
v43 = (void **)Allocate(4u, v46, v47);
if ( v43 )
v44 = PossiblyCtor1(v43); // <- CALL
else
v44 = 0;
--- unimportant code ---
请原谅我这些愚蠢的名字,但这是来自 IDA 的逆向工程代码。
[已解决] 它将 NULL 设置为已经分配给堆的指针的 "value"(感谢 Mooing Duck 的帮助),然后将该 NULL ptr 作为 "this" 发送到某个对象的构造函数。
PossiblyCtor1
是一个实际的构造函数。
**这是取消引用然后它的值设置为零。有人可以解释这里发生了什么吗?其中一个函数是某个结构的构造函数,我想知道是哪个。
void **__thiscall PossiblyCtor1(void **this)
{
void **ret;
ret = this;
*this = 0; // <- HERE
PossiblyCtor2(this);
return ret;
}
它是在 malloc 之后的某个其他函数中间调用的:
--- unimportant code ---
v43 = (void **)Allocate(4u, v46, v47);
if ( v43 )
v44 = PossiblyCtor1(v43); // <- CALL
else
v44 = 0;
--- unimportant code ---
请原谅我这些愚蠢的名字,但这是来自 IDA 的逆向工程代码。
[已解决] 它将 NULL 设置为已经分配给堆的指针的 "value"(感谢 Mooing Duck 的帮助),然后将该 NULL ptr 作为 "this" 发送到某个对象的构造函数。
PossiblyCtor1
是一个实际的构造函数。