CFreeMarshaler::MarshalInterface逆向结果唯一可以触发CFreeMarshaler::InitSecret的地方

HRESULT __stdcall CFreeMarshaler::MarshalInterface(CFreeMarshaler *this, IStream *pStm, _GUID *riid, void *pv, unsigned int dwDestContext, void *pvDestContext, unsigned int mshlflags)
{
  int v7; // edi
  HRESULT result; // eax
  unsigned int v9; // eax
  unsigned int v10; // ST18_4
  void *v11; // ST14_4
  unsigned int v12; // ST10_4
  CObjectContext *v13; // eax
  __int64 v14; // [esp+10h] [ebp-24h] OVERLAPPED
  HRESULT hr; // [esp+18h] [ebp-1Ch]
  CPPEH_RECORD ms_exc; // [esp+1Ch] [ebp-18h]
  int fUseCurrentApartment; // [esp+3Ch] [ebp+8h]

  hr = 0;
  if ( dwDestContext == 3 || dwDestContext == 4 )
  {
    dwDestContext = 0;
    v7 = (**(int (__stdcall ***)(void *, _GUID *, unsigned int *))pv)(pv, riid, &dwDestContext);
    if ( v7 >= 0 )
    {
      v7 = pStm->_SelfStreamVtbl->Write(pStm, &mshlflags, 4u, 0);
      if ( v7 )
        goto LABEL_25;
      v14 = (signed int)dwDestContext;
      v7 = pStm->_SelfStreamVtbl->Write(pStm, &v14, 8u, 0);
      if ( v7 < 0 )
        goto LABEL_25;
      if ( !CFreeMarshaler::_fSecretInit )
        v7 = CFreeMarshaler::InitSecret(this);
      if ( v7 < 0
        || (v7 = pStm->_SelfStreamVtbl->Write(pStm, CFreeMarshaler::_SecretBlock, 16u, 0)) != 0
        || mshlflags == 2 )
      {
LABEL_25:
        (*(void (__stdcall **)(unsigned int))(*(_DWORD *)dwDestContext + 8))(dwDestContext);
      }
    }
    result = v7;
  }
  else
  {
    fUseCurrentApartment = UseFTMFromCurrentApartment();
    HIDWORD(v14) = 0;
    if ( !fUseCurrentApartment )
      HIDWORD(v14) = EnterNTA(g_pNTAEmptyCtx);
    ms_exc.registration.TryLevel = 0;
    hr = InitChannelIfNecessary();
    if ( hr >= 0 )
    {
      v9 = mshlflags;
      if ( !fUseCurrentApartment )
        v9 = mshlflags | 0x40000;
      v10 = v9;
      v11 = pvDestContext;
      v12 = dwDestContext;
      v13 = GetEmptyContext();
      hr = StdMarshalObject(pStm, riid, (IUnknown *)pv, v13, v12, v11, v10);
    }
    ms_exc.registration.TryLevel = -2;
    if ( !fUseCurrentApartment )
      LeaveNTA((CObjectContext *)HIDWORD(v14));
    result = hr;
  }
  return result;
}

看看会不会触发CFreeMarshaler::InitSecret,windbg接着看https://googleprojectzero.blogspot.kr/2014/12/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值