首页
社区
课程
招聘
[求助]为什么我就添冲了ansi结构就不对了呢?
发表于: 2008-9-13 09:56 3842

[求助]为什么我就添冲了ansi结构就不对了呢?

2008-9-13 09:56
3842
ANSI_STRING STRUCT
_Length     dd        ?
MaximumLength        dd        ?
Buffer                dd        ?        
ANSI_STRING ENDS

UNICODE_STRING STRUCT
_Length     dd        ?
MaximumLength        dd        ?
Buffer                dd        ?        
UNICODE_STRING ENDS

        LOCAL        @lsls[15]:byte
        LOCAL        @lpRtlInitAnsiString,@lpRtlAnsiStringToUnicodeString:dword
        LOCAL        @unstr:UNICODE_STRING
        LOCAL        @anstr:ANSI_STRING
                invoke RtlZeroMemory,addr @anstr,sizeof ANSI_STRING
                invoke RtlZeroMemory,addr @lsls,15
                invoke LoadLibrary,CTEXT("ntdll.dll")
                invoke GetProcAddress,eax,CTEXT("RtlInitAnsiString")
                mov @lpRtlInitAnsiString,eax
                invoke LoadLibrary,CTEXT("ntdll.dll")
                invoke GetProcAddress,eax,CTEXT("RtlAnsiStringToUnicodeString")
                mov @lpRtlAnsiStringToUnicodeString,eax
                invoke RtlMoveMemory,addr @lsls,CTEXT("c:\spoolsv.exe"),15
                lea eax,@lsls
                push eax
                lea eax,@anstr
                push eax
                call @lpRtlInitAnsiString
                invoke MessageBox,0,addr @anstr.Buffer,addr @anstr.Buffer,MB_OK       ;为什么我就添冲了ansi结构就不对了呢,晕.

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 293
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
invoke MessageBox,0,addr @anstr.Buffer,addr @anstr.Buffer,MB_OK

去掉 addr 试一下,@ansistr.Buffer 本身就是指向字符串的指针了,不要用 addr 了。

RtlInitAnsiString
The RtlInitAnsiString routine initializes a counted ANSI string.

VOID RtlInitAnsiString(
         IN OUT PANSI_STRING  DestinationString,
         IN PCSZ  SourceString
         );

Parameters

DestinationString
Pointer to the ANSI_STRING structure to be initialized.

SourceString
Pointer to a null-terminated string with which to initialize the counted string.

Return Value
None

Comments
The Buffer member of DestinationString is initialized to point to the SourceString. The length and maximum length for the DestinationString are initialized to the length of the SourceString. If SourceString is NULL, the lengths are zero.
2008-9-13 11:41
0
雪    币: 221
活跃值: (10)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
直接用自带的的ansi_string吧
2008-9-13 23:50
0
游客
登录 | 注册 方可回帖
返回
//