User Tools

Site Tools


wlasne_moduly

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dodatkowe_funkcje [2018/06/17 12:11] adminwlasne_moduly [2018/07/16 19:04] – [Funkcje] admin
Line 11: Line 11:
   uPSC_std   uPSC_std
   uPSC_classes   uPSC_classes
-  uPSR_controls +  uPSC_controls 
-  uPSR_forms+  uPSC_forms
   uPSC_dateutils   uPSC_dateutils
   uPSC_dll   uPSC_dll
Line 19: Line 19:
  
  
-==== Typy ====+==== Typy modułów ====
  
-<code delphi>type TModuleType = mtFile, mtRegistry</code> +<code delphi>type TModuleType = mtFile, mtRegistry, mtOther</code>
-<code delphi>type TCipherMode = cmCTSxcmCBCx, cmCFB8, cmCFBx, cmOFB8, cmOFBx, cmCFS8, cmCFSx, cmECBx, cmCMOD;</code>+
  
-==== Stałe ====+ 
 +==== Klasy ====
  
 <code delphi> <code delphi>
-dla TRegistryEx+const
   HKEY_CLASSES_ROOT   HKEY_CLASSES_ROOT
   HKEY_CURRENT_USER   HKEY_CURRENT_USER
Line 35: Line 35:
   HKEY_CURRENT_CONFIG   HKEY_CURRENT_CONFIG
   HKEY_DYN_DATA   HKEY_DYN_DATA
-</code> 
-==== Klasy ==== 
  
-<code delphi> 
 TRegistryEx = class TRegistryEx = class
   function KeyExists(const Key: string): Boolean;   function KeyExists(const Key: string): Boolean;
Line 66: Line 63:
  
 <code delphi> <code delphi>
 +function CreateIniFile(const AFileName: string): TIniFile;
 +
 TIniFile = class TIniFile = class
   function SectionExists(const Section: string): Boolean;   function SectionExists(const Section: string): Boolean;
Line 79: Line 78:
  
 ==== Funkcje ==== ==== Funkcje ====
- 
-<code delphi>procedure ShowMessage(aMsg: string);</code> 
-<code delphi>procedure RegistryScan(RootType: DWord; RootKey: string);</code> 
-<code delphi>function CreateIniFile(const AFileName: string): TIniFile;</code> 
  
 <code delphi>function CryptoHash(const AStr, AHash: string): string; <code delphi>function CryptoHash(const AStr, AHash: string): string;
Line 116: Line 111:
 </code> </code>
  
-<code delphi>function CryptoDecrypt(const data, key, iv: string; mode: TCipherMode; ACipher: string): string;+<code delphi>type TCipherMode = cmCTSx, cmCBCx, cmCFB8, cmCFBx, cmOFB8, cmOFBx, cmCFS8, cmCFSx, cmECBx; 
 + 
 +function CryptoDecrypt(const data, key, iv: string; mode: TCipherMode; ACipher: string): string;
 function CryptoEncrypt(const data, key, iv: string; mode: TCipherMode; ACipher: string): string; function CryptoEncrypt(const data, key, iv: string; mode: TCipherMode; ACipher: string): string;
 ACipher= ACipher=
Line 138: Line 135:
 function IsValidNum(const s: string): boolean;</code> function IsValidNum(const s: string): boolean;</code>
  
-<code delphi>procedure AddItem(App, Item, User, Pass, FileName: string);</code>+<code delphi>procedure RegistryScan(RootType: DWord; RootKey: string); 
 +procedure AddItem(App, Item, User, Pass, FileName: string);</code> 
 + 
 +<code delphi>procedure ShowMessage(aMsg: string); 
 + 
 +function ExtractFilePath(const FileName: string): string; 
 +function ExtractFileDrive(const FileName: string): string; 
 +function ExtractFileName(const FileName: string): string; 
 +function ExtractFileExt(const FileName: string): string; 
 +function ExtractFileDir(Const FileName: string): string; 
 + 
 +function FileExists(const FileName: string): Boolean; 
 +function DirectoryExists(const DirName: string): Boolean; 
 + 
 +function ParamStr(l: LongInt):string; 
 +function ParamCount: LongInt; 
 +</code>
  
 ==== Parametry przekazywane z aplikacji ==== ==== Parametry przekazywane z aplikacji ====
  
-<code delphi>Registry = TRegistryEx</code> +<code delphi>var 
-<code delphi>FileRecord = TFileRecordObj</code>+  Registry = TRegistryEx 
 +  FileRecord = TFileRecordObj</code>
  
 ===== Przykład ===== ===== Przykład =====
Line 173: Line 187:
   ini := CreateIniFile(FileRecord.Full);   ini := CreateIniFile(FileRecord.Full);
   try   try
-    str := ini.ReadString('ultravnc', 'passwd', 'x');+    str := ini.ReadString('ultravnc', 'passwd', '');
     if IsValidHex(str) and (Length(str) > 0) then     if IsValidHex(str) and (Length(str) > 0) then
     begin     begin
Line 192: Line 206:
 ==== Obsługa rejestru ==== ==== Obsługa rejestru ====
  
-<code delphi> +<code delphi>function ModuleType: TModuleType;
-function ModuleType: TModuleType;+
 begin begin
   Result := mtRegistry;   Result := mtRegistry;
Line 206: Line 219:
 begin begin
   RegistryScan(ROOT_KEY, '\SOFTWARE\TigerVNC\WinVNC4');   RegistryScan(ROOT_KEY, '\SOFTWARE\TigerVNC\WinVNC4');
-  // execute OnCheck on each nodes 
   RegistryScan(ROOT_KEY, '\SOFTWARE\RealVNC\WinVNC4');   RegistryScan(ROOT_KEY, '\SOFTWARE\RealVNC\WinVNC4');
   RegistryScan(ROOT_KEY, '\SOFTWARE\ORL\WinVNC3');   RegistryScan(ROOT_KEY, '\SOFTWARE\ORL\WinVNC3');
Line 232: Line 244:
     else     else
       s := ModuleName;       s := ModuleName;
-    AddItem(s, +    AddItem(s, 'Custom Module', '', 
-            'Custom Module',  // protocol +       Trim(CryptoDecrypt(Registry.ReadString(Value), 
-            '',               // username +         #23#82#107#6#35#78#88#7, '', cmECBx, '1DESVNC')),'');
-            Trim(CryptoDecrypt(Registry.ReadString(Value),  // encrypted +
-                        #23#82#107#6#35#78#88#7,     // key +
-                        '',                          // iv +
-                        cmECBx,                      // mode +
-                        '1DESVNC')),                 // algorithm look@selftest +
-            '');               // filename+
   end;   end;
 end; end;
wlasne_moduly.txt · Last modified: 2019/03/26 02:22 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki