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

WINTRUST!_GetMessage函数分析之CRYPT32!CryptSIPGetSignedDataMsg函数的作用是得到nt5inf.cat的信息

UEDIT打开nt5inf.cat。

第一部分:

BOOL _GetMessage(CRYPT_PROVIDER_DATA *pProvData)
{
DWORD               dwMsgEncoding;
SIP_SUBJECTINFO     *pSubjInfo;
SIP_DISPATCH_INFO   *pSip;

    DWORD               cbEncodedMsg;
BYTE                *pbEncodedMsg;

    DWORD               dwMsgType;
HCRYPTMSG           hMsg;
HCRYPTPROV          hProv;

    dwMsgEncoding   = 0;
dwMsgType       = 0;

    switch(pProvData->pWintrustData->dwUnionChoice)
{
case WTD_CHOICE_CATALOG:
if ((_ISINSTRUCT(CRYPT_PROVIDER_DATA, pProvData->cbStruct, fRecallWithState)) &&
(pProvData->fRecallWithState) &&
(pProvData->hMsg))
{
return(TRUE);
}

            pSip        = pProvData->pPDSip->pCATSip;
pSubjInfo   = pProvData->pPDSip->psSipCATSubjectInfo;
break;

        case WTD_CHOICE_BLOB:
case WTD_CHOICE_FILE:
pSip        = pProvData->pPDSip->pSip;
pSubjInfo   = pProvData->pPDSip->psSipSubjectInfo;
break;

        default:
pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = TRUST_E_NOSIGNATURE;
return(FALSE);
}

    cbEncodedMsg = 0;

    pSip->pfGet(pSubjInfo, &dwMsgEncoding, 0, &cbEncodedMsg, NULL);

    if (cbEncodedMsg == 0)
{
pProvData->padwTrustStepErrors[TRUSTERROR_STEP_SIP] = GetLastError();
pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = TRUST_E_NOSIGNATURE;
return(FALSE);
}

    if (!(pbEncodedMsg = (BYTE *)pProvData->psPfns->pfnAlloc(cbEncodedMsg)))
{
pProvData->dwError = GetLastError();
pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = TRUST_E_SYSTEM_ERROR;
return(FALSE);
}

    if (!(pSip->pfGet(pSubjInfo, &dwMsgEncoding, 0, &cbEncodedMsg, pbEncodedMsg)))
{
pProvData->padwTrustStepErrors[TRUSTERROR_STEP_SIP] = GetLastError();
pProvData->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = TRUST_E_NOSIGNATURE;

        pProvData->psPfns->pfnFree(pbEncodedMsg);

        return(FALSE);
}

倒数第三个参数是0

第二部分:


0: kd> p
WINTRUST!_GetMessage+0x90:
001b:76804d15 751d            jne     WINTRUST!_GetMessage+0xaf (76804d34)
0: kd> p
WINTRUST!_GetMessage+0xaf:
001b:76804d34 50              push    eax
0: kd> dv
pProvData = 0x00096934
dwMsgType = 0
pbEncodedMsg = 0x01e00020 ""
dwMsgEncoding = 0x10001
cbEncodedMsg = 0x96934
1: kd> bc 33
1: kd> ?0x96934
Evaluate expression: 616756 = 00096934
0: kd> db 0x01e00020
01e00020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................

01e00030  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01e00040  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01e00050  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01e00060  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01e00070  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01e00080  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01e00090  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
0: kd> p
WINTRUST!_GetMessage+0xb0:
001b:76804d35 8d4508          lea     eax,[ebp+8]
0: kd> p
WINTRUST!_GetMessage+0xb3:
001b:76804d38 50              push    eax
0: kd> p
WINTRUST!_GetMessage+0xb4:
001b:76804d39 6a00            push    0            倒数第三个参数是0
0: kd> p
WINTRUST!_GetMessage+0xb6:
001b:76804d3b 8d45fc          lea     eax,[ebp-4]
0: kd> p
WINTRUST!_GetMessage+0xb9:
001b:76804d3e 50              push    eax
0: kd> p
WINTRUST!_GetMessage+0xba:
001b:76804d3f 53              push    ebx
0: kd> p
WINTRUST!_GetMessage+0xbb:
001b:76804d40 ff5708          call    dword ptr [edi+8]
0: kd> r
eax=007ce990 ebx=01c527f0 ecx=00096934 edx=00290c14 esi=007cea00 edi=01c51a78
eip=76804d40 esp=007ce968 ebp=007ce994 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
WINTRUST!_GetMessage+0xbb:
001b:76804d40 ff5708          call    dword ptr [edi+8] ds:0023:01c51a80={CRYPT32!CryptSIPGetSignedDataMsg (75c82759)}
0: kd> p
WINTRUST!_GetMessage+0xbe:
001b:76804d43 85c0            test    eax,eax

第三部分:


0: kd> dv
pProvData = 0x00096934
dwMsgType = 0
pbEncodedMsg = 0x01e00020 "0???"
dwMsgEncoding = 0x10001
cbEncodedMsg = 0x96934
0: kd> db 0x01e00020
01e00020  30 83 09 69 2f 06 09 2a-86 48 86 f7 0d 01 07 02  0..i/..*.H......
01e00030  a0 83 09 69 1f 30 83 09-69 1a 02 01 01 31 0b 30  ...i.0..i....1.0

01e00040  09 06 05 2b 0e 03 02 1a-05 00 30 83 09 57 31 06  ...+......0..W1.
01e00050  09 2b 06 01 04 01 82 37-0a 01 a0 83 09 57 21 30  .+.....7.....W!0
01e00060  83 09 57 1c 30 0c 06 0a-2b 06 01 04 01 82 37 0c  ..W.0...+.....7.
01e00070  01 01 04 10 bb fd 30 fb-6f a3 d9 40 82 26 85 87  ......0.o..@.&..
01e00080  87 cd 89 4b 17 0d 32 34-30 39 31 35 30 33 34 35  ...K..2409150345
01e00090  30 36 5a 30 0e 06 0a 2b-06 01 04 01 82 37 0c 01  06Z0...+.....7..
0: kd> dv
pProvData = 0x00096934
dwMsgType = 0
pbEncodedMsg = 0x01e00020 "0???"
dwMsgEncoding = 0x10001
cbEncodedMsg = 0x96934


第四部分:参考信息

0: kd> kc
#
00 WINTRUST!CryptSIPGetSignedDataMsg
01 CRYPT32!CryptSIPGetSignedDataMsg
02 WINTRUST!_GetMessage
03 WINTRUST!SoftpubLoadMessage
04 WINTRUST!_VerifyTrust
05 WINTRUST!WinVerifyTrust
06 sfc_os!SfcValidateFileSignature
07 sfc_os!SfcGetValidationData
08 sfc_os!SfcValidateDLL
09 sfc_os!SfcQueueValidationThread
0a kernel32!BaseThreadStart

http://www.xdnf.cn/news/1395901.html

相关文章:

  • AI的“科学革命”:Karpathy吹响号角,从“经院哲学”走向“实验科学”
  • 基于STM32单片机的智能温室控制声光报警系统设计
  • Geocodify 的 API
  • CD71.【C++ Dev】二叉树的三种非递归遍历方式
  • 网络编程 反射【详解】 | Java 学习日志 | 第 15 天
  • 2025牛客暑期多校训练营4 G Ghost in the Parentheses 题解记录
  • Day17 Docker学习
  • uac播放与录制
  • 论文阅读:arixv 2025 WideSearch: Benchmarking Agentic Broad Info-Seeking
  • React Three Fiber
  • LBM——大型行为模型助力波士顿人形Atlas完成多任务灵巧操作:CLIP编码图像与语义,之后DiT去噪扩散生成动作
  • 编程速递:RAD Studio 13 即将到来的功能
  • Linux 线程调度核心要点
  • Shell 脚本基础教程
  • java序列化
  • Android系统框架知识系列(十九):Android安全架构深度剖析 - 从内核到应用的全栈防护
  • python学习打卡day48
  • “白月光”焦点何晟铭现身宁夏中宁,助力非遗与三农发展
  • 拎包入住搭建 Browser Use Agent:基于PPIO Model API +Agent 沙箱的一体化构建
  • 变量声明方式
  • linux学习-数据库
  • 中科米堆CASAIM五金配件三维扫描测量尺寸形位公差
  • 嵌入式Linux驱动开发:i.MX6ULL平台设备驱动
  • 使用 Docker 部署 Squid 为 Kubernetes 中的 Nexus3 提供公网代理访问
  • linux 条件变量与生产消费者模型
  • 玳瑁的嵌入式日记D29-0829(进程间通信)
  • Python OpenCV图像处理与深度学习:Python OpenCV开发环境搭建与入门
  • 基于能量方法的纳维-斯托克斯方程高阶范数有界性理论推导-陈墨仙
  • STM32CubeMX + HAL 库:基于 I²C 通信的 AHT20 高精度温湿度测量实验
  • 【系列03】端侧AI:构建与部署高效的本地化AI模型 第2章:端侧AI硬件入门