标题:怎样转换出 UNICODE_STRING 中的字符串
取消只看楼主
月下鸢尾
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2015-12-27
结帖率:0
已结贴  问题点数:20 回复次数:0 
怎样转换出 UNICODE_STRING 中的字符串
我HOOK了NtCreateMutant想判断互斥体名称,但是不知道怎么转换UNICODE_STRING的字符串,假如我要判断的互斥体名称为ABCD,,我该怎么判断呢?
程序代码:
Private Function MyNtCreateMutant(ByVal MutantHandle As Long, ByVal DesiredAccess As Long, ObjectAttributes As POBJECT_ATTRIBUTES, ByVal InitialOwner As Long) As Long
    Dim Ret As Long

    Dim strObjectName As String
    Dim strUnicode As UNICODE_STRING
    'MsgBox ObjectAttributes.ObjectName.Buffer
    'RtlInitUnicodeString strUnicode, StrPtr(strObjectName) '初始化Unicode字符串
    'MsgBox GetStr(ObjectAttributes.ObjectName)

    RtlInitUnicodeString VarPtr(strUnicode), StrPtr(strObjectName)
    ObjectAttributes.ObjectName = VarPtr(strUnicode)
    
    'MsgBox strObjectName
    ‘这里怎么转换出ObjectAttributes 中的UNICODE_STRING字符串呢?头要炸了
    
    UnHookNtCreateMutant
    MyNtCreateMutant = NtCreateMutant(MutantHandle, DesiredAccess, ObjectAttributes, InitialOwner)
    MsgBox strObjectName
    HookNtCreateMutant
End Function


[此贴子已经被作者于2015-12-27 12:53编辑过]

搜索更多相关主题的帖子: 字符串 
2015-12-27 12:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-460584-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.061365 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved