首页
社区
课程
招聘
[求助]IDA 64 构造函数的返回值
发表于: 2015-9-30 09:24 5320

[求助]IDA 64 构造函数的返回值

2015-9-30 09:24
5320
下面这个是IDA Pro F5的代码,对应一个类的构造函数,谁能帮我解释下构造函数中写的是什么,数组赋值吗,下面的字符串也是数组吗,怎么构造函数还有返回值呢?各种疑问
初学IDA,求前辈指点
__int64 __usercall CFilePath::CFilePath@<rax>(__int64 a1@<rbp>, __int64 a2@<rdi>, __int64 a3@<rsi>)
{
  __int64 result; // rax@1

  *(_QWORD *)(a1 - 32) = a2;
  *(_QWORD *)(a1 - 40) = a3;
  std::allocator<char>::allocator(a1 - 9, a3);
  std::string::string(*(_QWORD *)(a1 - 32), *(_QWORD *)(a1 - 40), a1 - 9);
  std::allocator<char>::~allocator(a1 - 9);
  *(_BYTE *)(*(_QWORD *)(a1 - 32) + 8LL) = 0;
  *(_BYTE *)(*(_QWORD *)(a1 - 32) + 9LL) = 0;
  *(_BYTE *)(*(_QWORD *)(a1 - 32) + 10LL) = 0;
  *(_BYTE *)(*(_QWORD *)(a1 - 32) + 11LL) = 0;
  *(_BYTE *)(*(_QWORD *)(a1 - 32) + 12LL) = 0;
  std::string::string((std::string *)(*(_QWORD *)(a1 - 32) + 16LL));
  std::string::string((std::string *)(*(_QWORD *)(a1 - 32) + 24LL));
  std::string::string((std::string *)(*(_QWORD *)(a1 - 32) + 32LL));
  std::string::string((std::string *)(*(_QWORD *)(a1 - 32) + 40LL));
  std::string::string((std::string *)(*(_QWORD *)(a1 - 32) + 48LL));
  result = *(_QWORD *)(a1 - 32);
  *(_DWORD *)(result + 56) = -1;
  return result;
}

[峰会]看雪.第八届安全开发者峰会10月23日上海龙之梦大酒店举办!

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 18
活跃值: (1039)
能力值: ( LV7,RANK:110 )
在线值:
发帖
回帖
粉丝
2
2015-9-30 09:56
0
雪    币: 69
活跃值: (30)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
请无视返回值。
2015-9-30 13:38
0
雪    币: 237
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
4
构造函数返回this指针。

在x86平台下,函数调用约定有:__cdecl、__stdcall、__fastcall、__thiscall等,而x64下的调用约定只作如下限制:

    前4个整数参数(从左至右)通过4个寄存器传递:RCX、RDX、R8、R9,前4个以外的整数参数将传递到堆栈, 指针被视为整数参数;

rcx - rdx - r8 - r9 - rest on stack
2015-9-30 14:19
0
雪    币: 18
活跃值: (26)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
5
不应该是前6个参数用寄存器传吗?怎么变成4个了。。
2015-10-8 10:51
0
雪    币: 237
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
6
msvc
2015-10-8 12:12
0
游客
登录 | 注册 方可回帖
返回
//