当前位置: 首页 > news >正文

LoadableTransportInfo函数分析之和全局对象LoadedLoadableTransports的关系


第一部分:
插入全局对象变量LoadedLoadableTransports

RPC_STATUS
LoadableTransportInfo (
    IN RPC_CHAR * DllName,
    IN RPC_CHAR PAPI * RpcProtocolSequence,
    OUT TRANS_INFO * PAPI *pTransInfo
    )
{


    if ( Status != RPC_S_OK
        || LoadedLoadableTransports->Insert(LoadableTransport) == -1 )
        {


1: kd> x rpcrt4!LoadedLoadableTransports
77c837bc          RPCRT4!LoadedLoadableTransports = 0x00942588
1: kd> dx -id 0,0,897f4020 -r1 ((RPCRT4!LOADABLE_TRANSPORT_DICT *)0x942588)
((RPCRT4!LOADABLE_TRANSPORT_DICT *)0x942588)                 : 0x942588 [Type: LOADABLE_TRANSPORT_DICT *]
    [+0x000] DictSlots        : 0x942594 [Type: void * *]
    [+0x004] cDictSlots       : 0x4 [Type: unsigned int]
    [+0x008] cDictSize        : 0x0 [Type: unsigned int]
    [+0x00c] InitialDictSlots [Type: void * [4]]

之后:
1: kd> x rpcrt4!LoadedLoadableTransports
77c837bc          RPCRT4!LoadedLoadableTransports = 0x00942588
1: kd> dx -id 0,0,897f4020 -r1 ((RPCRT4!LOADABLE_TRANSPORT_DICT *)0x942588)
((RPCRT4!LOADABLE_TRANSPORT_DICT *)0x942588)                 : 0x942588 [Type: LOADABLE_TRANSPORT_DICT *]
    [+0x000] DictSlots        : 0x942594 [Type: void * *]
    [+0x004] cDictSlots       : 0x4 [Type: unsigned int]
    [+0x008] cDictSize        : 0x1 [Type: unsigned int]
    [+0x00c] InitialDictSlots [Type: void * [4]]
1: kd> dx -id 0,0,897f4020 -r1 (*((RPCRT4!void * (*)[4])0x942594))
(*((RPCRT4!void * (*)[4])0x942594))                 [Type: void * [4]]
    [0]              : 0x943a80 [Type: void *]
    [1]              : 0x0 [Type: void *]
    [2]              : 0x0 [Type: void *]
    [3]              : 0x0 [Type: void *]


第二部分:
RPC_STATUS
LoadableTransportInfo (
    IN RPC_CHAR * DllName,
    IN RPC_CHAR PAPI * RpcProtocolSequence,
    OUT TRANS_INFO * PAPI *pTransInfo
    )
{

    while ((LoadableTransport
            = LoadedLoadableTransports->Next(cursor)) != 0)
        {
        *pTransInfo = LoadableTransport->MapProtocol (
                                                DllName,
                                                RpcProtocolSequence) ;
        if (*pTransInfo != 0)
            {
            ClearGlobalMutex();

            return RPC_S_OK;
            }
        }

第三部分:

TRANS_INFO *
LOADABLE_TRANSPORT::MapProtocol (
    IN RPC_CHAR * DllName,
    IN RPC_CHAR PAPI * ProtocolSequence
    )
/*++

Routine Description:

    This method is used to search the dictionary.  It compares a
    LOADABLE_TRANSPORT with a transport interface to see if
    they match.

Arguments:

    DllName - Supplies the name of the dll from which this loadable
        transport interface was loaded.

Return Value:

--*/
{
    TRANS_INFO *Protseq ;
    TRANSPORT_LOAD TransportLoad;
    RPC_TRANSPORT_INTERFACE  pTransport;
    DictionaryCursor cursor;

    if (RpcpStringCompare(DllName, this->DllName) != 0)
        {
        return 0;
        }

    ProtseqDict.Reset(cursor) ;
    while ((Protseq = ProtseqDict.Next(cursor)) != 0)
        {
        if (Protseq->MatchProtseq(ProtocolSequence))
            {
            return Protseq ;
            }
        }


inline BOOL
TRANS_INFO::MatchProtseq(
    IN RPC_CHAR *ProtocolSeq
    )
{
    if (RpcpStringCompare(ProtocolSeq, RpcProtocolSequence) == 0)
        {
        return 1 ;
        }

    return 0;
}


第四部分:

1: kd> dt RPCRT4!LOADABLE_TRANSPORT 0x943a80
   +0x000 ThreadsStarted   : 0n0
   +0x004 DllName          : [257] 0x72
   +0x208 NumThreads       : 0n0
   +0x20c LoadedDll        : 0x00943700 DLL
   +0x210 ProtseqDict      : TRANS_INFO_DICT
   +0x22c ThreadsDoingLongWait : INTERLOCKED_INTEGER
   +0x230 Reserved0        : [7] 0n-1163005939
   +0x24c ProcessCallsFunc : 0x77c66ea4     long  RPCRT4!COMMON_ProcessCalls+0
   +0x250 nOptimalNumberOfThreads : 0n3
   +0x254 PnpListen        : 0x77c66d26     void  RPCRT4!COMMON_ListenForPNPNotifications+0
   +0x258 GetHandleForThread : 0x77c661e1     void*  RPCRT4!GetCompletionPortHandleForThread+0
   +0x25c ReleaseHandleForThread : 0x77c66278     void  RPCRT4!ReleaseCompletionPortHandleForThread+0
   +0x260 Reserved1        : [3] 0n-1163005939
   +0x26c Reserved2        : [7] 0n-1163005939
   +0x288 nThreadsAtCompletionPort : INTERLOCKED_INTEGER
   +0x28c Reserved3        : [7] 0n-1163005939
   +0x2a8 nActivityValue   : 0n0
1: kd> dx -id 0,0,897f4020 -r1 (*((RPCRT4!TRANS_INFO_DICT *)0x943c90))        //+0x210 ProtseqDict      : TRANS_INFO_DICT
(*((RPCRT4!TRANS_INFO_DICT *)0x943c90))                 [Type: TRANS_INFO_DICT]
    [+0x000] DictSlots        : 0x943c9c [Type: void * *]
    [+0x004] cDictSlots       : 0x4 [Type: unsigned int]
    [+0x008] cDictSize        : 0x1 [Type: unsigned int]
    [+0x00c] InitialDictSlots [Type: void * [4]]
1: kd> dx -id 0,0,897f4020 -r1 (*((RPCRT4!void * (*)[4])0x943c9c))
(*((RPCRT4!void * (*)[4])0x943c9c))                 [Type: void * [4]]
    [0]              : 0x943d70 [Type: void *]
    [1]              : 0x0 [Type: void *]
    [2]              : 0x0 [Type: void *]
    [3]              : 0x0 [Type: void *]
1: kd> dt RPCRT4!TRANS_INFO 0x943d70
   +0x000 pTransportInterface : 0x77bece00 RPC_TRANSPORT_INTERFACE_HEADER
   +0x004 LoadableTrans    : 0x00943a80 LOADABLE_TRANSPORT
   +0x008 RpcProtocolSequence : [257] 0x6e
1: kd> dx -id 0,0,897f4020 -r1 (*((RPCRT4!unsigned short (*)[257])0x943d78))
(*((RPCRT4!unsigned short (*)[257])0x943d78))                 [Type: unsigned short [257]]
    [0]              : 0x6e [Type: unsigned short]
    [1]              : 0x63 [Type: unsigned short]
    [2]              : 0x61 [Type: unsigned short]
    [3]              : 0x63 [Type: unsigned short]
    [4]              : 0x6e [Type: unsigned short]
    [5]              : 0x5f [Type: unsigned short]
    [6]              : 0x6e [Type: unsigned short]
    [7]              : 0x70 [Type: unsigned short]
    [8]              : 0x0 [Type: unsigned short]
    [9]              : 0xbaad [Type: unsigned short]

1: kd> db 0x943d78
00943d78  6e 00 63 00 61 00 63 00-6e 00 5f 00 6e 00 70 00  n.c.a.c.n._.n.p.
00943d88  00 00 ad ba 0d f0 ad ba-0d f0 ad ba 0d f0 ad ba  ................

http://www.dtcms.com/a/134076.html

相关文章:

  • 本地Dify配置https协议【无域名版】
  • 每日算法-250415
  • C++中unique_lock和lock_guard区别
  • T1结构像+RS-fMRI影像处理完整过程记录(数据下载+Matlab工具箱+数据处理)
  • 【第45节】windows程序的其他反调试手段上篇
  • 【2025年3月中科院1区SCI】Rating entropy等级熵及5种多尺度,特征提取、故障诊断新方法!
  • Docker技术基础新手入门教程
  • 获取类路径
  • NLP高频面试题(四十二)——RAG系统评估:方法、指标与实践指南
  • bash的特性-常用的通配符
  • HarmonyOS-ArkUI V2装饰器: @Computed装饰器:计算属性
  • 【刷题2025】知识点梳理
  • Notepad++中将文档格式从Windows(CR LF)转换为Unix(LF)
  • ollama修改配置使用多GPU,使用EvalScope进行模型压力测试,查看使用负载均衡前后的性能区别
  • vue复习46~90
  • designware IP如何被FPGA综合
  • 【控制学】控制学分类
  • 儿童后期至青少年早期脑网络隔离增强的发育机制研究
  • 中国反制关税影响分析、可能性分析
  • 基于Python的PC控制Robot 小程序开发历程
  • 虚拟机ubuntu网络如何使用windows物理机的代理
  • 【差分隐私相关概念】瑞丽差分隐私(RDP)引理1
  • 【差分隐私相关概念】瑞丽差分隐私(RDP)-命题1
  • Web前端开发——图像与多媒体文件(上)
  • 计算机视觉——基于 Yolov8 目标检测与 OpenCV 光流实现目标追踪
  • 在ros2上使用opencv显示一张图片
  • 智能指针(内存泄漏)
  • 高德地图自有数据添加图层
  • Ubuntu安装yum遇到Package ‘yum‘ has no installation candidate
  • CSRF(跨站请求伪造)漏洞概述