首页
社区
课程
招聘
[求助]一段IDA F5的代码,求指导
发表于: 2016-1-19 09:47 3497

[求助]一段IDA F5的代码,求指导

2016-1-19 09:47
3497
在逆向一个C++函数时,IDA F5出现了一段之前没有遇到过的代码,请前辈帮我分析下面红色字体部分的代码是什么意思。sagem_bio::fe::ElementaryTemplate *__fastcall sagem_bio::fe::CharacterizedItemExt::GetDeltaList(sagem_bio::fe::CharacterizedItemExt *this)
{
  __int64 v1; // rax@1
  __int64 v2; // rbx@1
  sagem_bio::fe::ElementaryTemplate *result; // rax@5

  v1 = *((_QWORD *)this + 1);
  v2 = *(_QWORD *)(v1 + 40);
  if ( v2 == v1 + 24 )
  {
LABEL_6:
    if ( !`guard variable for'sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)const::l__EmptyArray )
    {
      if ( __cxa_guard_acquire(&`guard variable for'sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)const::l__EmptyArray) )
      {
        sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst = (__int64)&sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst;
        qword_DC8D78 = (__int64)&sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst;
        __cxa_guard_release(&`guard variable for'sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)const::l__EmptyArray);
        __cxa_atexit(_tcf_2, 0LL, &_dso_handle);
      }
    }
    result = (sagem_bio::fe::ElementaryTemplate *)&sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst;

  }
  else
  {
    while ( !(unsigned __int8)sagem_bio::fe::ElementaryTemplate::HasDeltaData((sagem_bio::fe::ElementaryTemplate *)(v2 + 64)) )
    {
      v2 = std::_Rb_tree_increment((const std::_Rb_tree_node_base *)v2);
      if ( *((_QWORD *)this + 1) + 24LL == v2 )
        goto LABEL_6;
    }
    result = sagem_bio::fe::ElementaryTemplate::GetDeltaData((sagem_bio::fe::ElementaryTemplate *)(v2 + 64));
  }
  return result;
}

交叉引用部分:

.bss:0000000000DC8D60 ; `guard variable for'sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)const::l__EmptyArray
.bss:0000000000DC8D60 _ZGVZNK9sagem_bio2fe20CharacterizedItemExt12GetDeltaListEvE13l__EmptyArray db ?
.bss:0000000000DC8D60                                         ; DATA XREF: sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void):loc_634B15r
.bss:0000000000DC8D60                                         ; sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void):loc_634B2Ao ...
.bss:0000000000DC8D61                 align 10h
.bss:0000000000DC8D70 ; sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst
.bss:0000000000DC8D70 _ZZNK9sagem_bio2fe20CharacterizedItemExt12GetDeltaListEvE13l__EmptyArray dq ?
.bss:0000000000DC8D70                                         ; DATA XREF: __tcf_2+1o
.bss:0000000000DC8D70                                         ; __tcf_2+Dr ...
.bss:0000000000DC8D78 qword_DC8D78    dq ?                    ; DATA XREF: sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)+8Fw
.bss:0000000000DC8D80 ; `guard variable for'sagem_bio::fe::CharacterizedItemExt::GetCoreList(void)const::l__EmptyArray
.bss:0000000000DC8D80 _ZGVZNK9sagem_bio2fe20CharacterizedItemExt11GetCoreListEvE13l__EmptyArray db ?
.bss:0000000000DC8D80                                         ; DATA XREF: sagem_bio::fe::CharacterizedItemExt::GetCoreList(void):loc_634135r
.bss:0000000000DC8D80                                         ; sagem_bio::fe::CharacterizedItemExt::GetCoreList(void):loc_63414Ao ...
.bss:0000000000DC8D81                 align 10h
.bss:0000000000DC8D90 ; sagem_bio::fe::CharacterizedItemExt::GetCoreList(void)::l__EmptyArrayconst
.bss:0000000000DC8D90 _ZZNK9sagem_bio2fe20CharacterizedItemExt11GetCoreListEvE13l__EmptyArray dq ?
.bss:0000000000DC8D90                                         ; DATA XREF: __tcf_1_0+1o
.bss:0000000000DC8D90                                         ; __tcf_1_0+Dr ...
.bss:0000000000DC8D98 qword_DC8D98    dq ?                    ; DATA XREF: sagem_bio::fe::CharacterizedItemExt::GetCoreList(void)+8Fw
.bss:0000000000DC8DA0 ; `guard variable for'sagem_bio::fe::CharacterizedItemExt::GetMinutiaeList(void)const::l__EmptyArray
.bss:0000000000DC8DA0 _ZGVZNK9sagem_bio2fe20CharacterizedItemExt15GetMinutiaeListEvE13l__EmptyArray db ?
.bss:0000000000DC8DA0                                         ; DATA XREF: sagem_bio::fe::CharacterizedItemExt::GetMinutiaeList(void):loc_634505r
.bss:0000000000DC8DA0                                         ; sagem_bio::fe::CharacterizedItemExt::GetMinutiaeList(void):loc_63451Ao ...
.bss:0000000000DC8DA1                 align 10h
.bss:0000000000DC8DB0 ; sagem_bio::fe::CharacterizedItemExt::GetMinutiaeList(void)::l__EmptyArrayconst
.bss:0000000000DC8DB0 _ZZNK9sagem_bio2fe20CharacterizedItemExt15GetMinutiaeListEvE13l__EmptyArray dq ?

下面是我整理的代码作为参照
                list<Delta>* CharacterizedItemExt::GetDeltaList()
                {
                        map<ExtractionID, ElementaryTemplate> ::iterator it = this->internalItem->templateMap.begin();
                        if (this->internalItem->templateMap.empty())
                        {
                        LABEL_6:
                                //        if (__cxa_guard_acquire(&`guard variable for'sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)const::l__EmptyArray) )
                                //        {
                                //                sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst = (__int64)&sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst;
                                //                qword_DC8D78 = (__int64)&sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst;
                                //                __cxa_guard_release(&`guard variable for'sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)const::l__EmptyArray);
                                //                        __cxa_atexit(_tcf_2, 0LL, &_dso_handle);
                                //        }
                                //}
                                //result = (sagem_bio::fe::ElementaryTemplate *)&sagem_bio::fe::CharacterizedItemExt::GetDeltaList(void)::l__EmptyArrayconst;
                        }
                        else
                        {
                                while (!it->second.HasDeltaData())
                                {
                                        it++;
                                        if (it == this->internalItem->templateMap.end())
                                        {
                                                goto LABEL_6;
                                        }
                                }
                                return it->second.GetDeltaData();
                        }
                }

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//