吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 946|回复: 1
收起左侧

[求助] 咋没强行删除文件呢?

[复制链接]
冥界3大法王 发表于 2021-5-10 21:31
本帖最后由 冥界3大法王 于 2021-5-10 22:43 编辑

[Delphi] 纯文本查看 复制代码
[size=14px]unit Unit1;[/size]
[size=14px]
[/size]
[size=14px]interface[/size]
[size=14px]
[/size]
[size=14px]uses[/size]
[size=14px]  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,[/size]
[size=14px]  System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,[/size]
[size=14px]  Vcl.StdCtrls;[/size]
[size=14px]
[/size]
[size=14px]const[/size]
[size=14px]  OBJ_CASE_INSENSITIVE = $00000040;[/size]
[size=14px]  STATUS_SUCCESS = $00000000;[/size]
[size=14px]
[/size]
[size=14px]type[/size]
[size=14px]  NTSTATUS = DWORD;[/size]
[size=14px]
[/size]
[size=14px]  PVOID = Pointer;[/size]
[size=14px]
[/size]
[size=14px]  PUnicodeString = ^TUnicodeString;[/size]
[size=14px]
[/size]
[size=14px]  TUnicodeString = packed record[/size]
[size=14px]    Length: Word;[/size]
[size=14px]    MaximumLength: Word;[/size]
[size=14px]    Buffer: PWideChar;[/size]
[size=14px]  end;[/size]
[size=14px]
[/size]
[size=14px]  UNICODE_STRING = TUnicodeString;[/size]
[size=14px]
[/size]
[size=14px]  PUNICODE_STRING = ^UNICODE_STRING;[/size]
[size=14px]
[/size]
[size=14px]  POBJECT_ATTRIBUTES = ^TOBJECT_ATTRIBUTES;[/size]
[size=14px]
[/size]
[size=14px]  TOBJECT_ATTRIBUTES = record[/size]
[size=14px]    Length: Cardinal;[/size]
[size=14px]    RootDirectory: THANDLE;[/size]
[size=14px]    ObjectName: PUNICODE_STRING;[/size]
[size=14px]    Attributes: Dword;[/size]
[size=14px]    SecurityDescriptor: pointer; // Points to type SECURITY_DESCRIPTOR[/size]
[size=14px]    SecurityQualityOfService: pointer; // Points to type SECURITY_QUALITY_OF_SERVICE[/size]
[size=14px]  end;[/size]
[size=14px]
[/size]
[size=14px]type[/size]
[size=14px]  TForm1 = class(TForm)[/size]
[size=14px]    Button1: TButton;[/size]
[size=14px]    procedure Button1Click(Sender: TObject);[/size]
[size=14px]  private[/size]
[size=14px]    { Private declarations }[/size]
[size=14px]  public[/size]
[size=14px]    { Public declarations }[/size]
[size=14px]  end;[/size]
[size=14px]
[/size]
[size=14px]var[/size]
[size=14px]  Form1: TForm1;[/size]
[size=14px]
[/size]
[size=14px]implementation[/size]
[size=14px]
[/size]
[size=14px]{$R *.dfm}[/size]
[size=14px]
[/size]
[size=14px]procedure RtlInitUnicodeString(var Buffer: TUnicodeString; Source: PWideChar); stdcall; external 'ntdll.dll';[/size]
[size=14px]
[/size]
[size=14px]function ZwDeleteFile(ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; external 'ntdll.dll';[/size]
[size=14px]
[/size]
[size=14px]procedure InitializeObjectAttributes(pAttributes: POBJECT_ATTRIBUTES; n: PUNICODE_STRING; a: Cardinal; r: THANDLE; s: pointer);[/size]
[size=14px]begin[/size]
[size=14px]  pAttributes^.Length := SizeOf(TOBJECT_ATTRIBUTES);[/size]
[size=14px]  pAttributes^.RootDirectory := r;[/size]
[size=14px]  pAttributes^.Attributes := a;[/size]
[size=14px]  pAttributes^.ObjectName := n;[/size]
[size=14px]  pAttributes^.SecurityDescriptor := s;[/size]
[size=14px]  pAttributes^.SecurityQualityOfService := nil;[/size]
[size=14px]end;[/size]
[size=14px]
[/size]
[size=14px]procedure TForm1.Button1Click(Sender: TObject);[/size]
[size=14px]var[/size]
[size=14px]  at: UNICODE_STRING;[/size]
[size=14px]  oa: TOBJECT_ATTRIBUTES;[/size]
[size=14px]begin[/size]
[size=14px]  RtlInitUnicodeString(at, '\??\C:\0.txt');[/size]
[size=14px]  InitializeObjectAttributes(@oa, @at, OBJ_CASE_INSENSITIVE, 0, 0);[/size]
[size=14px]  ZwDeleteFile(@oa);[/size]
[size=14px]end;[/size]
[size=14px]
[/size]
[size=14px]end.[/size]


发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

夏蓝 发表于 2021-5-11 00:29
不懂 但是第一次坐在法王的沙发
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 02:33

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表