解读 RtlTrimNtPathSegment

解读 RtlTrimNtPathSegment

 

 

返回字符串前后的 \

 

typedefHRESULT(__fastcall *PRTL_TRIM_NTPATH_SEGMENT)(

    PLUNICODE_STRING,

    UINT_PTR *,

    UINT_PTR *

    );

staticPRTL_TRIM_NTPATH_SEGMENTRtlTrimNtPathSegment;

RtlTrimNtPathSegment = (PRTL_TRIM_NTPATH_SEGMENT)CalcFunctionAddress(phWCP, pfb_RtlTrimNtPathSegment);

 

LUNICODE_STRINGa1;

UINT_PTRa2, a3;

RtlInitLUnicodeString(&a1, L"c:\\windows\\system32\\abcd\\\\");

RtlTrimNtPathSegment(&a1, &a2, &a3);

结果:

a2 = 0

a3 = 4

 

 

//----- (10131387) --------------------------------------------------------
int __fastcall RtlTrimNtPathSegment(inta1, _DWORD *a2, _DWORD *a3)
{

  v17 =0xC00000E5;
  v3 =a1;
  v4 =0;
  v12 =a2;
  *a2= 0;
  *a3= 0;
  if (RtlIsLUnicodeStringValid(a1) )
  {
    v6 =*(__int16**)(v3+ 8);
    v7 =v6;
    v8 =(__int16 *)((char *)v6 + *(_DWORD *)v3);
    v17 =0;
    v9 =0;
    if (v6 < v8 )
    {
      do
      {

        v10 =*v7;
        ++v7;
        if ( v10 != 92 )
          break;
        v4 +=2;
      }
      while
( v7 <v8 );
      v17 <

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值