Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DELPHI¼ÓÃÜ×Ö´®£¨Òì»òÔËËã¼ÓÃÜ£©

Õâ¸ö±¾À´ÎÒÎÒÔÚDELPHIºÐ×Ó¿´µ½µÄ£¬ºóÀ´ÎÒ¶ÔÆä×÷ÁËÒ»µãÐ޸ģ¬ÕâÀïÉÏÈ«²¿´úÂ룬¿ÉÒÔÖ±½ÓÓÃ
Ê×ÏÈÓÐÁ½¸ö×Ô¶¨µÄת»»º¯Êý£º
function myStrToHex(s:string):string; //×Ö´®×ª16½øÖÆ
var
TmpStr:string;
i:integer;
begin
TmpStr:='';
for i:=1 to Length(s)do
TmpStr:=TmpStr+IntToHex(ord(s[i]),2);
Result:=TmpStr;
end;
function myHexToStr(S:string):string; //16½øÖÆת×Ö´®
var
HexS,TmpStr:string;
i:Integer;
a:Byte;
begin
HexS:=s;
if Length(HexS) mod 2=1 then
HexS:=HexS+'0';
TmpStr:='';
for i:=1 to(Length(HexS)div 2)do
begin
a:=StrToInt('$'+HexS[2*i-1]+HexS[2*i]);
TmpStr:=TmpStr+Chr(a);
end;
Result:=TmpStr;
end;
È»ºó¾ÍÊǼÓÃÜ¡¢½âÃܺ¯ÊýÁË£º
{Á½¸öº¯ÊýµÄ²ÎÊýÏàͬ£¬sΪҪ¼ÓÃÜ¡¢½âÃܵÄ×Ö´®£»sKeyΪÃܳ×}
function EncryptStr(const s:string;sKey:string):string; //¼ÓÃÜ
var
i,j:Integer;
HexS,HexsKey,MidS,TmpStr:string;
a,b,c:byte;
begin
HexS:=myStrToHex(s);
HexsKey:=myStrToHex(sKey);
MidS:=HexS;
for i:=1 to(Length(HexsKey)div 2)do
begin
if i<>1 then MidS:=TmpStr;
TmpStr:=''; //ÏÂÃæÒªÓõ½TmpStr£¬ËùÒÔÒªÇå¿Õ
for j:=1 to (Length(MidS)div 2)do
begin
a:=StrToInt('$'+midS[2*j-1]+midS[2*j]);
b:=StrToInt('$'+HexsKey[2*i-1]+HexsKey[2*i]);
c:=a xor b;
tmpstr:=TmpStr+myStrToHex(Chr(c));
end;
end;
Result:=TmpStr;
end;
function DecryptStr(const s:string;sKey:string):string; //½âÃÜ
var
i,j:Integer;
HexS,HexsKey,MidS,TmpStr:string;
a,b,c:Byte;
begin
HexS:=s;
if Length(HexS)mod 2=1 then //¼ì²éÊÇ·ñΪ×Ö·û´®
begin
ShowMessage('ÃÜÎÄ´íÎó£¡');
Exit;
end;
HexsKey:=myStrToHex(sKey);
TmpStr:=HexS;
MidS:=HexS;
for i:=(length(HexsKey) div 2) downto 1 do
begin
if i<>(length(HexsKey) div 2)then
MidS:=TmpStr;
TmpStr:=''; //ÏÂÃæÒªÓõ½TmpStr£¬ËùÒÔÒªÇå¿Õ
for j:=1 to(length(MidS) div 2)do
begin
a:=StrToInt('$'+MidS[2*j-1]+MidS[2*j]);
b:=StrToInt('$'+HexsKey[2*i-1]+HexsKey[2*i]);


Ïà¹ØÎĵµ£º

delphiÖÐTreeViewʹÓÃ

TreeViewÓɽڵ㹹³É£¬½¨Ê÷ͨ¹ý¶ÔTreeView.itemsÊôÐÔ½øÐвÙ×÷¡£ItemsÊÇÒ»¸öTTreeNodes¶ÔÏó£¬ÕâÊÇÒ»¸öTTreeNode¼¯¡£
Ò»¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,ÓÐÕâЩÊôÐÔ£º
1¡¢count£¬½Úµã¸öÊý¡£
2¡¢item[index]  ,ͨ¹ýindexµÃµ½½Úµã¡£
¶þ¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,³£ÓõÄÌí¼Ó½ÚµãµÄ²Ù×÷ÓУº
Add ......

(ÕÐƸ£©Delphi³ÌÐòÔ±ËÄÃû

ÕÐƸÈËÊý£º 4ÈË
ѧÀúÒªÇó£º ²»ÏÞ
¹¤×÷ÄêÏÞ£º ²»ÏÞ
н×Ê·¶Î§£º ÃæÒé
¹¤×÷µØµã£º ±±¾©Í¨ÖݾſÃÊ÷
Delphi³ÌÐòÔ±ËÄÃûְλҪÇó
񻂗:
1. ÊìÁ·Ê¹ÓÃDELPHI(C,C++, C#µÈ)½øÐпª·¢£»
2. ¾ßÓÐÁ¼ºÃµÄ³ÌÐò±àдϰ¹ß£»
3. ÔúʵµÄ»ù±¾¹¦£¬½á¹¹ÇåÎú¡¢ºÏÀí£»
4. Á¼ºÃµÄÖ´ÐÐÄÜÁ¦£¬½ÏºÃµÄÍê³ÉÔ¤¶¨ÈÎÎñ£»
5. ÉϽøÐÄÇ¿£¬ÄܳԿ ......

Delphi Hook API ÒÑ·è¿ñ

×÷Õß: yangyxd   תÔØÇë×¢Ã÷³ö´¦ http://hi.baidu.com/yangyxd   2009-3-12
     ÂÛ̳ÀïÓйØÓÚHOOK APIµÄÌù×Ó£¬ µ«ÆäʵÏÖÔÚ·½Ê½ÏÔʾµÃÂé·³£¬ ÆäʵÏÖÔÚÀ¹½ØAPIÒ»°ã²»ÓÃÄÇÖÖ·½Ê½£¬ ´ó¶¼²ÉÓÃinline Hook API·½Ê½¡£ÆäʵҲ¾ÍÊÇÖ±½ÓÐÞ¸ÄÁËÒªÀ¹½ØµÄAPIÔ´ÂëµÄÍ·²¿£¬ÈÃËüÎÞÌõ¼þÌøתµ½ÎÒÃÇ× ......

delphiÖÐCreateMutex£¬OpenMutexʹÓÃÒ»Àý

VCÉùÃ÷
HANDLE CreateMutex(
¡¡¡¡LPSECURITY_ATTRIBUTES lpMutexAttributes, // SD
¡¡¡¡BOOL bInitialOwner, // initial owner
¡¡¡¡LPCTSTR lpName // object name
¡¡¡¡);
delphiÉùÃ÷£º
function CreateMutex(lpMutexAttributes: PSecurityAttributes; bInitialOwner: BOOL; lpName: PChar): THandle; stdcall;
´´½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ