Commit bca7e2016dc1e81acc293a4e79f5f9ee205d20eb

Authored by Adriano Vieira
1 parent 62f5aa61
Exists in master

- merge de branch (2.4) revisão [654:705]

- atualizada número de versão

git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/agente-windows@708 fecfc0c7-e812-0410-ae72-849f08638ee7
CACIC_Library.pas 0 → 100644
@@ -0,0 +1,460 @@ @@ -0,0 +1,460 @@
  1 +{*------------------------------------------------------------------------------
  2 + Package of both methods/properties to be used by CACIC Clients
  3 +
  4 + @version CACIC_Library 2009-01-07 23:00 harpiain
  5 + @package CACIC_Agente
  6 + @subpackage CACIC_Library
  7 + @author Adriano dos Santos Vieira <harpiain at gmail.com>
  8 + @copyright Copyright (C) Adriano dos Santos Vieira. All rights reserved.
  9 + @license GNU/GPL, see LICENSE.php
  10 + CACIC_Library is free software and parts of it may contain or be derived from
  11 + the GNU General Public License or other free or open source software license.
  12 + See COPYRIGHT.php for copyright notices and details.
  13 +
  14 + CACIC_Library - Coding style
  15 + for Constants
  16 + - characters always in uppercase
  17 + - use underscore for long name
  18 + e.g.
  19 + const CACIC_VERSION = '2.4.0';
  20 +
  21 + for Variables
  22 + - characters always in lowercase
  23 + - start with "g" character for global
  24 + - start with "v" character for local
  25 + - start with "p" character for methods parameters
  26 + - use underscore for better read
  27 + e.g.
  28 + var g_global : string;
  29 + var v_local : string;
  30 +
  31 + for Objects
  32 + - start with "o" character
  33 + e.g.
  34 + oCacicObject : TCACIC_Common;
  35 +
  36 + for Methods
  37 + - start with lowercase word
  38 + - next words start with capital letter
  39 + e.g.
  40 + function getCacicPath() : string;
  41 + procedure setCacicPath( pPath: string );
  42 +-------------------------------------------------------------------------------}
  43 +
  44 +unit CACIC_Library;
  45 +
  46 +interface
  47 +
  48 +uses
  49 + Windows, SysUtils, StrUtils;
  50 +
  51 +type
  52 +{*------------------------------------------------------------------------------
  53 + Classe para obter informações do sistema windows
  54 +-------------------------------------------------------------------------------}
  55 + TCACIC_Windows = class
  56 + private
  57 +
  58 + protected
  59 + /// Mantem a identificação do sistema operacional
  60 + g_osVerInfo: TOSVersionInfo;
  61 +
  62 + public
  63 + function isWindowsVista() : boolean;
  64 + function isWindowsGEVista() : boolean;
  65 + function isWindowsXP() : boolean;
  66 + function isWindowsGEXP() : boolean;
  67 + function isWindowsNTPlataform() : boolean;
  68 + function isWindows2000() : boolean;
  69 + function isWindowsNT() : boolean;
  70 + function isWindows9xME() : boolean;
  71 + function getWindowsStrId() : string;
  72 + function isWindowsAdmin(): Boolean;
  73 + function createSampleProcess(p_cmd: string; p_wait: boolean ): boolean;
  74 + procedure showTrayIcon(p_visible:boolean);
  75 + end;
  76 +
  77 +{*------------------------------------------------------------------------------
  78 + Classe para tratamento de debug
  79 +-------------------------------------------------------------------------------}
  80 + TCACIC_Debug = class
  81 + private
  82 +
  83 + protected
  84 + /// TRUE se em mode de debug, FALSE caso contrário
  85 + g_debug: boolean;
  86 +
  87 + public
  88 + procedure debugOn();
  89 + procedure debugOff();
  90 + function inDebugMode() : boolean;
  91 + end;
  92 +{*------------------------------------------------------------------------------
  93 + Classe geral da biblioteca
  94 +-------------------------------------------------------------------------------}
  95 + TCACIC = class(TCACIC_Windows)
  96 + constructor Create();
  97 + private
  98 +
  99 + protected
  100 + /// Mantem o caminho físico de instalação do agente cacic
  101 + g_cacic_path: string;
  102 +
  103 + public
  104 + Windows : TCACIC_Windows; /// objeto de informacoes de windows
  105 + Debug : TCACIC_Debug; /// objeto de tratamento de debug
  106 + procedure setCacicPath(p_cacic_path: string);
  107 + function getCacicPath(): string;
  108 + function trimEspacosExcedentes(p_str: string): string;
  109 + function isAppRunning( p_app_name: PAnsiChar ): boolean;
  110 + end;
  111 +
  112 +// Declaração de constantes para a biblioteca
  113 +const CACIC_PROCESS_WAIT = true; // aguardar fim do processo
  114 +const CACIC_PROCESS_NOWAIT = false; // não aguardar o fim do processo
  115 +
  116 +implementation
  117 +
  118 +{*------------------------------------------------------------------------------
  119 + Construtor para a classe
  120 +
  121 + Objetiva inicializar valores a serem usados pelos objetos da
  122 + classe.
  123 +-------------------------------------------------------------------------------}
  124 +constructor TCACIC.Create();
  125 +begin
  126 + Self.g_osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
  127 + GetVersionEx(Self.g_osVerInfo);
  128 + Self.Windows := TCACIC_Windows.Create();
  129 + Self.Debug := TCACIC_Debug.Create();
  130 +end;
  131 +
  132 +{*------------------------------------------------------------------------------
  133 + Elimina espacos excedentes na string
  134 +
  135 + @param p_str String a excluir espacos
  136 +-------------------------------------------------------------------------------}
  137 +function TCACIC.trimEspacosExcedentes(p_str: String): String;
  138 +begin
  139 + if(ansipos(' ', p_str ) <> 0 ) then
  140 + repeat
  141 + p_str := StringReplace( p_str, ' ', ' ', [rfReplaceAll] );
  142 + until ( ansipos( ' ', p_str ) = 0 );
  143 +
  144 + Result := p_str;
  145 +end;
  146 +
  147 +{*------------------------------------------------------------------------------
  148 + Atribui o caminho físico de instalação do agente cacic
  149 +
  150 + @param p_cacic_path Caminho físico de instalação do agente cacic
  151 +-------------------------------------------------------------------------------}
  152 +procedure TCACIC.setCacicPath(p_cacic_path: string);
  153 +begin
  154 + Self.g_cacic_path := p_cacic_path;
  155 +end;
  156 +
  157 +{*------------------------------------------------------------------------------
  158 + Obter o caminho fisico de instalacao do agente cacic
  159 +
  160 + @return String contendo o caminho físico
  161 +-------------------------------------------------------------------------------}
  162 +function TCACIC.getCacicPath(): string;
  163 +begin
  164 + Result := Self.g_cacic_path;
  165 +end;
  166 +
  167 +{*------------------------------------------------------------------------------
  168 + Verifica se a aplicação está em execução
  169 +
  170 + @param p_app_name Nome da aplicação a ser verificada
  171 + @return TRUE se em execução, FALSE caso contrário
  172 +-------------------------------------------------------------------------------}
  173 +function TCACIC.isAppRunning( p_app_name: PAnsiChar ): boolean;
  174 +var
  175 + MutexHandle: THandle;
  176 +
  177 +begin
  178 + MutexHandle := CreateMutex(nil, TRUE, p_app_name);
  179 + if (MutexHandle = 0) OR (GetLastError = ERROR_ALREADY_EXISTS)
  180 + then Result := true
  181 + else Result := false;
  182 +end;
  183 +
  184 +{*------------------------------------------------------------------------------
  185 + Coloca o sistema em modo de debug
  186 +
  187 +-------------------------------------------------------------------------------}
  188 +procedure TCACIC_Debug.debugOn();
  189 +begin
  190 + Self.g_debug := true;
  191 +end;
  192 +
  193 +{*------------------------------------------------------------------------------
  194 + Desliga o modo de debug do sistema
  195 +
  196 +-------------------------------------------------------------------------------}
  197 +procedure TCACIC_Debug.debugOff();
  198 +begin
  199 + Self.g_debug := false;
  200 +end;
  201 +
  202 +{*------------------------------------------------------------------------------
  203 + Coloca o sistema em modo de debug
  204 +
  205 + @return String contendo o caminho físico
  206 +-------------------------------------------------------------------------------}
  207 +function TCACIC_Debug.inDebugMode() : boolean;
  208 +begin
  209 + Result := Self.g_debug;
  210 +end;
  211 +
  212 +{*------------------------------------------------------------------------------
  213 + Verifica se é Windows Vista ou superior
  214 +
  215 + @return TRUE se Windows Vista ou superior, FALSE caso contrário
  216 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  217 + @see isWindowsXP, isWindowsVista, isWindowsGEVista
  218 +-------------------------------------------------------------------------------}
  219 +function TCACIC_Windows.isWindowsGEVista() : boolean;
  220 +begin
  221 + Result := false;
  222 + if((g_osVerInfo.dwMajorVersion >= 6) and (g_osVerInfo.dwMinorVersion >= 0)) then
  223 + Result := true;
  224 +end;
  225 +
  226 +{*------------------------------------------------------------------------------
  227 + Verifica se é Windows Vista
  228 +
  229 + @return TRUE se Windows Vista, FALSE caso contrário
  230 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  231 + @see isWindowsXP, isWindowsVista
  232 +-------------------------------------------------------------------------------}
  233 +function TCACIC_Windows.isWindowsVista() : boolean;
  234 +begin
  235 + Result := false;
  236 + if((g_osVerInfo.dwMajorVersion = 6) and (g_osVerInfo.dwMinorVersion = 0)) then
  237 + Result := true;
  238 +end;
  239 +
  240 +{*------------------------------------------------------------------------------
  241 + Verifica se é Windows XP ou superior
  242 +
  243 + @return TRUE se Windows XP ou superior, FALSE caso contrário
  244 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  245 + @see isWindowsXP, isWindowsVista
  246 +-------------------------------------------------------------------------------}
  247 +function TCACIC_Windows.isWindowsGEXP() : boolean;
  248 +begin
  249 + Result := false;
  250 + if((g_osVerInfo.dwMajorVersion >= 5) and (g_osVerInfo.dwMinorVersion >= 1)) then
  251 + Result := true;
  252 +end;
  253 +
  254 +{*------------------------------------------------------------------------------
  255 + Verifica se é Windows XP
  256 +
  257 + @return TRUE se Windows XP, FALSE caso contrário
  258 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  259 + @see isWindowsXP, isWindowsVista
  260 +-------------------------------------------------------------------------------}
  261 +function TCACIC_Windows.isWindowsXP() : boolean;
  262 +begin
  263 + Result := false;
  264 + if((g_osVerInfo.dwMajorVersion = 5) and (g_osVerInfo.dwMinorVersion = 1)) then
  265 + Result := true;
  266 +end;
  267 +
  268 +{*------------------------------------------------------------------------------
  269 + Verifica se é Windows 2000
  270 +
  271 + @return TRUE se Windows 2000, FALSE caso contrário
  272 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  273 + @see isWindowsXP, isWindowsVista
  274 +-------------------------------------------------------------------------------}
  275 +function TCACIC_Windows.isWindows2000() : boolean;
  276 +begin
  277 + Result := false;
  278 + if((g_osVerInfo.dwMajorVersion = 5) and (g_osVerInfo.dwMinorVersion = 0)) then
  279 + Result := true;
  280 +end;
  281 +
  282 +{*------------------------------------------------------------------------------
  283 + Verifica se é Windows NT
  284 +
  285 + @return TRUE se Windows NT, FALSE caso contrário
  286 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  287 + @see isWindowsXP, isWindowsVista
  288 +-------------------------------------------------------------------------------}
  289 +function TCACIC_Windows.isWindowsNT() : boolean;
  290 +begin
  291 + Result := false;
  292 + if((g_osVerInfo.dwMajorVersion = 4) and (g_osVerInfo.dwMinorVersion = 0)) then
  293 + Result := true;
  294 +end;
  295 +
  296 +{*------------------------------------------------------------------------------
  297 + Verifica se a plataforma do sistema é de windows 9x ou ME
  298 +
  299 + @return TRUE se plataforma de Windows 9x/ME, FALSE caso contrário
  300 + @see isWindowsNTPlataform, isWindows9xME, isWindowsNT, isWindows2000
  301 + @see isWindowsXP, isWindowsVista
  302 +-------------------------------------------------------------------------------}
  303 +function TCACIC_Windows.isWindows9xME() : boolean;
  304 +begin
  305 + Result := (Self.g_osVerInfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS);
  306 +end;
  307 +
  308 +{*------------------------------------------------------------------------------
  309 + Obter identificação extensa do sistema operacional
  310 +
  311 + @return String de identificação do sistema operacional
  312 + @example 1.4.10.A
  313 +-------------------------------------------------------------------------------}
  314 +function TCACIC_Windows.getWindowsStrId() : string;
  315 +begin
  316 + Result := IntToStr(Self.g_osVerInfo.dwPlatformId) + '.' +
  317 + IntToStr(Self.g_osVerInfo.dwMajorVersion) + '.' +
  318 + IntToStr(Self.g_osVerInfo.dwMinorVersion) +
  319 + ifThen(trim(Self.g_osVerInfo.szCSDVersion)='',
  320 + '',
  321 + '.'+Self.g_osVerInfo.szCSDVersion);
  322 +
  323 +end;
  324 +
  325 +{*------------------------------------------------------------------------------
  326 + Verifica se a plataforma do sistema é de Windows NT
  327 +
  328 + @return TRUE se plataforma de Windows NT, FALSE caso contrário
  329 + @see isWindows9xME, isWindowsVista
  330 +-------------------------------------------------------------------------------}
  331 +function TCACIC_Windows.isWindowsNTPlataform() : boolean;
  332 +begin
  333 + Result := (Self.g_osVerInfo.dwPlatformId = VER_PLATFORM_WIN32_NT);
  334 +end;
  335 +
  336 +{*------------------------------------------------------------------------------
  337 + Verifica se é administrador do sistema operacional se em plataforma NT
  338 +
  339 + @return TRUE se administrador do sistema, FALSE caso contrário
  340 +-------------------------------------------------------------------------------}
  341 +function TCACIC_Windows.isWindowsAdmin(): Boolean;
  342 +
  343 +const
  344 + constSECURITY_NT_AUTHORITY: TSIDIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5));
  345 + constSECURITY_BUILTIN_DOMAIN_RID = $00000020;
  346 + constDOMAIN_ALIAS_RID_ADMINS = $00000220;
  347 +
  348 +var
  349 + hAccessToken: THandle;
  350 + ptgGroups: PTokenGroups;
  351 + dwInfoBufferSize: DWORD;
  352 + psidAdministrators: PSID;
  353 + x: Integer;
  354 + bSuccess: BOOL;
  355 +
  356 +begin
  357 + if (not Self.isWindowsNTPlataform()) then // Se nao NT (ex: Win95/98)
  358 + // Se nao eh NT nao tem ''admin''
  359 + Result := True
  360 + else begin
  361 + Result := False;
  362 + bSuccess := OpenThreadToken(GetCurrentThread, TOKEN_QUERY, True, hAccessToken);
  363 + if not bSuccess then begin
  364 + if GetLastError = ERROR_NO_TOKEN then
  365 + bSuccess := OpenProcessToken(GetCurrentProcess, TOKEN_QUERY, hAccessToken);
  366 + end;
  367 + if bSuccess then begin
  368 + GetMem(ptgGroups, 1024);
  369 + bSuccess := GetTokenInformation(hAccessToken, TokenGroups, ptgGroups, 1024, dwInfoBufferSize);
  370 + CloseHandle(hAccessToken);
  371 + if bSuccess then begin
  372 + AllocateAndInitializeSid(constSECURITY_NT_AUTHORITY, 2,
  373 + constSECURITY_BUILTIN_DOMAIN_RID,
  374 + constDOMAIN_ALIAS_RID_ADMINS,
  375 + 0, 0, 0, 0, 0, 0, psidAdministrators);
  376 + {$R-}
  377 + for x := 0 to ptgGroups.GroupCount - 1 do
  378 + if EqualSid(psidAdministrators, ptgGroups.Groups[x].Sid) then begin
  379 + Result := True;
  380 + Break;
  381 + end;
  382 + {$R+}
  383 + FreeSid(psidAdministrators);
  384 + end;
  385 + FreeMemory(ptgGroups);
  386 + end;
  387 + end;
  388 +end;
  389 +
  390 +{*------------------------------------------------------------------------------
  391 + Executa commandos, substitui o WinExec
  392 +
  393 + @autor: Marcos Dell Antonio
  394 + @param p_cmd Comando a ser executado
  395 + @param p_wait TRUE se deve aguardar término da excução, FALSE caso contrário
  396 +-------------------------------------------------------------------------------}
  397 +function TCACIC_Windows.createSampleProcess(p_cmd: string; p_wait: boolean ): boolean;
  398 +var
  399 + SUInfo: TStartupInfo;
  400 + ProcInfo: TProcessInformation;
  401 +begin
  402 + FillChar(SUInfo, SizeOf(SUInfo), #0);
  403 + SUInfo.cb := SizeOf(SUInfo);
  404 + SUInfo.dwFlags := STARTF_USESHOWWINDOW;
  405 + SUInfo.wShowWindow := SW_HIDE;
  406 +
  407 + Result := CreateProcess(nil,
  408 + PChar(p_cmd),
  409 + nil,
  410 + nil,
  411 + false,
  412 + CREATE_NEW_CONSOLE or
  413 + NORMAL_PRIORITY_CLASS,
  414 + nil,
  415 + nil,
  416 + SUInfo,
  417 + ProcInfo);
  418 +
  419 + if (Result) then
  420 + begin
  421 + if(p_wait) then begin
  422 + WaitForSingleObject(ProcInfo.hProcess, INFINITE);
  423 + CloseHandle(ProcInfo.hProcess);
  424 + CloseHandle(ProcInfo.hThread);
  425 + end;
  426 + end;
  427 +end;
  428 +
  429 +{*------------------------------------------------------------------------------
  430 + Mostra ou oculta o cacic na "systray" do windows
  431 +
  432 + @autor: Diversos - compilado de vários exemplos obtidos na internet
  433 + @param p_visible TRUE se deve mostrar na systray, FALSE caso contrário
  434 +-------------------------------------------------------------------------------}
  435 +procedure TCACIC_Windows.showTrayIcon(p_visible:boolean);
  436 + Var
  437 + v_tray, v_child : hWnd;
  438 + v_char : Array[0..127] of Char;
  439 + v_string : String;
  440 +
  441 + Begin
  442 + v_tray := FindWindow('Shell_TrayWnd', NIL);
  443 + v_child := GetWindow(v_tray, GW_CHILD);
  444 + While v_child <> 0
  445 + do Begin
  446 + If GetClassName(v_child, v_char, SizeOf(v_char)) > 0
  447 + Then Begin
  448 + v_string := StrPAS(v_char);
  449 + If UpperCase(v_string) = 'TRAYNOTIFYWND'
  450 + then begin
  451 + If p_visible
  452 + then ShowWindow(v_child, 1)
  453 + else ShowWindow(v_child, 0);
  454 + end;
  455 + End;
  456 + v_child := GetWindow(v_child, GW_HWNDNEXT);
  457 + End;
  458 + End;
  459 +
  460 +end.
cacic2.bpg 0 → 100644
@@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
  1 +#------------------------------------------------------------------------------
  2 +VERSION = BWS.01
  3 +#------------------------------------------------------------------------------
  4 +!ifndef ROOT
  5 +ROOT = $(MAKEDIR)\..
  6 +!endif
  7 +#------------------------------------------------------------------------------
  8 +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
  9 +DCC = $(ROOT)\bin\dcc32.exe $**
  10 +BRCC = $(ROOT)\bin\brcc32.exe $**
  11 +#------------------------------------------------------------------------------
  12 +PROJECTS = cacic2.exe chkcacic.exe chksis.exe col_anvi.exe col_comp.exe \
  13 + col_hard.exe col_moni.exe col_patr.exe col_soft.exe col_undi.exe ger_cols.exe \
  14 + ini_cols.exe mapacacic.exe vaca.exe vacon.exe
  15 +#------------------------------------------------------------------------------
  16 +default: $(PROJECTS)
  17 +#------------------------------------------------------------------------------
  18 +
  19 +cacic2.exe: cacic2.dpr
  20 + $(DCC)
  21 +
  22 +chkcacic.exe: chkcacic\chkcacic.dpr
  23 + $(DCC)
  24 +
  25 +chksis.exe: chksis\chksis.dpr
  26 + $(DCC)
  27 +
  28 +col_anvi.exe: col_anvi\col_anvi.dpr
  29 + $(DCC)
  30 +
  31 +col_comp.exe: col_comp\col_comp.dpr
  32 + $(DCC)
  33 +
  34 +col_hard.exe: col_hard\col_hard.dpr
  35 + $(DCC)
  36 +
  37 +col_moni.exe: col_moni\col_moni.dpr
  38 + $(DCC)
  39 +
  40 +col_patr.exe: col_patr\col_patr.dpr
  41 + $(DCC)
  42 +
  43 +col_soft.exe: col_soft\col_soft.dpr
  44 + $(DCC)
  45 +
  46 +col_undi.exe: col_undi\col_undi.dpr
  47 + $(DCC)
  48 +
  49 +ger_cols.exe: ger_cols\ger_cols.dpr
  50 + $(DCC)
  51 +
  52 +ini_cols.exe: ini_cols\ini_cols.dpr
  53 + $(DCC)
  54 +
  55 +mapacacic.exe: mapa\mapacacic.dpr
  56 + $(DCC)
  57 +
  58 +vaca.exe: vaca\vaca.dpr
  59 + $(DCC)
  60 +
  61 +vacon.exe: vacon\vacon.dpr
  62 + $(DCC)
  63 +
  64 +
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
@@ -94,7 +94,7 @@ OutputDir= @@ -94,7 +94,7 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k
99 Conditionals= 99 Conditionals=
100 DebugSourceDirs= 100 DebugSourceDirs=
@@ -113,11 +113,11 @@ RootDir=Y:\arariboia_mod\ @@ -113,11 +113,11 @@ RootDir=Y:\arariboia_mod\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 -PreRelease=0 120 +PreRelease=1
121 Special=0 121 Special=0
122 Private=0 122 Private=0
123 DLL=0 123 DLL=0
@@ -126,18 +126,34 @@ CodePage=1252 @@ -126,18 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev - Unidade Regional Espírito Santo 127 CompanyName=Dataprev - Unidade Regional Espírito Santo
128 FileDescription=Configurador Automático e Coletor de Informações Computacionais 128 FileDescription=Configurador Automático e Coletor de Informações Computacionais
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Cacic - Agente Principal 134 ProductName=Cacic - Agente Principal
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
  137 +[HistoryLists\hlDebugSourcePath]
  138 +Count=2
  139 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
137 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
138 Count=1 142 Count=1
139 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
140 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
  145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
141 Count=2 157 Count=2
142 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion  
143 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes 158 +Item0=..\Repositorio
  159 +Item1=Repositorio
@@ -25,42 +25,42 @@ uses @@ -25,42 +25,42 @@ uses
25 frmSenha in 'frmsenha.pas' {formSenha}, 25 frmSenha in 'frmsenha.pas' {formSenha},
26 frmConfiguracoes in 'frmConfiguracoes.pas' {FormConfiguracoes}, 26 frmConfiguracoes in 'frmConfiguracoes.pas' {FormConfiguracoes},
27 frmLog in 'frmLog.pas' {FormLog}, 27 frmLog in 'frmLog.pas' {FormLog},
28 - LibXmlParser in 'LibXmlParser.pas'; 28 + LibXmlParser,
  29 + CACIC_Library in 'CACIC_Library.pas';
29 30
30 {$R *.res} 31 {$R *.res}
31 32
32 -VAR // Add Vars  
33 - MutexHandle: THandle;  
34 - hwind:HWND; 33 +const
  34 + CACIC_APP_NAME = 'cacic2';
35 35
36 -begin 36 +var
  37 + hwind:HWND;
  38 + oCacic : TCACIC;
37 39
38 - // Esse código evita que mais de uma cópia do cacic seja instanciada.  
39 - MutexHandle := CreateMutex(nil, TRUE, 'cacic2'); // should be a unique string  
40 - IF MutexHandle <> 0 then  
41 - begin  
42 - IF GetLastError = ERROR_ALREADY_EXISTS then  
43 - begin  
44 - CloseHandle(MutexHandle); 40 +begin
  41 + oCacic := TCACIC.Create();
  42 +
  43 + if( oCacic.isAppRunning( CACIC_APP_NAME ) )
  44 + then begin
45 hwind := 0; 45 hwind := 0;
46 repeat // The string 'My app' must match your App Title (below) 46 repeat // The string 'My app' must match your App Title (below)
47 - hwind:=Windows.FindWindowEx(0,hwind,'TApplication','cacic2'); 47 + hwind:=Windows.FindWindowEx(0,hwind,'TApplication', CACIC_APP_NAME );
48 until (hwind<>Application.Handle); 48 until (hwind<>Application.Handle);
49 IF (hwind<>0) then 49 IF (hwind<>0) then
50 begin 50 begin
51 Windows.ShowWindow(hwind,SW_SHOWNORMAL); 51 Windows.ShowWindow(hwind,SW_SHOWNORMAL);
52 Windows.SetForegroundWindow(hwind); 52 Windows.SetForegroundWindow(hwind);
53 end; 53 end;
54 -  
55 FreeMemory(0); 54 FreeMemory(0);
56 Halt(0); 55 Halt(0);
57 - end  
58 - end; 56 + end;
  57 +
  58 + oCacic.Free();
59 59
60 // Preventing application button showing in the task bar 60 // Preventing application button showing in the task bar
61 SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW ); 61 SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW );
62 Application.Initialize; 62 Application.Initialize;
63 Application.Title := 'cacic2'; 63 Application.Title := 'cacic2';
64 Application.CreateForm(TFormularioGeral, FormularioGeral); 64 Application.CreateForm(TFormularioGeral, FormularioGeral);
65 - Application.Run; 65 + Application.Run;
66 end. 66 end.
cacic2.res
No preview for this file type
chkcacic/chkcacic.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
chkcacic/chkcacic.dof
@@ -94,7 +94,7 @@ OutputDir= @@ -94,7 +94,7 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k
99 Conditionals= 99 Conditionals=
100 DebugSourceDirs= 100 DebugSourceDirs=
@@ -113,9 +113,9 @@ RootDir=C:\ARQUIVOS DE PROGRAMAS\BORLAND\DELPHI7\BIN\ @@ -113,9 +113,9 @@ RootDir=C:\ARQUIVOS DE PROGRAMAS\BORLAND\DELPHI7\BIN\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev - Unidade Regional Espírito Santo (URES) 127 CompanyName=Dataprev - Unidade Regional Espírito Santo (URES)
128 FileDescription=Módulo Verificador/Instalador dos Agentes Principais para o Sistema CACIC 128 FileDescription=Módulo Verificador/Instalador dos Agentes Principais para o Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=ChkCACIC 134 ProductName=ChkCACIC
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
  137 +[HistoryLists\hlDebugSourcePath]
  138 +Count=2
  139 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
137 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
138 Count=1 142 Count=1
139 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
140 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
141 -Count=8  
142 -Item0=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion  
143 -Item1=C:\Arquivos de programas\Borland\Delphi7\D7;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers  
144 -Item2=C:\Arquivos de programas\Borland\Delphi7\D7;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
145 -Item3=C:\Arquivos de programas\Borland\Delphi7\D7;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP  
146 -Item4=C:\Arquivos de programas\Borland\Delphi7\D7;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common  
147 -Item5=C:\Arquivos de programas\Borland\Delphi7\D7;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item6=C:\Arquivos de programas\Borland\Delphi7\D7  
149 -Item7=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
chkcacic/chkcacic.dpr
@@ -16,14 +16,29 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -16,14 +16,29 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 *) 16 *)
17 program chkcacic; 17 program chkcacic;
18 uses 18 uses
19 - Forms, 19 + Forms, windows,
20 main in 'main.pas', 20 main in 'main.pas',
21 - FormConfig in 'FormConfig.pas' {Configs}; 21 + FormConfig in 'FormConfig.pas' {Configs},
  22 + CACIC_Library in '..\CACIC_Library.pas';
22 23
23 {$R *.res} 24 {$R *.res}
24 25
  26 +const
  27 + CACIC_APP_NAME = 'chkcacic';
  28 +
  29 +var
  30 + oCacic : TCACIC;
  31 +
25 begin 32 begin
26 - Application.Initialize;  
27 - Application.CreateForm(TForm1, Form1);  
28 - Application.Run; 33 + oCacic := TCACIC.Create();
  34 +
  35 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) )
  36 + then begin
  37 + Application.Initialize;
  38 + Application.CreateForm(TForm1, Form1);
  39 + Application.Run;
  40 + end;
  41 +
  42 + oCacic.Free();
  43 +
29 end. 44 end.
chkcacic/chkcacic.res
No preview for this file type
chkcacic/main.pas
@@ -82,7 +82,8 @@ uses Windows, @@ -82,7 +82,8 @@ uses Windows,
82 IdFTP, 82 IdFTP,
83 Tlhelp32, 83 Tlhelp32,
84 dialogs, 84 dialogs,
85 - ExtCtrls; 85 + ExtCtrls,
  86 + CACIC_Library;
86 87
87 var v_ip_serv_cacic, 88 var v_ip_serv_cacic,
88 v_cacic_dir, 89 v_cacic_dir,
@@ -109,6 +110,9 @@ var v_ip_serv_cacic, @@ -109,6 +110,9 @@ var v_ip_serv_cacic,
109 110
110 var v_tstrCipherOpened : TStrings; 111 var v_tstrCipherOpened : TStrings;
111 112
  113 +var
  114 + g_oCacic: TCACIC; /// Biblioteca CACIC_Library
  115 +
112 // Constantes a serem usadas pela função IsAdmin... 116 // Constantes a serem usadas pela função IsAdmin...
113 const constSECURITY_NT_AUTHORITY: TSIDIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5)); 117 const constSECURITY_NT_AUTHORITY: TSIDIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5));
114 constSECURITY_BUILTIN_DOMAIN_RID = $00000020; 118 constSECURITY_BUILTIN_DOMAIN_RID = $00000020;
@@ -309,12 +313,11 @@ var IdHTTP2: TIdHTTP; @@ -309,12 +313,11 @@ var IdHTTP2: TIdHTTP;
309 Request_Config : TStringList; 313 Request_Config : TStringList;
310 Response_Config : TStringStream; 314 Response_Config : TStringStream;
311 begin 315 begin
312 - GetWinVer(); // Para obtenção de "te_so"  
313 // Envio notificação de insucesso para o Módulo Gerente Centralizado 316 // Envio notificação de insucesso para o Módulo Gerente Centralizado
314 Request_Config := TStringList.Create; 317 Request_Config := TStringList.Create;
315 Request_Config.Values['cs_indicador'] := strIndicador; 318 Request_Config.Values['cs_indicador'] := strIndicador;
316 Request_Config.Values['id_usuario'] := GetNetworkUserName(); 319 Request_Config.Values['id_usuario'] := GetNetworkUserName();
317 - Request_Config.Values['te_so'] := v_te_so; 320 + Request_Config.Values['te_so'] := g_oCacic.getWindowsStrId();
318 Response_Config := TStringStream.Create(''); 321 Response_Config := TStringStream.Create('');
319 Try 322 Try
320 Try 323 Try
@@ -595,7 +598,8 @@ var RegEditSet: TRegistry; @@ -595,7 +598,8 @@ var RegEditSet: TRegistry;
595 begin 598 begin
596 ListaAuxSet := Explode(Chave, '\'); 599 ListaAuxSet := Explode(Chave, '\');
597 strRootKey := ListaAuxSet[0]; 600 strRootKey := ListaAuxSet[0];
598 - For I := 1 To ListaAuxSet.Count - 2 Do strKey := strKey + ListaAuxSet[I] + '\'; 601 + For I := 1 To ListaAuxSet.Count - 2 do
  602 + strKey := strKey + ListaAuxSet[I] + '\';
599 strValue := ListaAuxSet[ListaAuxSet.Count - 1]; 603 strValue := ListaAuxSet[ListaAuxSet.Count - 1];
600 604
601 RegEditSet := TRegistry.Create; 605 RegEditSet := TRegistry.Create;
@@ -1016,7 +1020,7 @@ procedure LiberaFireWall(p_objeto:string); @@ -1016,7 +1020,7 @@ procedure LiberaFireWall(p_objeto:string);
1016 begin 1020 begin
1017 LogDebug('Rotina para Liberação de FireWall...'); 1021 LogDebug('Rotina para Liberação de FireWall...');
1018 Try 1022 Try
1019 - if (abstraiCSD(v_te_so) >= 260) then // Se VISTA... 1023 + if (g_oCacic.isWindowsGEVista()) then // Se >= WinVISTA...
1020 Begin 1024 Begin
1021 if (trim(GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll])))='') then 1025 if (trim(GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\'+StringReplace(p_objeto+'.exe','\','?\',[rfReplaceAll])))='') then
1022 Begin 1026 Begin
@@ -1121,8 +1125,7 @@ begin @@ -1121,8 +1125,7 @@ begin
1121 Begin 1125 Begin
1122 LogDebug('Exclusão não efetuada! Provavelmente já esteja sendo executado...'); 1126 LogDebug('Exclusão não efetuada! Provavelmente já esteja sendo executado...');
1123 LogDebug('Tentarei finalizar Tarefa/Processo...'); 1127 LogDebug('Tentarei finalizar Tarefa/Processo...');
1124 - if ((intWinVer <> 0) and (intWinVer <= 5)) or  
1125 - (abstraiCSD(v_te_so) < 250) then // Menor que NT Like 1128 + if (not g_oCacic.isWindowsNTPlataform()) then // Menor que NT Like
1126 KillTask(SearchRec.Name) 1129 KillTask(SearchRec.Name)
1127 else 1130 else
1128 KillProcess(FindWindow(PChar(SearchRec.Name),nil)); 1131 KillProcess(FindWindow(PChar(SearchRec.Name),nil));
@@ -1137,10 +1140,8 @@ end; @@ -1137,10 +1140,8 @@ end;
1137 1140
1138 function Posso_Rodar_CACIC : boolean; 1141 function Posso_Rodar_CACIC : boolean;
1139 Begin 1142 Begin
1140 - result := false;  
1141 -  
1142 // Se o aguarde_CACIC.txt existir é porque refere-se a uma versão mais atual: 2.2.0.20 ou maior 1143 // Se o aguarde_CACIC.txt existir é porque refere-se a uma versão mais atual: 2.2.0.20 ou maior
1143 - if (FileExists(v_cacic_dir + 'aguarde_CACIC.txt')) then 1144 + if (FileExists(g_oCacic.getCacicPath() + '\aguarde_CACIC.txt')) then
1144 Begin 1145 Begin
1145 // Se eu conseguir matar o arquivo abaixo é porque não há outra sessão deste agente aberta... (POG? Nããão! :) ) 1146 // Se eu conseguir matar o arquivo abaixo é porque não há outra sessão deste agente aberta... (POG? Nããão! :) )
1146 Matar(v_cacic_dir,'aguarde_CACIC.txt'); 1147 Matar(v_cacic_dir,'aguarde_CACIC.txt');
@@ -1312,8 +1313,6 @@ begin @@ -1312,8 +1313,6 @@ begin
1312 //v_cacic_dir := 'Cacic'; 1313 //v_cacic_dir := 'Cacic';
1313 //v_exibe_informacoes := 'N'; // Manter o "N", pois, esse mesmo ChkCacic será colocado em NetLogons! 1314 //v_exibe_informacoes := 'N'; // Manter o "N", pois, esse mesmo ChkCacic será colocado em NetLogons!
1314 1315
1315 -  
1316 -  
1317 if not bool_CommandLine then 1316 if not bool_CommandLine then
1318 Begin 1317 Begin
1319 If not (FileExists(ExtractFilePath(Application.Exename) + '\chkcacic.ini')) then 1318 If not (FileExists(ExtractFilePath(Application.Exename) + '\chkcacic.ini')) then
@@ -1328,6 +1327,9 @@ begin @@ -1328,6 +1327,9 @@ begin
1328 v_te_instala_informacoes_extras := StringReplace(GetValorChaveRegIni('Cacic2', 'te_instala_informacoes_extras', ExtractFilePath(Application.Exename) + '\chkcacic.ini'),'*13*10',#13#10,[rfReplaceAll]); 1327 v_te_instala_informacoes_extras := StringReplace(GetValorChaveRegIni('Cacic2', 'te_instala_informacoes_extras', ExtractFilePath(Application.Exename) + '\chkcacic.ini'),'*13*10',#13#10,[rfReplaceAll]);
1329 End; 1328 End;
1330 1329
  1330 + g_oCacic := TCACIC.Create();
  1331 + g_oCacic.setCacicPath(v_home_drive + v_cacic_dir);
  1332 +
1331 Dir := v_home_drive + v_cacic_dir; // Ex.: c:\cacic\ 1333 Dir := v_home_drive + v_cacic_dir; // Ex.: c:\cacic\
1332 1334
1333 if DirectoryExists(Dir + '\Temp\Debugs') then 1335 if DirectoryExists(Dir + '\Temp\Debugs') then
@@ -1341,17 +1343,13 @@ begin @@ -1341,17 +1343,13 @@ begin
1341 1343
1342 intWinVer := GetWinVer; 1344 intWinVer := GetWinVer;
1343 1345
1344 - // Verifico se o S.O. é NT Like e se o Usuário está com privilégio administrativo...  
1345 - if (((intWinVer <> 0) and (intWinVer >= 6)) or  
1346 - (abstraiCSD(v_te_so) >= 250)) and  
1347 - not IsAdmin then // Se NT/2000/XP/...  
1348 - Begin 1346 + // Verifica se o S.O. é NT Like e se o Usuário está com privilégio administrativo...
  1347 + if (g_oCacic.isWindowsNTPlataform()) and (not g_oCacic.isWindowsAdmin()) then begin // Se NT/2000/XP/...
1349 if (v_exibe_informacoes = 'S') then 1348 if (v_exibe_informacoes = 'S') then
1350 MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0); 1349 MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0);
1351 ComunicaInsucesso('0'); // O indicador "0" (zero) sinalizará falta de privilégio na estação 1350 ComunicaInsucesso('0'); // O indicador "0" (zero) sinalizará falta de privilégio na estação
1352 - End  
1353 - else  
1354 - Begin 1351 + end
  1352 + else begin
1355 LogDebug(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'); 1353 LogDebug(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::');
1356 LogDebug(':::::::::::::: OBTENDO VALORES DO "chkcacic.ini" ::::::::::::::'); 1354 LogDebug(':::::::::::::: OBTENDO VALORES DO "chkcacic.ini" ::::::::::::::');
1357 LogDebug(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'); 1355 LogDebug(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::');
@@ -1368,12 +1366,11 @@ begin @@ -1368,12 +1366,11 @@ begin
1368 v_DatFileName := Dir + '\cacic2.dat'; 1366 v_DatFileName := Dir + '\cacic2.dat';
1369 v_tstrCipherOpened := CipherOpen(v_DatFileName); 1367 v_tstrCipherOpened := CipherOpen(v_DatFileName);
1370 1368
1371 - if ((intWinVer <> 0) and (intWinVer >= 8)) or  
1372 - (abstraiCSD(v_te_so) >= 250) then // Se >= Maior ou Igual ao WinXP... 1369 + if (g_oCacic.isWindowsGEXP()) then // Se >= Maior ou Igual ao WinXP...
1373 Begin 1370 Begin
1374 Try 1371 Try
1375 // Libero as policies do FireWall Interno 1372 // Libero as policies do FireWall Interno
1376 - if (abstraiCSD(v_te_so) >= 260) then // Maior ou Igual ao VISTA... 1373 + if (g_oCacic.isWindowsGEVista()) then // Maior ou Igual ao VISTA...
1377 Begin 1374 Begin
1378 Try 1375 Try
1379 Begin 1376 Begin
@@ -1426,7 +1423,13 @@ begin @@ -1426,7 +1423,13 @@ begin
1426 MostraFormConfigura; 1423 MostraFormConfigura;
1427 End; 1424 End;
1428 1425
1429 - if (ParamCount > 0) and (LowerCase(Copy(ParamStr(1),1,7)) = '/config') then application.Terminate; 1426 + if (ParamCount > 0) and (LowerCase(Copy(ParamStr(1),1,7)) = '/config') then begin
  1427 + try
  1428 + g_oCacic.Free();
  1429 + except
  1430 + end;
  1431 + Application.Terminate;
  1432 + end;
1430 1433
1431 // Verifico a existência do diretório configurado para o Cacic, normalmente CACIC 1434 // Verifico a existência do diretório configurado para o Cacic, normalmente CACIC
1432 if not DirectoryExists(Dir) then 1435 if not DirectoryExists(Dir) then
@@ -1519,8 +1522,7 @@ begin @@ -1519,8 +1522,7 @@ begin
1519 1522
1520 // Se NTFS em NT/2K/XP... 1523 // Se NTFS em NT/2K/XP...
1521 // If NTFS on NT Like... 1524 // If NTFS on NT Like...
1522 - if ((intWinVer <> 0) and (intWinVer > 5)) or  
1523 - (abstraiCSD(v_te_so) >= 250) then 1525 + if (g_oCacic.isWindowsNTPlataform()) then
1524 Begin 1526 Begin
1525 LogDebug(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'); 1527 LogDebug(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::');
1526 LogDebug('::::::: VERIFICANDO FILE SYSTEM E ATRIBUINDO PERMISSÕES :::::::'); 1528 LogDebug('::::::: VERIFICANDO FILE SYSTEM E ATRIBUINDO PERMISSÕES :::::::');
@@ -1716,8 +1718,7 @@ begin @@ -1716,8 +1718,7 @@ begin
1716 v_te_path_serv_updates, 1718 v_te_path_serv_updates,
1717 v_exibe_informacoes); 1719 v_exibe_informacoes);
1718 1720
1719 - if ((intWinVer <> 0) and (intWinVer >= 8)) or  
1720 - (abstraiCSD(v_te_so) >= 250) then // Se >= WinXP... 1721 + if (g_oCacic.isWindowsGEXP()) then // Se >= WinXP...
1721 Begin 1722 Begin
1722 Try 1723 Try
1723 // Acrescento o ChkSis e o Ger_Cols às exceções do FireWall nativo... 1724 // Acrescento o ChkSis e o Ger_Cols às exceções do FireWall nativo...
@@ -1806,6 +1807,10 @@ begin @@ -1806,6 +1807,10 @@ begin
1806 Except 1807 Except
1807 LogDiario('Falha na Instalação/Atualização'); 1808 LogDiario('Falha na Instalação/Atualização');
1808 End; 1809 End;
  1810 + try
  1811 + g_oCacic.Free();
  1812 + except
  1813 + end;
1809 Application.Terminate; 1814 Application.Terminate;
1810 end; 1815 end;
1811 1816
@@ -1900,10 +1905,7 @@ begin @@ -1900,10 +1905,7 @@ begin
1900 Application.ShowMainForm:=false; 1905 Application.ShowMainForm:=false;
1901 v_Debugs := false; 1906 v_Debugs := false;
1902 1907
1903 -// if (FindWindowByTitle('chksis') = 0) then  
1904 - chkcacic;  
1905 -// else  
1906 -// LogDiario('Não executei devido execução em paralelo de "chksis"'); 1908 + chkcacic;
1907 1909
1908 Application.Terminate; 1910 Application.Terminate;
1909 end; 1911 end;
chksis/chksis.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
chksis/chksis.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev - Unidade Regional Espírito Santo (URES) 127 CompanyName=Dataprev - Unidade Regional Espírito Santo (URES)
128 FileDescription=Módulo Verificador de Integridade do Sistema CACIC 128 FileDescription=Módulo Verificador de Integridade do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=ChkSIS 134 ProductName=ChkSIS
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=5  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\D7;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\D7 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
chksis/chksis.dpr
@@ -18,28 +18,30 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -18,28 +18,30 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 program chksis; 18 program chksis;
19 {$R *.res} 19 {$R *.res}
20 20
21 -uses Windows,  
22 - forms,  
23 - SysUtils,  
24 - Classes,  
25 - Registry,  
26 - Inifiles,  
27 - XML,  
28 - LibXmlParser,  
29 - strUtils,  
30 - IdHTTP,  
31 - IdFTP,  
32 - idFTPCommon,  
33 - IdBaseComponent,  
34 - IdComponent,  
35 - IdTCPConnection,  
36 - IdTCPClient,  
37 - PJVersionInfo,  
38 - Winsock,  
39 - DCPcrypt2,  
40 - DCPrijndael,  
41 - DCPbase64,  
42 - Tlhelp32; 21 +uses
  22 + Windows,
  23 + forms,
  24 + SysUtils,
  25 + Classes,
  26 + Registry,
  27 + Inifiles,
  28 + XML,
  29 + LibXmlParser,
  30 + strUtils,
  31 + IdHTTP,
  32 + IdFTP,
  33 + idFTPCommon,
  34 + IdBaseComponent,
  35 + IdComponent,
  36 + IdTCPConnection,
  37 + IdTCPClient,
  38 + PJVersionInfo,
  39 + Winsock,
  40 + DCPcrypt2,
  41 + DCPrijndael,
  42 + DCPbase64,
  43 + Tlhelp32,
  44 + CACIC_Library in '..\CACIC_Library.pas';
43 45
44 var PJVersionInfo1: TPJVersionInfo; 46 var PJVersionInfo1: TPJVersionInfo;
45 Dir, 47 Dir,
@@ -1102,14 +1104,25 @@ begin @@ -1102,14 +1104,25 @@ begin
1102 Application.Terminate; 1104 Application.Terminate;
1103 end; 1105 end;
1104 1106
1105 -begin  
1106 -// Application.ShowMainForm:=false;  
1107 - if (FindWindowByTitle('chkcacic') = 0) and (FindWindowByTitle('cacic2') = 0) then  
1108 - if (FileExists(ExtractFilePath(ParamStr(0)) + 'chksis.ini')) then executa_chksis  
1109 - else log_diario('Não executei devido execução em paralelo de "chkcacic" ou "cacic2"!'); 1107 +const
  1108 + CACIC_APP_NAME = 'chksis';
1110 1109
1111 - Halt;  
1112 - //Application.Terminate; 1110 +var
  1111 + oCacic : TCACIC;
  1112 +
  1113 +begin
  1114 + oCacic := TCACIC.Create();
  1115 +
  1116 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) )
  1117 + then begin
  1118 + if (FindWindowByTitle('chkcacic') = 0) and (FindWindowByTitle('cacic2') = 0)
  1119 + then
  1120 + if (FileExists(ExtractFilePath(ParamStr(0)) + 'chksis.ini'))
  1121 + then executa_chksis
  1122 + else log_diario('Não executei devido execução em paralelo de "chkcacic" ou "cacic2"!');
  1123 + end;
  1124 +
  1125 + oCacic.Free();
1113 1126
1114 end. 1127 end.
1115 1128
chksis/chksis.res
No preview for this file type
col_anvi/col_anvi.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
col_anvi/col_anvi.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Coletor de Informações de AntiVírus do Sistema CACIC 128 FileDescription=Coletor de Informações de AntiVírus do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_ANVI 134 ProductName=Col_ANVI
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=5  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\mitec 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_anvi/col_anvi.dpr
@@ -18,16 +18,18 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -18,16 +18,18 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 program col_anvi; 18 program col_anvi;
19 {$R *.res} 19 {$R *.res}
20 20
21 -uses Windows,  
22 - classes,  
23 - sysutils,  
24 - Registry,  
25 - TLHELP32,  
26 - ShellAPI,  
27 - PJVersionInfo,  
28 - DCPcrypt2,  
29 - DCPrijndael,  
30 - DCPbase64; 21 +uses
  22 + Windows,
  23 + classes,
  24 + sysutils,
  25 + Registry,
  26 + TLHELP32,
  27 + ShellAPI,
  28 + PJVersionInfo,
  29 + DCPcrypt2,
  30 + DCPrijndael,
  31 + DCPbase64,
  32 + CACIC_Library in '..\CACIC_Library.pas';
31 33
32 var p_path_cacic, 34 var p_path_cacic,
33 v_CipherKey, 35 v_CipherKey,
@@ -588,8 +590,17 @@ end; @@ -588,8 +590,17 @@ end;
588 590
589 var tstrTripa1 : TStrings; 591 var tstrTripa1 : TStrings;
590 intAux : integer; 592 intAux : integer;
  593 +const
  594 + CACIC_APP_NAME = 'col_anvi';
  595 +
  596 +var
  597 + oCacic : TCACIC;
  598 +
591 begin 599 begin
592 - if (ParamCount>0) then 600 + oCacic := TCACIC.Create();
  601 +
  602 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  603 + if (ParamCount>0) then
593 Begin 604 Begin
594 For intAux := 1 to ParamCount do 605 For intAux := 1 to ParamCount do
595 Begin 606 Begin
@@ -637,4 +648,5 @@ begin @@ -637,4 +648,5 @@ begin
637 Halt(0); 648 Halt(0);
638 End; 649 End;
639 End; 650 End;
  651 + oCacic.Free();
640 end. 652 end.
col_anvi/col_anvi.res
No preview for this file type
col_comp/col_comp.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
col_comp/col_comp.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Coletor de Informações de Compartilhamento do Sistema CACIC 128 FileDescription=Coletor de Informações de Compartilhamento do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_COMP 134 ProductName=Col_COMP
135 -ProductVersion=2.2.0.2 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=5 145 +Count=10
145 Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 146 Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\mitec 147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_comp/col_comp.dpr
@@ -18,13 +18,15 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -18,13 +18,15 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 program col_comp; 18 program col_comp;
19 {$R *.res} 19 {$R *.res}
20 20
21 -uses Windows,  
22 - SysUtils,  
23 - Classes,  
24 - Registry,  
25 - DCPcrypt2,  
26 - DCPrijndael,  
27 - DCPbase64; 21 +uses
  22 + Windows,
  23 + SysUtils,
  24 + Classes,
  25 + Registry,
  26 + DCPcrypt2,
  27 + DCPrijndael,
  28 + DCPbase64,
  29 + CACIC_Library in '..\CACIC_Library.pas';
28 30
29 var p_path_cacic : string; 31 var p_path_cacic : string;
30 v_CipherKey, 32 v_CipherKey,
@@ -566,8 +568,17 @@ end; @@ -566,8 +568,17 @@ end;
566 568
567 var tstrTripa1 : TStrings; 569 var tstrTripa1 : TStrings;
568 intAux : integer; 570 intAux : integer;
  571 +const
  572 + CACIC_APP_NAME = 'col_comp';
  573 +
  574 +var
  575 + hwind:HWND;
  576 + oCacic : TCACIC;
  577 +
569 begin 578 begin
570 - if (ParamCount>0) then 579 + oCacic := TCACIC.Create();
  580 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  581 + if (ParamCount>0) then
571 Begin 582 Begin
572 For intAux := 1 to ParamCount do 583 For intAux := 1 to ParamCount do
573 Begin 584 Begin
@@ -586,7 +597,7 @@ begin @@ -586,7 +597,7 @@ begin
586 end; 597 end;
587 598
588 // A chave AES foi obtida no parâmetro p_CipherKey. Recomenda-se que cada empresa altere a sua chave. 599 // A chave AES foi obtida no parâmetro p_CipherKey. Recomenda-se que cada empresa altere a sua chave.
589 - v_IV := 'abcdefghijklmnop'; 600 + v_IV := 'abcdefghijklmnop';
590 v_DatFileName := p_path_cacic + 'cacic2.dat'; 601 v_DatFileName := p_path_cacic + 'cacic2.dat';
591 v_tstrCipherOpened := TStrings.Create; 602 v_tstrCipherOpened := TStrings.Create;
592 v_tstrCipherOpened := CipherOpen(v_DatFileName); 603 v_tstrCipherOpened := CipherOpen(v_DatFileName);
@@ -603,4 +614,5 @@ begin @@ -603,4 +614,5 @@ begin
603 Halt(0); 614 Halt(0);
604 End; 615 End;
605 End; 616 End;
  617 + oCacic.Free();
606 end. 618 end.
col_comp/col_comp.res
No preview for this file type
col_hard/col_hard.dof
@@ -113,9 +113,9 @@ RootDir= @@ -113,9 +113,9 @@ RootDir=
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,11 +126,34 @@ CodePage=1252 @@ -126,11 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Coletor de Informações de Hardware do Sistema CACIC 128 FileDescription=Coletor de Informações de Hardware do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_Hard 134 ProductName=Col_Hard
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
  137 +[HistoryLists\hlDebugSourcePath]
  138 +Count=2
  139 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  141 +[HistoryLists\hlUnitAliases]
  142 +Count=1
  143 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
  144 +[HistoryLists\hlSearchPath]
  145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_hard/col_hard.dpr
@@ -24,6 +24,7 @@ program col_hard; @@ -24,6 +24,7 @@ program col_hard;
24 24
25 uses 25 uses
26 Windows, 26 Windows,
  27 + Registry,
27 SysUtils, 28 SysUtils,
28 Classes, 29 Classes,
29 IniFiles, 30 IniFiles,
@@ -37,7 +38,8 @@ uses @@ -37,7 +38,8 @@ uses
37 DCPcrypt2, 38 DCPcrypt2,
38 DCPrijndael, 39 DCPrijndael,
39 DCPbase64, 40 DCPbase64,
40 - PJVersionInfo; 41 + PJVersionInfo,
  42 + CACIC_Library in '..\CACIC_Library.pas';
41 43
42 var p_path_cacic, v_mensagem : string; 44 var p_path_cacic, v_mensagem : string;
43 v_debugs : boolean; 45 v_debugs : boolean;
@@ -720,7 +722,7 @@ var v_te_cpu_fabricante, @@ -720,7 +722,7 @@ var v_te_cpu_fabricante,
720 v_DHCP_IPAddress, 722 v_DHCP_IPAddress,
721 v_PrimaryWINS_IPAddress, 723 v_PrimaryWINS_IPAddress,
722 v_SecondaryWINS_IPAddress : String; 724 v_SecondaryWINS_IPAddress : String;
723 - i : Integer; 725 + i, j, count : Integer;
724 v_qt_mem_ram : WORD; 726 v_qt_mem_ram : WORD;
725 v_CPU : TMiTeC_CPU; 727 v_CPU : TMiTeC_CPU;
726 v_DISPLAY : TMiTeC_Display; 728 v_DISPLAY : TMiTeC_Display;
@@ -733,43 +735,71 @@ var v_te_cpu_fabricante, @@ -733,43 +735,71 @@ var v_te_cpu_fabricante,
733 v_tstrCPU, 735 v_tstrCPU,
734 v_tstrCDROM, 736 v_tstrCDROM,
735 v_tstrTCPIP : TStringList; 737 v_tstrTCPIP : TStringList;
  738 +
  739 + v_cpu_freq : TStrings;
  740 + v_registry : TRegistry;
  741 +
  742 + oCacic : TCACIC;
  743 +
736 begin 744 begin
  745 + oCacic := TCACIC.Create();
737 Try 746 Try
738 SetValorDatMemoria('Col_Hard.Inicio', FormatDateTime('hh:nn:ss', Now), v_tstrCipherOpened1); 747 SetValorDatMemoria('Col_Hard.Inicio', FormatDateTime('hh:nn:ss', Now), v_tstrCipherOpened1);
739 v_Report := TStringList.Create; 748 v_Report := TStringList.Create;
740 log_diario('Coletando informações de Hardware.'); 749 log_diario('Coletando informações de Hardware.');
741 750
  751 + v_cpu_freq := TStringList.Create;
742 v_tstrCPU := TStringList.Create; 752 v_tstrCPU := TStringList.Create;
743 v_tstrCDROM := TStringList.Create; 753 v_tstrCDROM := TStringList.Create;
744 v_tstrTCPIP := TStringList.Create; 754 v_tstrTCPIP := TStringList.Create;
745 755
746 Try 756 Try
747 Begin 757 Begin
  758 + Log_Debug('Instanciando SMBIOS para obter frequencia de CPU...');
  759 + v_SMBIOS := TMiTeC_SMBIOS.Create(nil);
  760 + v_SMBIOS.RefreshData;
  761 + v_te_cpu_frequencia := 'ND';
  762 + if(v_SMBIOS.Processor[0].Frequency > 0) then
  763 + v_te_cpu_frequencia := inttostr(v_SMBIOS.Processor[0].Frequency) + 'Mhz' // Frequancia de CPU via BIOS
  764 + else begin
  765 + v_registry := TRegistry.Create;
  766 + try
  767 + v_registry.RootKey := HKEY_LOCAL_MACHINE;
  768 + try
  769 + if(v_registry.Openkey('HARDWARE\DESCRIPTION\System\CentralProcessor\0\', False)) then begin
  770 + v_te_cpu_frequencia := inttostr(v_registry.ReadInteger('~MHz'))+'Mhz'; // Frequencia de CPU via Regitry
  771 + v_registry.CloseKey;
  772 + end;
  773 + except
  774 + log_diario('CPU - informação de frequência ['+v_te_cpu_frequencia+'] não disponível (by SMBIOS/Registry): ');
  775 + end;
  776 + finally
  777 + v_registry.Free;
  778 + end;
  779 + end;
  780 + v_SMBIOS.Free;
  781 +
  782 + Log_Debug('CPU - frequência estática (by SMBIOS/Registry): '+v_te_cpu_frequencia);
  783 +
748 Log_Debug('Instanciando v_CPU...'); 784 Log_Debug('Instanciando v_CPU...');
749 v_CPU := TMiTeC_CPU.Create(nil); 785 v_CPU := TMiTeC_CPU.Create(nil);
750 - Log_Debug('RefreshingData...'); 786 + Log_Debug('Atualização de dados de CPU...');
751 v_CPU.RefreshData; 787 v_CPU.RefreshData;
752 - Log_Debug('Gerando MSI_XML_Reports...');  
753 - MSI_XML_Reports.CPU_XML_Report(v_CPU,TRUE,v_Report);  
754 - Log_Debug('Liberando v_CPU...');  
755 - //v_CPU.Report(v_Report);  
756 - v_CPU.Free; 788 + Log_Debug('Dados de CPU atualizados - OK!');
757 789
758 - Log_Debug('CPU Informations - OK!');  
759 - // CPU Informations 790 + // Obtem dados de CPU
760 Try 791 Try
761 - i := 1;  
762 - while (i <= 128) DO// Vamos procurar até 128 processadores! Eu já ouví dizer de máquinas neste porte!! (AP - 15FEV2008)  
763 - Begin  
764 - strAux := 'Processor #' + trim(intToStr(i));  
765 - v_te_cpu_serial := parse('TCPU',strAux,'Serial Number',v_Report);  
766 - v_te_cpu_desc := AnsiToAscii(parse('TCPU',strAux,'CPUName',v_Report));  
767 - IF (v_te_cpu_desc = '') then  
768 - v_te_cpu_desc := AnsiToAscii(parse('TCPU',strAux,'MarketingName',v_Report));  
769 - v_te_cpu_frequencia := AnsiToAscii(parse('TCPU',strAux,'Frequency',v_Report));  
770 - v_te_cpu_fabricante := AnsiToAscii(parse('TCPU',strAux,'Vendor',v_Report));  
771 -  
772 - // Se pegou ao menos a descrição, adiciono à tripa... 792 + for i:=0 to v_CPU.CPUCount-1 do begin
  793 + v_te_cpu_serial := v_CPU.SerialNumber;
  794 + v_te_cpu_desc := v_CPU.CPUName;
  795 + if(v_te_cpu_desc = '') then
  796 + v_te_cpu_desc := v_CPU.MarketingName;
  797 +
  798 + v_te_cpu_fabricante := cVendorNames[v_CPU.Vendor].Prefix;
  799 +
  800 + Log_Debug('CPU - frequência dinâmica (by CPU): '+inttostr(v_CPU.Frequency) + 'Mhz');
  801 +
  802 + // Se pegou ao menos a descrição, adiciona-se à tripa...
773 if (v_te_cpu_desc <> '') then 803 if (v_te_cpu_desc <> '') then
774 Begin 804 Begin
775 v_tstrCPU.Add('te_cpu_desc###' + v_te_cpu_desc + '#FIELD#' + 805 v_tstrCPU.Add('te_cpu_desc###' + v_te_cpu_desc + '#FIELD#' +
@@ -777,34 +807,27 @@ begin @@ -777,34 +807,27 @@ begin
777 'te_cpu_serial###' + v_te_cpu_serial + '#FIELD#' + 807 'te_cpu_serial###' + v_te_cpu_serial + '#FIELD#' +
778 'te_cpu_frequencia###' + v_te_cpu_frequencia); 808 'te_cpu_frequencia###' + v_te_cpu_frequencia);
779 Log_Debug('Adicionando a tstrCPU: "'+v_tstrCPU[v_tstrCPU.count-1]); 809 Log_Debug('Adicionando a tstrCPU: "'+v_tstrCPU[v_tstrCPU.count-1]);
780 - Log_DEBUG('Tamanho de v_tstrCPU 0: '+intToStr(v_tstrCPU.Count)); 810 + Log_DEBUG('Tamanho de v_tstrCPU 0: '+intToStr(v_tstrCPU.Count));
781 End; 811 End;
782 - i := i+1;  
783 - End; 812 + end;
784 Except 813 Except
785 - log_diario('Problema em CPU Details!'); 814 + log_diario('Problemas ao coletar dados de CPU!');
786 end; 815 end;
  816 + v_CPU.Free;
  817 + Log_DEBUG('Tamanho de v_tstrCPU 1: '+intToStr(v_tstrCPU.Count));
787 818
788 - Log_DEBUG('Tamanho de v_tstrCPU 1: '+intToStr(v_tstrCPU.Count));  
789 // Media informations 819 // Media informations
790 Try 820 Try
791 v_MEDIA := TMiTeC_Media.Create(nil); 821 v_MEDIA := TMiTeC_Media.Create(nil);
792 v_MEDIA.RefreshData; 822 v_MEDIA.RefreshData;
793 - //v_MEDIA.Report(v_Report);  
794 - MSI_XML_Reports.Media_XML_Report(v_MEDIA,TRUE,v_Report);  
795 - v_MEDIA.Free;  
796 -  
797 - v_DataName := parse('TMedia','','SoundCardDeviceIndex',v_Report);  
798 - if (v_DataName <> '-1') then  
799 - Begin  
800 - if (v_DataName <>'0') then v_DataName := IntToStr(StrToInt(v_DataName)+1);  
801 - v_DataName := 'Device['+v_DataName+']';  
802 - v_te_placa_som_desc := trim(AnsiToAscii(parse('TMedia','Devices',v_DataName,v_Report)));  
803 - End;  
804 - except log_diario('Problema em MEDIA Details!'); 823 + if v_Media.SoundCardIndex>-1 then begin
  824 + //n:=Tree.Items.AddChild(r,Media.Devices[Media.SoundCardIndex]);
  825 + v_te_placa_som_desc := v_Media.Devices[v_Media.SoundCardIndex];
  826 + end;
  827 + except log_diario('Problemas ao coletar dados de Aúdio');
805 end; 828 end;
806 829
807 - Log_Debug('MEDIA Informations - OK!'); 830 + Log_Debug('Dados de aúdio coletados - OK!');
808 831
809 // Devices informations 832 // Devices informations
810 Try 833 Try
@@ -812,7 +835,6 @@ begin @@ -812,7 +835,6 @@ begin
812 v_DEVICES := TMiTeC_Devices.Create(nil); 835 v_DEVICES := TMiTeC_Devices.Create(nil);
813 Log_Debug('RefreshingData...'); 836 Log_Debug('RefreshingData...');
814 v_DEVICES.RefreshData; 837 v_DEVICES.RefreshData;
815 - //if v_Debugs then v_DEVICES.Report(v_Report);  
816 if v_Debugs then MSI_XML_Reports.Devices_XML_Report(v_DEVICES,TRUE,v_Report); 838 if v_Debugs then MSI_XML_Reports.Devices_XML_Report(v_DEVICES,TRUE,v_Report);
817 Log_Debug('v_DEVICES.DeviceCount = '+intToStr(v_DEVICES.DeviceCount)); 839 Log_Debug('v_DEVICES.DeviceCount = '+intToStr(v_DEVICES.DeviceCount));
818 i := 0; 840 i := 0;
@@ -901,59 +923,37 @@ begin @@ -901,59 +923,37 @@ begin
901 except log_diario('Problema em MEMORY Details!'); 923 except log_diario('Problema em MEMORY Details!');
902 end; 924 end;
903 925
904 -//  
905 Try 926 Try
906 Begin 927 Begin
907 v_SMBIOS := TMiTeC_SMBIOS.Create(nil); 928 v_SMBIOS := TMiTeC_SMBIOS.Create(nil);
908 v_SMBIOS.RefreshData; 929 v_SMBIOS.RefreshData;
909 - //v_SMBIOS.Report(v_Report);  
910 - MSI_XML_Reports.SMBIOS_XML_Report(v_SMBIOS,true,v_Report);  
911 -  
912 - v_SMBIOS.Free;  
913 -  
914 -  
915 - if Parse('TSMBIOS','MemoryModule', 'Count', v_Report) <> '0' then 930 + if v_SMBIOS.MemoryModuleCount > -1 then
916 Begin 931 Begin
917 - i :=0;  
918 - while i < StrToInt(Parse('TSMBIOS','MemoryModule', 'Count', v_Report)) do  
919 - Begin  
920 - v_SectionName := 'MemoryModule/Module_'+IntToStr(i);  
921 - v_te_mem_ram_tipo:=Parse('TSMBIOS',v_SectionName, 'Type', v_Report);  
922 - if Parse('TSMBIOS',v_SectionName, 'Size', v_Report)<>'0' then  
923 - begin  
924 - if (v_te_mem_ram_desc <> '') then v_te_mem_ram_desc := v_te_mem_ram_desc + ' - ';  
925 - v_te_mem_ram_desc := v_te_mem_ram_desc + 'Slot ' + IntToStr(i) + ': ' + Parse('TSMBIOS',v_SectionName, 'Size', v_Report) + '(' + v_te_mem_ram_tipo +')';  
926 - end;  
927 - i := i+1;  
928 - End;  
929 - end  
930 - else  
931 - Begin  
932 - i := 0;  
933 - while i < StrToInt(Parse('TSMBIOS','MemoryDevice', 'Count', v_Report)) do  
934 - Begin  
935 - v_SectionName := 'MemoryModule/Device_'+IntToStr(i);  
936 - v_te_mem_ram_tipo := Parse('TSMBIOS',v_SectionName, 'Type', v_Report);  
937 -  
938 - if Parse('TSMBIOS',v_SectionName, 'Size', v_Report)<>'0' then  
939 - begin  
940 - if (v_te_mem_ram_desc <> '') then v_te_mem_ram_desc := v_te_mem_ram_desc + ' - ';  
941 - v_te_mem_ram_desc := v_te_mem_ram_desc + 'Slot ' + IntToStr(i) + ': ' + Parse('TSMBIOS',v_SectionName, 'Size', v_Report) + '(' + v_te_mem_ram_tipo + ')';  
942 - end;  
943 - i := i+1; 932 + for i:=0 to v_SMBIOS.MemoryModuleCount-1 do begin
  933 + if (v_SMBIOS.MemoryModule[i].Size <> 0) then begin
  934 + v_te_mem_ram_tipo := v_SMBIOS.GetMemoryTypeStr(v_SMBIOS.MemoryModule[i].Types);
  935 + if (v_te_mem_ram_desc <> '') then
  936 + v_te_mem_ram_desc := v_te_mem_ram_desc + ' - ';
  937 + v_te_mem_ram_desc := v_te_mem_ram_desc + 'Slot '+ inttostr(i) + ': '
  938 + + v_SMBIOS.MemoryDevice[i].Manufacturer + ' '
  939 + //+ v_SMBIOS.MemoryDevice[i].Device + ' '
  940 + + inttostr(v_SMBIOS.MemoryModule[i].Size) + 'Mb '
  941 + + '(' + v_te_mem_ram_tipo +')';
944 end; 942 end;
945 - End; 943 + end;
  944 + end;
946 945
947 if (trim(v_te_placa_mae_fabricante)='') then 946 if (trim(v_te_placa_mae_fabricante)='') then
948 - v_te_placa_mae_fabricante := AnsiToAscii(Trim(Parse('TSMBIOS','Mainboard', 'Manufacturer', v_Report))); 947 + v_te_placa_mae_fabricante := v_SMBIOS.MainBoardManufacturer;
  948 +
949 if (trim(v_te_placa_mae_desc)='') then 949 if (trim(v_te_placa_mae_desc)='') then
950 - v_te_placa_mae_desc := AnsiToAscii(Trim(Parse('TSMBIOS','Mainboard', 'Model', v_Report)));  
951 - v_te_bios_data := Trim(Parse('TSMBIOS','BIOS', 'Date', v_Report));  
952 - v_te_bios_fabricante := Trim(Parse('TSMBIOS','BIOS', 'Vendor', v_Report));  
953 - v_te_bios_desc := AnsiToAscii(Trim(Parse('TBIOS','', 'Copyright', v_Report)));  
954 - if (v_te_bios_desc = '') then  
955 - v_te_bios_desc := Trim(Parse('TSMBIOS','BIOS', 'Version', v_Report)); 950 + v_te_placa_mae_desc := v_SMBIOS.MainBoardModel;
956 951
  952 + v_te_bios_data := v_SMBIOS.BIOSDate;
  953 + v_te_bios_fabricante := v_SMBIOS.BIOSVendor;
  954 + v_te_bios_desc := v_SMBIOS.BIOSVersion;
  955 +
  956 + v_SMBIOS.Free;
957 Log_Debug('SMBIOS Informations - OK!'); 957 Log_Debug('SMBIOS Informations - OK!');
958 End; 958 End;
959 Except log_diario('Problema em SMBIOS Details!'); 959 Except log_diario('Problema em SMBIOS Details!');
@@ -964,15 +964,13 @@ begin @@ -964,15 +964,13 @@ begin
964 Begin 964 Begin
965 v_DISPLAY := TMiTeC_Display.Create(nil); 965 v_DISPLAY := TMiTeC_Display.Create(nil);
966 v_DISPLAY.RefreshData; 966 v_DISPLAY.RefreshData;
967 - //v_DISPLAY.Report(v_Report);  
968 - MSI_XML_Reports.Display_XML_Report(v_DISPLAY,true,v_Report);  
969 - v_DISPLAY.Free;  
970 967
971 - if (trim(v_te_placa_video_desc)='') then v_te_placa_video_desc := parse('TDisplay','','Adapter',v_Report);  
972 - v_qt_placa_video_cores := parse('TDisplay','','ColorDepth',v_Report);  
973 - v_qt_placa_video_mem := IntToStr(StrToInt(parse('TDisplay','','MemorySize',v_Report)) div 1048576 );  
974 - v_te_placa_video_resolucao := parse('TDisplay','','HorizontalResolution',v_Report) + 'x' + parse('TDisplay','','VerticalResolution',v_Report); 968 + if (trim(v_te_placa_video_desc)='') then v_te_placa_video_desc := v_DISPLAY.Adapter;
  969 + v_qt_placa_video_cores := IntToStr(v_DISPLAY.ColorDepth);
  970 + v_qt_placa_video_mem := IntToStr(v_DISPLAY.Memory div 1048576 ) + 'Mb';
  971 + v_te_placa_video_resolucao := IntToStr(v_DISPLAY.HorzRes) + 'x' + IntToStr(v_DISPLAY.VertRes);
975 972
  973 + v_DISPLAY.Free;
976 Log_Debug('VIDEO Informations - OK!'); 974 Log_Debug('VIDEO Informations - OK!');
977 End; 975 End;
978 Except log_diario('Problema em VIDEO Details!'); 976 Except log_diario('Problema em VIDEO Details!');
@@ -983,27 +981,23 @@ begin @@ -983,27 +981,23 @@ begin
983 Begin 981 Begin
984 v_TCP := TMiTeC_TCPIP.Create(nil); 982 v_TCP := TMiTeC_TCPIP.Create(nil);
985 v_TCP.RefreshData; 983 v_TCP.RefreshData;
986 - //v_TCP.Report(v_Report);  
987 - MSI_XML_Reports.TCPIP_XML_Report(v_TCP,true,v_Report);  
988 - v_TCP.Free; 984 +
989 v_mensagem := 'Ativando TCP Getinfo...'; 985 v_mensagem := 'Ativando TCP Getinfo...';
990 986
991 i := 0; 987 i := 0;
992 v_Macs_Invalidos := trim(GetValorDatMemoria('TCPIP.TE_ENDERECOS_MAC_INVALIDOS',v_tstrCipherOpened)); 988 v_Macs_Invalidos := trim(GetValorDatMemoria('TCPIP.TE_ENDERECOS_MAC_INVALIDOS',v_tstrCipherOpened));
993 989
994 - // Em virtude de possibilidades de existência de VmWare likes,  
995 - // serão verificados até 50 adaptadores de redes! :) Não pesquisei essa possibilidade, por via das dúvidas... (AP - 15FEV2008)  
996 - While (i < 50) do  
997 - Begin  
998 - v_SectionName := 'Adapter_'+inttostr(i);  
999 - v_te_placa_rede_desc := AnsiToAscii(trim(parse('TTCPIP',v_SectionName,'Name',v_Report)));  
1000 - v_PhysicalAddress := parse('TTCPIP',v_SectionName,'PhysicalAddress',v_Report);  
1001 - v_IPAddress := parse('TTCPIP',v_SectionName,'IPAddress',v_Report);  
1002 - v_IPMask := parse('TTCPIP',v_SectionName,'IPMask',v_Report);  
1003 - v_Gateway_IPAddress := parse('TTCPIP',v_SectionName,'Gateway_IPAddress',v_Report);  
1004 - v_DHCP_IPAddress := parse('TTCPIP',v_SectionName,'DHCP_IPAddress',v_Report);  
1005 - v_PrimaryWINS_IPAddress := parse('TTCPIP',v_SectionName,'PrimaryWINS_IPAddress',v_Report);  
1006 - v_SecondaryWINS_IPAddress := parse('TTCPIP',v_SectionName,'SecondaryWINS_IPAddress',v_Report); 990 + // Avalia quantidade de placas de rede e obtem respectivos dados
  991 + if v_TCP.AdapterCount>0 then
  992 + for i:=0 to v_TCP.AdapterCount-1 do begin
  993 + v_te_placa_rede_desc := v_TCP.Adapter[i].Name;
  994 + v_PhysicalAddress := v_TCP.Adapter[i].Address;
  995 + v_IPAddress := v_TCP.Adapter[i].IPAddress[0];
  996 + v_IPMask := v_TCP.Adapter[i].IPAddressMask[0];
  997 + v_Gateway_IPAddress := v_TCP.Adapter[i].Gateway_IPAddress[0];
  998 + v_DHCP_IPAddress := v_TCP.Adapter[i].DHCP_IPAddress[0];
  999 + v_PrimaryWINS_IPAddress := v_TCP.Adapter[i].PrimaryWINS_IPAddress[0];
  1000 + v_SecondaryWINS_IPAddress := v_TCP.Adapter[i].SecondaryWINS_IPAddress[0];
1007 1001
1008 if (trim( v_te_placa_rede_desc + 1002 if (trim( v_te_placa_rede_desc +
1009 v_PhysicalAddress + 1003 v_PhysicalAddress +
@@ -1024,10 +1018,8 @@ begin @@ -1024,10 +1018,8 @@ begin
1024 'te_wins_secundario###' + v_SecondaryWINS_IPAddress); 1018 'te_wins_secundario###' + v_SecondaryWINS_IPAddress);
1025 Log_Debug('Adicionando a tstrTCPIP: "'+v_tstrTCPIP[v_tstrTCPIP.count-1]+'"'); 1019 Log_Debug('Adicionando a tstrTCPIP: "'+v_tstrTCPIP[v_tstrTCPIP.count-1]+'"');
1026 End 1020 End
1027 - else  
1028 - i := 50;  
1029 - i := i + 1;  
1030 End; 1021 End;
  1022 + v_TCP.Free;
1031 Log_Debug('TCPIP Informations - OK!'); 1023 Log_Debug('TCPIP Informations - OK!');
1032 End; 1024 End;
1033 Except log_diario('Problema em TCP Details!'); 1025 Except log_diario('Problema em TCP Details!');
@@ -1086,7 +1078,7 @@ begin @@ -1086,7 +1078,7 @@ begin
1086 Try 1078 Try
1087 // Monto a string que será comparada com o valor armazenado no registro. 1079 // Monto a string que será comparada com o valor armazenado no registro.
1088 v_mensagem := 'Montando pacote para comparações...'; 1080 v_mensagem := 'Montando pacote para comparações...';
1089 - UVC := StringReplace(Trim( v_Tripa_TCPIP + ';' + 1081 + UVC := oCacic.trimEspacosExcedentes(v_Tripa_TCPIP + ';' +
1090 v_Tripa_CPU + ';' + 1082 v_Tripa_CPU + ';' +
1091 v_Tripa_CDROM + ';' + 1083 v_Tripa_CDROM + ';' +
1092 v_te_mem_ram_desc + ';' + 1084 v_te_mem_ram_desc + ';' +
@@ -1103,7 +1095,7 @@ begin @@ -1103,7 +1095,7 @@ begin
1103 v_te_placa_som_desc + ';' + 1095 v_te_placa_som_desc + ';' +
1104 v_te_teclado_desc + ';' + 1096 v_te_teclado_desc + ';' +
1105 v_te_modem_desc + ';' + 1097 v_te_modem_desc + ';' +
1106 - v_te_mouse_desc),' ',' ',[rfReplaceAll]); 1098 + v_te_mouse_desc);
1107 Except log_diario('Problema em comparação de envio!'); 1099 Except log_diario('Problema em comparação de envio!');
1108 End; 1100 End;
1109 1101
@@ -1116,29 +1108,30 @@ begin @@ -1116,29 +1108,30 @@ begin
1116 // na configuração de hardware. Nesse caso, gravo as informações no BD Central 1108 // na configuração de hardware. Nesse caso, gravo as informações no BD Central
1117 // e, se não houver problemas durante esse procedimento, atualizo as 1109 // e, se não houver problemas durante esse procedimento, atualizo as
1118 // informações no registro. 1110 // informações no registro.
1119 - If (GetValorDatMemoria('Configs.IN_COLETA_FORCADA_HARD',v_tstrCipherOpened)='S') or (UVC <> ValorChaveRegistro) Then 1111 + If (GetValorDatMemoria('Configs.IN_COLETA_FORCADA_HARD',v_tstrCipherOpened)='S') or
  1112 + (oCacic.trimEspacosExcedentes(UVC) <> oCacic.trimEspacosExcedentes(ValorChaveRegistro)) Then
1120 Begin 1113 Begin
1121 Try 1114 Try
1122 //Envio via rede para ao Agente Gerente, para gravação no BD. 1115 //Envio via rede para ao Agente Gerente, para gravação no BD.
1123 - SetValorDatMemoria('Col_Hard.te_Tripa_TCPIP' , StringReplace(v_Tripa_TCPIP ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1124 - SetValorDatMemoria('Col_Hard.te_Tripa_CPU' , StringReplace(v_Tripa_CPU ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1125 - SetValorDatMemoria('Col_Hard.te_Tripa_CDROM' , StringReplace(v_Tripa_CDROM ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1126 - SetValorDatMemoria('Col_Hard.te_placa_mae_fabricante' , StringReplace(v_te_placa_mae_fabricante ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1127 - SetValorDatMemoria('Col_Hard.te_placa_mae_desc' , StringReplace(v_te_placa_mae_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1128 - SetValorDatMemoria('Col_Hard.qt_mem_ram' , StringReplace(IntToStr(v_qt_mem_ram) ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1129 - SetValorDatMemoria('Col_Hard.te_mem_ram_desc' , StringReplace(v_te_mem_ram_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1130 - SetValorDatMemoria('Col_Hard.te_bios_desc' , StringReplace(v_te_bios_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1131 - SetValorDatMemoria('Col_Hard.te_bios_data' , StringReplace(v_te_bios_data ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1132 - SetValorDatMemoria('Col_Hard.te_bios_fabricante' , StringReplace(v_te_bios_fabricante ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1133 - SetValorDatMemoria('Col_Hard.qt_placa_video_cores' , StringReplace(v_qt_placa_video_cores ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1134 - SetValorDatMemoria('Col_Hard.te_placa_video_desc' , StringReplace(v_te_placa_video_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1135 - SetValorDatMemoria('Col_Hard.qt_placa_video_mem' , StringReplace(v_qt_placa_video_mem ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1136 - SetValorDatMemoria('Col_Hard.te_placa_video_resolucao', StringReplace(v_te_placa_video_resolucao,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1137 - SetValorDatMemoria('Col_Hard.te_placa_som_desc' , StringReplace(v_te_placa_som_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1138 - SetValorDatMemoria('Col_Hard.te_teclado_desc' , StringReplace(v_te_teclado_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1139 - SetValorDatMemoria('Col_Hard.te_mouse_desc' , StringReplace(v_te_mouse_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1140 - SetValorDatMemoria('Col_Hard.te_modem_desc' , StringReplace(v_te_modem_desc ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1);  
1141 - SetValorDatMemoria('Col_Hard.UVC' , StringReplace(UVC ,' ',' ',[rfReplaceAll]) , v_tstrCipherOpened1); 1116 + SetValorDatMemoria('Col_Hard.te_Tripa_TCPIP' , oCacic.trimEspacosExcedentes( v_Tripa_TCPIP ), v_tstrCipherOpened1);
  1117 + SetValorDatMemoria('Col_Hard.te_Tripa_CPU' , oCacic.trimEspacosExcedentes( v_Tripa_CPU ), v_tstrCipherOpened1);
  1118 + SetValorDatMemoria('Col_Hard.te_Tripa_CDROM' , oCacic.trimEspacosExcedentes( v_Tripa_CDROM ), v_tstrCipherOpened1);
  1119 + SetValorDatMemoria('Col_Hard.te_placa_mae_fabricante' , oCacic.trimEspacosExcedentes( v_te_placa_mae_fabricante ) , v_tstrCipherOpened1);
  1120 + SetValorDatMemoria('Col_Hard.te_placa_mae_desc' , oCacic.trimEspacosExcedentes( v_te_placa_mae_desc ) , v_tstrCipherOpened1);
  1121 + SetValorDatMemoria('Col_Hard.qt_mem_ram' , oCacic.trimEspacosExcedentes( IntToStr(v_qt_mem_ram) ) , v_tstrCipherOpened1);
  1122 + SetValorDatMemoria('Col_Hard.te_mem_ram_desc' , oCacic.trimEspacosExcedentes( v_te_mem_ram_desc ) , v_tstrCipherOpened1);
  1123 + SetValorDatMemoria('Col_Hard.te_bios_desc' , oCacic.trimEspacosExcedentes( v_te_bios_desc ) , v_tstrCipherOpened1);
  1124 + SetValorDatMemoria('Col_Hard.te_bios_data' , oCacic.trimEspacosExcedentes( v_te_bios_data ) , v_tstrCipherOpened1);
  1125 + SetValorDatMemoria('Col_Hard.te_bios_fabricante' , oCacic.trimEspacosExcedentes( v_te_bios_fabricante ) , v_tstrCipherOpened1);
  1126 + SetValorDatMemoria('Col_Hard.qt_placa_video_cores' , oCacic.trimEspacosExcedentes( v_qt_placa_video_cores ) , v_tstrCipherOpened1);
  1127 + SetValorDatMemoria('Col_Hard.te_placa_video_desc' , oCacic.trimEspacosExcedentes( v_te_placa_video_desc ) , v_tstrCipherOpened1);
  1128 + SetValorDatMemoria('Col_Hard.qt_placa_video_mem' , oCacic.trimEspacosExcedentes( v_qt_placa_video_mem ) , v_tstrCipherOpened1);
  1129 + SetValorDatMemoria('Col_Hard.te_placa_video_resolucao', oCacic.trimEspacosExcedentes( v_te_placa_video_resolucao ) , v_tstrCipherOpened1);
  1130 + SetValorDatMemoria('Col_Hard.te_placa_som_desc' , oCacic.trimEspacosExcedentes( v_te_placa_som_desc ) , v_tstrCipherOpened1);
  1131 + SetValorDatMemoria('Col_Hard.te_teclado_desc' , oCacic.trimEspacosExcedentes( v_te_teclado_desc ) , v_tstrCipherOpened1);
  1132 + SetValorDatMemoria('Col_Hard.te_mouse_desc' , oCacic.trimEspacosExcedentes( v_te_mouse_desc ) , v_tstrCipherOpened1);
  1133 + SetValorDatMemoria('Col_Hard.te_modem_desc' , oCacic.trimEspacosExcedentes( v_te_modem_desc ) , v_tstrCipherOpened1);
  1134 + SetValorDatMemoria('Col_Hard.UVC' , oCacic.trimEspacosExcedentes( UVC ) , v_tstrCipherOpened1);
1142 CipherClose(p_path_cacic + 'temp\col_hard.dat', v_tstrCipherOpened1); 1135 CipherClose(p_path_cacic + 'temp\col_hard.dat', v_tstrCipherOpened1);
1143 Except log_diario('Problema em gravação de dados no DAT!'); 1136 Except log_diario('Problema em gravação de dados no DAT!');
1144 End; 1137 End;
@@ -1157,12 +1150,21 @@ begin @@ -1157,12 +1150,21 @@ begin
1157 log_diario('Problema na execução => ' + v_mensagem); 1150 log_diario('Problema na execução => ' + v_mensagem);
1158 End; 1151 End;
1159 End; 1152 End;
  1153 + oCacic.Free();
1160 end; 1154 end;
1161 1155
  1156 +const
  1157 + CACIC_APP_NAME = 'col_hard';
  1158 +
1162 var tstrTripa1 : TStrings; 1159 var tstrTripa1 : TStrings;
1163 intAux : integer; 1160 intAux : integer;
  1161 + oCacic : TCACIC;
  1162 +
1164 begin 1163 begin
1165 - if (ParamCount>0) then 1164 + oCacic := TCACIC.Create();
  1165 +
  1166 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  1167 + if (ParamCount>0) then
1166 Begin 1168 Begin
1167 For intAux := 1 to ParamCount do 1169 For intAux := 1 to ParamCount do
1168 Begin 1170 Begin
@@ -1172,7 +1174,6 @@ begin @@ -1172,7 +1174,6 @@ begin
1172 1174
1173 if (trim(v_CipherKey)<>'') then 1175 if (trim(v_CipherKey)<>'') then
1174 Begin 1176 Begin
1175 -  
1176 //Pegarei o nível anterior do diretório, que deve ser, por exemplo \Cacic, para leitura do cacic2.ini 1177 //Pegarei o nível anterior do diretório, que deve ser, por exemplo \Cacic, para leitura do cacic2.ini
1177 tstrTripa1 := explode(ExtractFilePath(ParamStr(0)),'\'); 1178 tstrTripa1 := explode(ExtractFilePath(ParamStr(0)),'\');
1178 p_path_cacic := ''; 1179 p_path_cacic := '';
@@ -1207,7 +1208,9 @@ begin @@ -1207,7 +1208,9 @@ begin
1207 SetValorDatMemoria('Col_Hard.nada', 'nada', v_tstrCipherOpened1); 1208 SetValorDatMemoria('Col_Hard.nada', 'nada', v_tstrCipherOpened1);
1208 CipherClose(p_path_cacic + 'temp\col_hard.dat', v_tstrCipherOpened1); 1209 CipherClose(p_path_cacic + 'temp\col_hard.dat', v_tstrCipherOpened1);
1209 End; 1210 End;
1210 - Halt(0);  
1211 End; 1211 End;
1212 End; 1212 End;
  1213 +
  1214 + oCacic.Free();
  1215 +
1213 end. 1216 end.
col_hard/col_hard.res
No preview for this file type
col_hard/coleta_hardware.pas
@@ -1,250 +0,0 @@ @@ -1,250 +0,0 @@
1 -unit coleta_hardware;  
2 -  
3 -interface  
4 -  
5 -uses Windows, Registry, SysUtils, Classes, dialogs;  
6 -  
7 -procedure RealizarColetaHardware;  
8 -function GetMACAdress: string;  
9 -  
10 -implementation  
11 -  
12 -  
13 -Uses main, comunicacao, utils, registro, MSI_CPU, MSI_Devices, MiTeC_WinIOCTL, NB30 ;  
14 -  
15 -  
16 -  
17 -function GetMACAdress: string;  
18 -var  
19 - NCB: PNCB;  
20 - Adapter: PAdapterStatus;  
21 -  
22 - URetCode: PChar;  
23 - RetCode: char;  
24 - I: integer;  
25 - Lenum: PlanaEnum;  
26 - _SystemID: string;  
27 - TMPSTR: string;  
28 -begin  
29 - Result := '';  
30 - _SystemID := '';  
31 - Getmem(NCB, SizeOf(TNCB));  
32 - Fillchar(NCB^, SizeOf(TNCB), 0);  
33 -  
34 - Getmem(Lenum, SizeOf(TLanaEnum));  
35 - Fillchar(Lenum^, SizeOf(TLanaEnum), 0);  
36 -  
37 - Getmem(Adapter, SizeOf(TAdapterStatus));  
38 - Fillchar(Adapter^, SizeOf(TAdapterStatus), 0);  
39 -  
40 - Lenum.Length := chr(0);  
41 - NCB.ncb_command := chr(NCBENUM);  
42 - NCB.ncb_buffer := Pointer(Lenum);  
43 - NCB.ncb_length := SizeOf(Lenum);  
44 - RetCode := Netbios(NCB);  
45 -  
46 - i := 0;  
47 - repeat  
48 - Fillchar(NCB^, SizeOf(TNCB), 0);  
49 - Ncb.ncb_command := chr(NCBRESET);  
50 - Ncb.ncb_lana_num := lenum.lana[I];  
51 - RetCode := Netbios(Ncb);  
52 -  
53 - Fillchar(NCB^, SizeOf(TNCB), 0);  
54 - Ncb.ncb_command := chr(NCBASTAT);  
55 - Ncb.ncb_lana_num := lenum.lana[I];  
56 - // Must be 16  
57 - Ncb.ncb_callname := '* ';  
58 -  
59 - Ncb.ncb_buffer := Pointer(Adapter);  
60 -  
61 - Ncb.ncb_length := SizeOf(TAdapterStatus);  
62 - RetCode := Netbios(Ncb);  
63 - //---- calc _systemId from mac-address[2-5] XOR mac-address[1]...  
64 - if (RetCode = chr(0)) or (RetCode = chr(6)) then  
65 - begin  
66 - _SystemId := IntToHex(Ord(Adapter.adapter_address[0]), 2) + '-' +  
67 - IntToHex(Ord(Adapter.adapter_address[1]), 2) + '-' +  
68 - IntToHex(Ord(Adapter.adapter_address[2]), 2) + '-' +  
69 - IntToHex(Ord(Adapter.adapter_address[3]), 2) + '-' +  
70 - IntToHex(Ord(Adapter.adapter_address[4]), 2) + '-' +  
71 - IntToHex(Ord(Adapter.adapter_address[5]), 2);  
72 - end;  
73 - Inc(i);  
74 - until (I >= Ord(Lenum.Length)) or (_SystemID <> '00-00-00-00-00-00');  
75 - FreeMem(NCB);  
76 - FreeMem(Adapter);  
77 - FreeMem(Lenum);  
78 - GetMacAdress := _SystemID;  
79 -end;  
80 -  
81 -  
82 -  
83 -  
84 -  
85 -procedure RealizarColetaHardware;  
86 -var Request_RCH, InfoSoft : TStringList;  
87 - DescPlacaRede, DescPlacaSom, DescCDROM, DescTeclado, DescModem, DescMouse, QtdMemoria, DescMemoria,  
88 - DescHDs, te_placa_mae_fabricante, te_placa_mae_desc,  
89 - ValorChaveColetado, ValorChaveRegistro, s : String;  
90 - i, c : Integer;  
91 -begin  
92 - // Verifica se deverá ser realizada a coleta de informações de hardware neste  
93 - // computador, perguntando ao agente gerente.  
94 - if (CS_COLETA_HARDWARE) Then  
95 - Begin  
96 - main.frmMain.Log_Historico('* Coletando informações de hardware.');  
97 -  
98 - Try main.frmMain.MSystemInfo.CPU.GetInfo(False, False); except end;  
99 - Try main.frmMain.MSystemInfo.Machine.GetInfo(0); except end;  
100 - Try main.frmMain.MSystemInfo.Machine.SMBIOS.GetInfo(1);except end;  
101 - Try main.frmMain.MSystemInfo.Display.GetInfo; except end;  
102 - Try main.frmMain.MSystemInfo.Media.GetInfo; except end;  
103 - Try main.frmMain.MSystemInfo.Devices.GetInfo; except end;  
104 - Try main.frmMain.MSystemInfo.Memory.GetInfo; except end;  
105 - Try main.frmMain.MSystemInfo.OS.GetInfo; except end;  
106 -// main.frmMain.MSystemInfo.Software.GetInfo;  
107 -// main.frmMain.MSystemInfo.Software.Report(InfoSoft);  
108 -  
109 -  
110 - //Try main.frmMain.MSystemInfo.Storage.GetInfo; except end;  
111 -  
112 -  
113 - if (main.frmMain.MSystemInfo.Network.CardAdapterIndex > -1) then DescPlacaRede := main.frmMain.MSystemInfo.Network.Adapters[main.frmMain.MSystemInfo.Network.CardAdapterIndex]  
114 - else DescPlacaRede := main.frmMain.MSystemInfo.Network.Adapters[0];  
115 - DescPlacaRede := Trim(DescPlacaRede);  
116 -  
117 -  
118 - if (main.frmMain.MSystemInfo.Media.Devices.Count > 0) then  
119 - if (main.frmMain.MSystemInfo.Media.SoundCardIndex > -1) then DescPlacaSom := main.frmMain.MSystemInfo.Media.Devices[main.frmMain.MSystemInfo.Media.SoundCardIndex]  
120 - else DescPlacaSom := main.frmMain.MSystemInfo.Media.Devices[0];  
121 -  
122 - DescPlacaSom := Trim(DescPlacaSom);  
123 -  
124 -  
125 - for i:=0 to main.frmMain.MSystemInfo.Devices.DeviceCount-1 do  
126 - Begin  
127 - if main.frmMain.MSystemInfo.Devices.Devices[i].DeviceClass=dcCDROM then  
128 - if Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName)='' then DescCDROM := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].Description)  
129 - else DescCDROM := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName);  
130 - if main.frmMain.MSystemInfo.Devices.Devices[i].DeviceClass=dcModem then  
131 - if Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName)='' then DescModem := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].Description)  
132 - else DescModem := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName);  
133 - if main.frmMain.MSystemInfo.Devices.Devices[i].DeviceClass=dcMouse then  
134 - if Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName)='' then DescMouse := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].Description)  
135 - else DescMouse := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName);  
136 - if main.frmMain.MSystemInfo.Devices.Devices[i].DeviceClass=dcKeyboard then  
137 - if Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName)='' then DescTeclado := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].Description)  
138 - else DescTeclado := Trim(main.frmMain.MSystemInfo.Devices.Devices[i].FriendlyName);  
139 - end;  
140 -  
141 -  
142 - DescMemoria := '';  
143 - Try  
144 - for i:=0 to main.frmMain.MSystemInfo.Machine.SMBIOS.MemoryModuleCount-1 do  
145 - if (main.frmMain.MSystemInfo.Machine.SMBIOS.MemoryModule[i].Size > 0) then  
146 - begin  
147 - DescMemoria := DescMemoria + IntToStr(main.frmMain.MSystemInfo.Machine.SMBIOS.MemoryModule[i].Size) + ' ' +  
148 - main.frmMain.MSystemInfo.Machine.SMBIOS.GetMemoryTypeStr(main.frmMain.MSystemInfo.Machine.SMBIOS.MemoryModule[i].Types) + ' ';  
149 - end;  
150 - Except  
151 - end;  
152 -  
153 - DescMemoria := Trim(DescMemoria);  
154 - QtdMemoria := IntToStr((main.frmMain.MSystemInfo.Memory.PhysicalTotal div 1048576) + 1);  
155 -  
156 - Try  
157 - te_placa_mae_fabricante := Trim(main.frmMain.MSystemInfo.Machine.SMBIOS.MainboardManufacturer);  
158 - te_placa_mae_desc := Trim(main.frmMain.MSystemInfo.Machine.SMBIOS.MainboardModel);  
159 - Except  
160 - end;  
161 -  
162 -  
163 - {  
164 - for i:=0 to main.frmMain.MSystemInfo.Storage.DeviceCount-1 do  
165 - if (main.frmMain.MSystemInfo.Storage.Devices[i].Geometry.MediaType = Fixedmedia) Then  
166 - Begin  
167 - DescHDs := main.frmMain.MSystemInfo.Storage.Devices[i].Model + IntToStr((main.frmMain.MSystemInfo.Storage.Devices[i].Capacity div 1024) div 1024);  
168 - end;  
169 - }  
170 -  
171 -  
172 - // Monto a string que será comparada com o valor armazenado no registro.  
173 - ValorChaveColetado := Trim(DescPlacaRede + ';' +  
174 - CPUVendors[main.frmMain.MSystemInfo.CPU.vendorType] + ';' +  
175 - main.frmMain.MSystemInfo.CPU.FriendlyName + ' ' + main.frmMain.MSystemInfo.CPU.CPUIDNameString + ';' +  
176 - // Como a frequência não é constante, ela não vai entrar na verificação da mudança de hardware.  
177 - // IntToStr(main.frmMain.MSystemInfo.CPU.Frequency) + ';' +  
178 - main.frmMain.MSystemInfo.CPU.SerialNumber + ';' +  
179 - DescMemoria + ';' +  
180 - QtdMemoria + ';' +  
181 - main.frmMain.MSystemInfo.Machine.BIOS.Name + ';' +  
182 - main.frmMain.MSystemInfo.Machine.BIOS.Date + ';' +  
183 - main.frmMain.MSystemInfo.Machine.BIOS.Copyright + ';' +  
184 - te_placa_mae_fabricante + ';' +  
185 - te_placa_mae_desc + ';' +  
186 - main.frmMain.MSystemInfo.Display.Adapter + ';' +  
187 - IntToStr(main.frmMain.MSystemInfo.Display.HorzRes) + 'x' + IntToStr(main.frmMain.MSystemInfo.Display.VertRes) + ';' +  
188 - IntToStr(main.frmMain.MSystemInfo.Display.ColorDepth) + ';' +  
189 - IntToStr((main.frmMain.MSystemInfo.Display.Memory) div 1048576 ) + ';' +  
190 - DescPlacaSom + ';' +  
191 - DescCDROM + ';' +  
192 - DescTeclado + ';' +  
193 - DescModem + ';' +  
194 - DescMouse);  
195 -  
196 - // Obtenho do registro o valor que foi previamente armazenado  
197 - ValorChaveRegistro := Trim(Registro.GetValorChaveRegIni('Coleta','Hardware',p_path_cacic_ini));  
198 -  
199 - // Se essas informações forem diferentes significa que houve alguma alteração  
200 - // na configuração de hardware. Nesse caso, gravo as informações no BD Central  
201 - // e, se não houver problemas durante esse procedimento, atualizo as  
202 - // informações no registro.  
203 - If (IN_COLETA_FORCADA or (ValorChaveColetado <> ValorChaveRegistro)) Then  
204 - Begin  
205 - //Envio via rede para ao Agente Gerente, para gravação no BD.  
206 - Request_RCH:=TStringList.Create;  
207 - Request_RCH.Values['te_node_address'] := TE_NODE_ADDRESS;  
208 - Request_RCH.Values['id_so'] := ID_SO;  
209 - Request_RCH.Values['te_nome_computador'] := TE_NOME_COMPUTADOR;  
210 - Request_RCH.Values['id_ip_rede'] := ID_IP_REDE;  
211 - Request_RCH.Values['te_ip'] := TE_IP;  
212 - Request_RCH.Values['te_workgroup'] := TE_WORKGROUP;  
213 - Request_RCH.Values['te_placa_rede_desc'] := DescPlacaRede;  
214 - Request_RCH.Values['te_placa_mae_fabricante'] := te_placa_mae_fabricante;  
215 - Request_RCH.Values['te_placa_mae_desc'] := te_placa_mae_desc;  
216 - Request_RCH.Values['te_cpu_serial'] := Trim(main.frmMain.MSystemInfo.CPU.SerialNumber);  
217 - Request_RCH.Values['te_cpu_desc'] := Trim(main.frmMain.MSystemInfo.CPU.FriendlyName + ' ' + main.frmMain.MSystemInfo.CPU.CPUIDNameString);  
218 - Request_RCH.Values['te_cpu_fabricante'] := CPUVendors[main.frmMain.MSystemInfo.CPU.vendorType];  
219 - Request_RCH.Values['te_cpu_freq'] := IntToStr(main.frmMain.MSystemInfo.CPU.Frequency);  
220 - Request_RCH.Values['qt_mem_ram'] := QtdMemoria;  
221 - Request_RCH.Values['te_mem_ram_desc'] := DescMemoria;  
222 - Request_RCH.Values['te_bios_desc'] := Trim(main.frmMain.MSystemInfo.Machine.BIOS.Name);  
223 - Request_RCH.Values['te_bios_data'] := Trim(main.frmMain.MSystemInfo.Machine.BIOS.Date);  
224 - Request_RCH.Values['te_bios_fabricante'] := Trim(main.frmMain.MSystemInfo.Machine.BIOS.Copyright);  
225 - Request_RCH.Values['qt_placa_video_cores'] := IntToStr(main.frmMain.MSystemInfo.Display.ColorDepth);  
226 - Request_RCH.Values['te_placa_video_desc'] := Trim(main.frmMain.MSystemInfo.Display.Adapter);  
227 - Request_RCH.Values['qt_placa_video_mem'] := IntToStr((main.frmMain.MSystemInfo.Display.Memory) div 1048576);  
228 - Request_RCH.Values['te_placa_video_resolucao']:= IntToStr(main.frmMain.MSystemInfo.Display.HorzRes) + 'x' + IntToStr(main.frmMain.MSystemInfo.Display.VertRes);  
229 - Request_RCH.Values['te_placa_som_desc'] := DescPlacaSom;  
230 - Request_RCH.Values['te_cdrom_desc'] := DescCDROM;  
231 - Request_RCH.Values['te_teclado_desc'] := DescTeclado;  
232 - Request_RCH.Values['te_mouse_desc'] := DescMouse;  
233 - Request_RCH.Values['te_modem_desc'] := DescModem;  
234 -  
235 - // Somente atualizo o registro caso não tenha havido nenhum erro durante o envio das informações para o BD  
236 - //Sobreponho a informação no registro para posterior comparação, na próxima execução.  
237 - if (comunicacao.ComunicaServidor('set_hardware.php', Request_RCH, '>> Enviando informações de hardware para o servidor.') <> '0') Then  
238 - Begin  
239 - Registro.SetValorChaveRegIni('Coleta','Hardware', ValorChaveColetado,p_path_cacic_ini);  
240 - end;  
241 - Request_RCH.Free;  
242 - end;  
243 - end  
244 - else main.frmMain.Log_Historico('Coleta de informações de hardware não configurada.');  
245 -  
246 -end;  
247 -  
248 -  
249 -end.  
250 -  
col_hard/main_hard.ddp
No preview for this file type
col_hard/main_hard.dfm
No preview for this file type
col_hard/main_hard.pas
@@ -1,436 +0,0 @@ @@ -1,436 +0,0 @@
1 -(**  
2 ----------------------------------------------------------------------------------------------------------------------------------------------------------------  
3 -Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil  
4 -  
5 -Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais  
6 -  
7 -O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como  
8 -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão.  
9 -  
10 -Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer  
11 -MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes.  
12 -  
13 -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software  
14 -Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA  
15 -  
16 -NOTA: O componente MiTeC System Information Component (MSIC) é baseado na classe TComponent e contém alguns subcomponentes baseados na classe TPersistent  
17 - Este componente é apenas freeware e não open-source, e foi baixado de http://www.mitec.cz/Downloads/MSIC.zip  
18 ----------------------------------------------------------------------------------------------------------------------------------------------------------------  
19 -*)  
20 -unit main_hard;  
21 -  
22 -interface  
23 -  
24 -uses Windows, Messages, SysUtils, Classes, Forms, IniFiles, ExtCtrls, Controls, MSI_GUI, MSI_Devices, MSI_CPU;  
25 -var p_path_cacic, p_path_cacic_ini : string;  
26 -type  
27 - Tfrm_col_hard = class(TForm)  
28 - MSystemInfo1: TMSystemInfo;  
29 - procedure FormCreate(Sender: TObject);  
30 - private  
31 - procedure Executa_Col_Hard;  
32 - procedure Log_Historico(strMsg : String);  
33 - function SetValorChaveRegIni(p_Secao: String; p_Chave: String; p_Valor: String; p_Path : String): String;  
34 - Function Crip(PNome: String): String;  
35 - Function DesCrip(PNome: String): String;  
36 -// Function GetValorChaveRegIni(p_Secao: String; p_Chave : String; p_Path : String): String;  
37 - function GetValorChaveRegIni(p_SectionName, p_KeyName, p_IniFileName : String) : String;  
38 - Function Explode(Texto, Separador : String) : TStrings;  
39 - Function GetRootKey(strRootKey: String): HKEY;  
40 - Function RemoveCaracteresEspeciais(Texto : String) : String;  
41 - public  
42 - end;  
43 -  
44 -var  
45 - frm_col_hard: Tfrm_col_hard;  
46 -  
47 -implementation  
48 -  
49 -{$R *.dfm}  
50 -  
51 -//uses MSI_CPU, MSI_Devices, MiTeC_WinIOCTL, NB30;  
52 -//MSI_Devices, MSI_CPU, MSI_GUI,  
53 -  
54 -//Para gravar no Arquivo INI...  
55 -function Tfrm_col_hard.SetValorChaveRegIni(p_Secao: String; p_Chave: String; p_Valor: String; p_Path : String): String;  
56 -var Reg_Ini : TIniFile;  
57 -begin  
58 - FileSetAttr (p_Path,0);  
59 - Reg_Ini := TIniFile.Create(p_Path);  
60 -// Reg_Ini.WriteString(frm_col_hard.Crip(p_Secao), frm_col_hard.Crip(p_Chave), frm_col_hard.Crip(p_Valor));  
61 - Reg_Ini.WriteString(p_Secao, p_Chave, p_Valor);  
62 - Reg_Ini.Free;  
63 -end;  
64 -  
65 -//Para buscar do Arquivo INI...  
66 -//function Tfrm_col_hard.GetValorChaveRegIni(p_Secao: String; p_Chave : String; p_Path : String): String;  
67 -//var Reg_Ini: TIniFile;  
68 -//begin  
69 -// FileSetAttr (p_Path,0);  
70 -// Reg_Ini := TIniFile.Create(p_Path);  
71 -//// Result := frm_col_hard.DesCrip(Reg_Ini.ReadString(frm_col_hard.Crip(p_Secao), frm_col_hard.Crip(p_Chave), ''));  
72 -// Result := Reg_Ini.ReadString(p_Secao, p_Chave, '');  
73 -// Reg_Ini.Free;  
74 -//end;  
75 -//Para buscar do Arquivo INI...  
76 -// Marreta devido a limitações do KERNEL w9x no tratamento de arquivos texto e suas seções  
77 -function Tfrm_col_hard.GetValorChaveRegIni(p_SectionName, p_KeyName, p_IniFileName : String) : String;  
78 -var  
79 - FileText : TStringList;  
80 - i, j, v_Size_Section, v_Size_Key : integer;  
81 - v_SectionName, v_KeyName : string;  
82 - begin  
83 - Result := '';  
84 - v_SectionName := '[' + p_SectionName + ']';  
85 - v_Size_Section := strLen(PChar(v_SectionName));  
86 - v_KeyName := p_KeyName + '=';  
87 - v_Size_Key := strLen(PChar(v_KeyName));  
88 - FileText := TStringList.Create;  
89 - try  
90 - FileText.LoadFromFile(p_IniFileName);  
91 - For i := 0 To FileText.Count - 1 Do  
92 - Begin  
93 - if (LowerCase(Trim(PChar(Copy(FileText[i],1,v_Size_Section)))) = LowerCase(Trim(PChar(v_SectionName)))) then  
94 - Begin  
95 - For j := i to FileText.Count - 1 Do  
96 - Begin  
97 - if (LowerCase(Trim(PChar(Copy(FileText[j],1,v_Size_Key)))) = LowerCase(Trim(PChar(v_KeyName)))) then  
98 - Begin  
99 - Result := PChar(Copy(FileText[j],v_Size_Key + 1,strLen(PChar(FileText[j]))-v_Size_Key));  
100 - Break;  
101 - End;  
102 - End;  
103 - End;  
104 - if (Result <> '') then break;  
105 - End;  
106 - finally  
107 - FileText.Free;  
108 - end;  
109 - end;  
110 -  
111 -Function Tfrm_col_hard.Explode(Texto, Separador : String) : TStrings;  
112 -var  
113 - strItem : String;  
114 - ListaAuxUTILS : TStrings;  
115 - NumCaracteres, I : Integer;  
116 -Begin  
117 - ListaAuxUTILS := TStringList.Create;  
118 - strItem := '';  
119 - NumCaracteres := Length(Texto);  
120 - For I := 0 To NumCaracteres Do  
121 - If (Texto[I] = Separador) or (I = NumCaracteres) Then  
122 - Begin  
123 - If (I = NumCaracteres) then strItem := strItem + Texto[I];  
124 - ListaAuxUTILS.Add(Trim(strItem));  
125 - strItem := '';  
126 - end  
127 - Else strItem := strItem + Texto[I];  
128 - Explode := ListaAuxUTILS;  
129 -//Não estava sendo liberado  
130 -// ListaAuxUTILS.Free;  
131 -//Ao ativar esta liberação tomei uma baita surra!!!! 11/05/2004 - 20:30h - Uma noite muito escura! :) Anderson Peterle  
132 -end;  
133 -  
134 -function Tfrm_col_hard.GetRootKey(strRootKey: String): HKEY;  
135 -begin  
136 - /// Encontrar uma maneira mais elegante de fazer esses testes.  
137 - if Trim(strRootKey) = 'HKEY_LOCAL_MACHINE' Then Result := HKEY_LOCAL_MACHINE  
138 - else if Trim(strRootKey) = 'HKEY_CLASSES_ROOT' Then Result := HKEY_CLASSES_ROOT  
139 - else if Trim(strRootKey) = 'HKEY_CURRENT_USER' Then Result := HKEY_CURRENT_USER  
140 - else if Trim(strRootKey) = 'HKEY_USERS' Then Result := HKEY_USERS  
141 - else if Trim(strRootKey) = 'HKEY_CURRENT_CONFIG' Then Result := HKEY_CURRENT_CONFIG  
142 - else if Trim(strRootKey) = 'HKEY_DYN_DATA' Then Result := HKEY_DYN_DATA;  
143 -end;  
144 -  
145 -Function Tfrm_col_hard.RemoveCaracteresEspeciais(Texto : String) : String;  
146 -var I : Integer;  
147 - strAux : String;  
148 -Begin  
149 - For I := 0 To Length(Texto) Do  
150 - if ord(Texto[I]) in [32..126] Then  
151 - strAux := strAux + Texto[I]  
152 - else strAux := strAux + ' '; // Coloca um espaço onde houver caracteres especiais  
153 - Result := strAux;  
154 -end;  
155 -  
156 -  
157 -procedure Tfrm_col_hard.Executa_Col_Hard;  
158 -var InfoSoft : TStringList;  
159 - v_te_cpu_freq, v_te_cpu_fabricante, v_te_cpu_desc, v_te_cpu_serial, v_te_placa_rede_desc, v_te_placa_som_desc, v_te_cdrom_desc, v_te_teclado_desc,  
160 - v_te_modem_desc, v_te_mouse_desc, v_qt_mem_ram, v_te_mem_ram_desc, v_qt_placa_video_mem, v_te_placa_video_resolucao, v_te_placa_video_desc,  
161 - v_qt_placa_video_cores, v_te_bios_fabricante, v_te_bios_data, v_te_bios_desc,  
162 - v_te_placa_mae_fabricante, v_te_placa_mae_desc,  
163 - ValorChaveColetado, ValorChaveRegistro : String;  
164 - i : Integer;  
165 -begin  
166 - Try  
167 - frm_col_hard.Log_Historico('* Coletando informações de Hardware.');  
168 -  
169 - Try frm_col_hard.MSysteminfo1.CPU.GetInfo(False, False); except end;  
170 - Try frm_col_hard.MSysteminfo1.Machine.GetInfo(0); except end;  
171 - Try frm_col_hard.MSysteminfo1.Machine.SMBIOS.GetInfo(1);except end;  
172 - Try frm_col_hard.MSysteminfo1.Display.GetInfo; except end;  
173 - Try frm_col_hard.MSysteminfo1.Media.GetInfo; except end;  
174 - Try frm_col_hard.MSysteminfo1.Devices.GetInfo; except end;  
175 - Try frm_col_hard.MSysteminfo1.Memory.GetInfo; except end;  
176 - Try frm_col_hard.MSysteminfo1.OS.GetInfo; except end;  
177 -// frm_col_hard.MSysteminfo1.Software.GetInfo;  
178 -// frm_col_hard.MSysteminfo1.Software.Report(InfoSoft);  
179 -  
180 -  
181 - //Try frm_col_hard.MSysteminfo1.Storage.GetInfo; except end;  
182 -  
183 -  
184 - if (frm_col_hard.MSysteminfo1.Network.CardAdapterIndex > -1) then v_te_placa_rede_desc := frm_col_hard.MSysteminfo1.Network.Adapters[frm_col_hard.MSysteminfo1.Network.CardAdapterIndex]  
185 - else v_te_placa_rede_desc := frm_col_hard.MSysteminfo1.Network.Adapters[0];  
186 - v_te_placa_rede_desc := Trim(v_te_placa_rede_desc);  
187 -  
188 -  
189 - if (frm_col_hard.MSysteminfo1.Media.Devices.Count > 0) then  
190 - if (frm_col_hard.MSysteminfo1.Media.SoundCardIndex > -1) then v_te_placa_som_desc := frm_col_hard.MSysteminfo1.Media.Devices[frm_col_hard.MSysteminfo1.Media.SoundCardIndex]  
191 - else v_te_placa_som_desc := frm_col_hard.MSysteminfo1.Media.Devices[0];  
192 -  
193 - v_te_placa_som_desc := Trim(v_te_placa_som_desc);  
194 -  
195 -  
196 - for i:=0 to frm_col_hard.MSysteminfo1.Devices.DeviceCount-1 do  
197 - Begin  
198 - if frm_col_hard.MSysteminfo1.Devices.Devices[i].DeviceClass=dcCDROM then  
199 - if Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName)='' then v_te_cdrom_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].Description)  
200 - else v_te_cdrom_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName);  
201 - if frm_col_hard.MSysteminfo1.Devices.Devices[i].DeviceClass=dcModem then  
202 - if Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName)='' then v_te_modem_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].Description)  
203 - else v_te_modem_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName);  
204 - if frm_col_hard.MSysteminfo1.Devices.Devices[i].DeviceClass=dcMouse then  
205 - if Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName)='' then v_te_mouse_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].Description)  
206 - else v_te_mouse_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName);  
207 - if frm_col_hard.MSysteminfo1.Devices.Devices[i].DeviceClass=dcKeyboard then  
208 - if Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName)='' then v_te_teclado_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].Description)  
209 - else v_te_teclado_desc := Trim(frm_col_hard.MSysteminfo1.Devices.Devices[i].FriendlyName);  
210 - end;  
211 -  
212 -  
213 - v_te_mem_ram_desc := '';  
214 - Try  
215 -// for i:=0 to frm_col_hard.MSysteminfo1.Machine.SMBIOS.MemoryModuleCount-1 do  
216 - for i:=0 to frm_col_hard.MSysteminfo1.Machine.SMBIOS.MemorySlotCount-1 do  
217 -// if (frm_col_hard.MSysteminfo1.Machine.SMBIOS.MemoryModule[i].Size > 0) then  
218 - if (frm_col_hard.MSysteminfo1.Machine.SMBIOS.MemoryBank[i].Size > 0) then  
219 - begin  
220 - v_te_mem_ram_desc := v_te_mem_ram_desc + IntToStr(frm_col_hard.MSysteminfo1.Machine.SMBIOS.MemoryBank[i].Size) + ' ' +  
221 - frm_col_hard.MSysteminfo1.Machine.SMBIOS.GetMemoryTypeStr(frm_col_hard.MSysteminfo1.Machine.SMBIOS.MemoryBank[i].Types) + ' ';  
222 - end;  
223 - Except  
224 - end;  
225 -  
226 - v_te_mem_ram_desc := Trim(v_te_mem_ram_desc);  
227 - v_qt_mem_ram := IntToStr((frm_col_hard.MSysteminfo1.Memory.PhysicalTotal div 1048576) + 1);  
228 -  
229 - Try  
230 - v_te_placa_mae_fabricante := Trim(frm_col_hard.MSysteminfo1.Machine.SMBIOS.MainboardManufacturer);  
231 - v_te_placa_mae_desc := Trim(frm_col_hard.MSysteminfo1.Machine.SMBIOS.MainboardModel);  
232 - Except  
233 - end;  
234 -  
235 - Try  
236 - v_te_cpu_serial := Trim(frm_col_hard.MSystemInfo1.CPU.SerialNumber);  
237 - v_te_cpu_desc := Trim(frm_col_hard.MSystemInfo1.CPU.FriendlyName + ' ' + frm_col_hard.MSystemInfo1.CPU.CPUIDNameString);  
238 - v_te_cpu_fabricante := CPUVendors[frm_col_hard.MSystemInfo1.CPU.vendorType];  
239 - v_te_cpu_freq := IntToStr(frm_col_hard.MSystemInfo1.CPU.Frequency);  
240 - Except  
241 - end;  
242 -  
243 - Try  
244 - v_te_bios_desc := Trim(frm_col_hard.MSysteminfo1.Machine.BIOS.Name);  
245 - v_te_bios_data := Trim(frm_col_hard.MSysteminfo1.Machine.BIOS.Date);  
246 - v_te_bios_fabricante := Trim(frm_col_hard.MSysteminfo1.Machine.BIOS.Copyright);  
247 - Except  
248 - End;  
249 -  
250 - Try  
251 - v_qt_placa_video_cores := IntToStr(frm_col_hard.MSysteminfo1.Display.ColorDepth);  
252 - v_te_placa_video_desc := Trim(frm_col_hard.MSysteminfo1.Display.Adapter);  
253 - v_qt_placa_video_mem := IntToStr((frm_col_hard.MSysteminfo1.Display.Memory) div 1048576 );  
254 - v_te_placa_video_resolucao := IntToStr(frm_col_hard.MSysteminfo1.Display.HorzRes) + 'x' + IntToStr(frm_col_hard.MSysteminfo1.Display.VertRes);  
255 - Except  
256 - End;  
257 - {  
258 - for i:=0 to frm_col_hard.MSysteminfo1.Storage.DeviceCount-1 do  
259 - if (frm_col_hard.MSysteminfo1.Storage.Devices[i].Geometry.MediaType = Fixedmedia) Then  
260 - Begin  
261 - DescHDs := frm_col_hard.MSysteminfo1.Storage.Devices[i].Model + IntToStr((frm_col_hard.MSysteminfo1.Storage.Devices[i].Capacity div 1024) div 1024);  
262 - end;  
263 - }  
264 -  
265 -  
266 -  
267 - // Monto a string que será comparada com o valor armazenado no registro.  
268 - ValorChaveColetado := Trim(v_te_placa_rede_desc + ';' +  
269 - v_te_cpu_fabricante + ';' +  
270 - v_te_cpu_desc + ';' +  
271 - // Como a frequência não é constante, ela não vai entrar na verificação da mudança de hardware.  
272 - // IntToStr(frm_col_hard.MSysteminfo1.CPU.Frequency) + ';' +  
273 - v_te_cpu_serial + ';' +  
274 - v_te_mem_ram_desc + ';' +  
275 - v_qt_mem_ram + ';' +  
276 - v_te_bios_desc + ';' +  
277 - v_te_bios_data + ';' +  
278 - v_te_bios_fabricante + ';' +  
279 - v_te_placa_mae_fabricante + ';' +  
280 - v_te_placa_mae_desc + ';' +  
281 - v_te_placa_video_desc + ';' +  
282 - v_te_placa_video_resolucao + ';' +  
283 - v_qt_placa_video_cores + ';' +  
284 - v_qt_placa_video_mem + ';' +  
285 - v_te_placa_som_desc + ';' +  
286 - v_te_cdrom_desc + ';' +  
287 - v_te_teclado_desc + ';' +  
288 - v_te_modem_desc + ';' +  
289 - v_te_mouse_desc);  
290 -  
291 -  
292 - // Obtenho do registro o valor que foi previamente armazenado  
293 - ValorChaveRegistro := Trim(GetValorChaveRegIni('Coleta','Hardware',p_path_cacic_ini));  
294 -  
295 - // Se essas informações forem diferentes significa que houve alguma alteração  
296 - // na configuração de hardware. Nesse caso, gravo as informações no BD Central  
297 - // e, se não houver problemas durante esse procedimento, atualizo as  
298 - // informações no registro.  
299 -  
300 - If (GetValorChaveRegIni('Configs','IN_COLETA_FORCADA_HARD',p_path_cacic_ini)='S') or (ValorChaveColetado <> ValorChaveRegistro) Then  
301 - Begin  
302 - //Envio via rede para ao Agente Gerente, para gravação no BD.  
303 - SetValorChaveRegIni('Col_Hard','te_placa_rede_desc' , v_te_placa_rede_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
304 - SetValorChaveRegIni('Col_Hard','te_placa_mae_fabricante' , v_te_placa_mae_fabricante , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
305 - SetValorChaveRegIni('Col_Hard','te_placa_mae_desc' , v_te_placa_mae_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
306 - SetValorChaveRegIni('Col_Hard','te_cpu_serial' , v_te_cpu_serial , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
307 - SetValorChaveRegIni('Col_Hard','te_cpu_desc' , v_te_cpu_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
308 - SetValorChaveRegIni('Col_Hard','te_cpu_fabricante' , v_te_cpu_fabricante , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
309 - SetValorChaveRegIni('Col_Hard','te_cpu_freq' , v_te_cpu_freq , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
310 - SetValorChaveRegIni('Col_Hard','qt_mem_ram' , v_qt_mem_ram , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
311 - SetValorChaveRegIni('Col_Hard','te_mem_ram_desc' , v_te_mem_ram_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
312 - SetValorChaveRegIni('Col_Hard','te_bios_desc' , v_te_bios_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
313 - SetValorChaveRegIni('Col_Hard','te_bios_data' , v_te_bios_data , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
314 - SetValorChaveRegIni('Col_Hard','te_bios_fabricante' , v_te_bios_fabricante , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
315 - SetValorChaveRegIni('Col_Hard','qt_placa_video_cores' , v_qt_placa_video_cores , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
316 - SetValorChaveRegIni('Col_Hard','te_placa_video_desc' , v_te_placa_video_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
317 - SetValorChaveRegIni('Col_Hard','qt_placa_video_mem' , v_qt_placa_video_mem , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
318 - SetValorChaveRegIni('Col_Hard','te_placa_video_resolucao', v_te_placa_video_resolucao, frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
319 - SetValorChaveRegIni('Col_Hard','te_placa_som_desc' , v_te_placa_som_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
320 - SetValorChaveRegIni('Col_Hard','te_cdrom_desc' , v_te_cdrom_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
321 - SetValorChaveRegIni('Col_Hard','te_teclado_desc' , v_te_teclado_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
322 - SetValorChaveRegIni('Col_Hard','te_mouse_desc' , v_te_mouse_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
323 - SetValorChaveRegIni('Col_Hard','te_modem_desc' , v_te_modem_desc , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
324 - SetValorChaveRegIni('Col_Hard','ValorChaveColetado' , ValorChaveColetado , frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
325 -  
326 - end  
327 - else SetValorChaveRegIni('Col_Hard','nada', 'nada', frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
328 - Application.terminate  
329 - Except  
330 - SetValorChaveRegIni('Col_Hard','nada', 'nada', frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
331 - Application.terminate;  
332 - End;  
333 -end;  
334 -  
335 -  
336 -procedure Tfrm_col_hard.Log_Historico(strMsg : String);  
337 -var  
338 - HistoricoLog : TextFile;  
339 - strDataArqLocal, strDataAtual : string;  
340 -begin  
341 - try  
342 - FileSetAttr (p_path_cacic + 'cacic2.log',0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000  
343 - AssignFile(HistoricoLog,p_path_cacic + 'cacic2.log'); {Associa o arquivo a uma variável do tipo TextFile}  
344 - {$IOChecks off}  
345 - Reset(HistoricoLog); {Abre o arquivo texto}  
346 - {$IOChecks on}  
347 - if (IOResult <> 0) then // Arquivo não existe, será recriado.  
348 - begin  
349 - Rewrite (HistoricoLog);  
350 - Append(HistoricoLog);  
351 - Writeln(HistoricoLog,FormatDateTime('dd/mm hh:nn:ss : ', Now) + '======================> Iniciando o Log do CACIC <=======================');  
352 - end;  
353 - DateTimeToString(strDataArqLocal, 'yyyymmdd', FileDateToDateTime(Fileage(p_path_cacic + 'cacic2.log')));  
354 - DateTimeToString(strDataAtual , 'yyyymmdd', Date);  
355 - if (strDataAtual <> strDataArqLocal) then // Se o arquivo INI não é da data atual...  
356 - begin  
357 - Rewrite (HistoricoLog); //Cria/Recria o arquivo  
358 - Append(HistoricoLog);  
359 - Writeln(HistoricoLog,FormatDateTime('dd/mm hh:nn:ss : ', Now) + '======================> Iniciando o Log do CACIC <=======================');  
360 - end;  
361 - Append(HistoricoLog);  
362 - Writeln(HistoricoLog,FormatDateTime('dd/mm hh:nn:ss : ', Now) + strMsg); {Grava a string Texto no arquivo texto}  
363 - CloseFile(HistoricoLog); {Fecha o arquivo texto}  
364 -// FileSetAttr (ExtractFilePath(Application.Exename) + '\cacic2.log',6); // Muda o atributo para arquivo de SISTEMA e OCULTO  
365 -  
366 - except  
367 - Log_Historico('Erro na gravação do log!');  
368 - end;  
369 -end;  
370 -// Simples rotinas de Criptografação e Descriptografação  
371 -// Baixadas de http://www.costaweb.com.br/forum/delphi/474.shtml  
372 -Function Tfrm_col_hard.Crip(PNome: String): String;  
373 -Var  
374 - TamI, TamF: Integer;  
375 - SenA, SenM, SenD: String;  
376 -Begin  
377 - SenA := Trim(PNome);  
378 - TamF := Length(SenA);  
379 - if (TamF > 1) then  
380 - begin  
381 - SenM := '';  
382 - SenD := '';  
383 - For TamI := TamF Downto 1 do  
384 - Begin  
385 - SenM := SenM + Copy(SenA,TamI,1);  
386 - End;  
387 - SenD := Chr(TamF+95)+Copy(SenM,1,1)+Copy(SenA,1,1)+Copy(SenM,2,TamF-2)+Chr(75+TamF);  
388 - end  
389 - else SenD := SenA;  
390 - Result := SenD;  
391 -End;  
392 -  
393 -Function Tfrm_col_hard.DesCrip(PNome: String): String;  
394 -Var  
395 - TamI, TamF: Integer;  
396 - SenA, SenM, SenD: String;  
397 -Begin  
398 - SenA := Trim(PNome);  
399 - TamF := Length(SenA) - 2;  
400 - if (TamF > 1) then  
401 - begin  
402 - SenM := '';  
403 - SenD := '';  
404 - SenA := Copy(SenA,2,TamF);  
405 - SenM := Copy(SenA,1,1)+Copy(SenA,3,TamF)+Copy(SenA,2,1);  
406 - For TamI := TamF Downto 1 do  
407 - Begin  
408 - SenD := SenD + Copy(SenM,TamI,1);  
409 - End;  
410 - end  
411 - else SenD := SenA;  
412 - Result := SenD;  
413 -End;  
414 -  
415 -procedure Tfrm_col_hard.FormCreate(Sender: TObject);  
416 -var tstrTripa1 : TStrings;  
417 - intAux : integer;  
418 -begin  
419 - //Pegarei o nível anterior do diretório, que deve ser, por exemplo \Cacic, para leitura do cacic2.ini  
420 - tstrTripa1 := explode(ExtractFilePath(Application.Exename),'\');  
421 - p_path_cacic := '';  
422 - For intAux := 0 to tstrTripa1.Count -2 do  
423 - begin  
424 - p_path_cacic := p_path_cacic + tstrTripa1[intAux] + '\';  
425 - end;  
426 - p_path_cacic_ini := p_path_cacic + 'cacic2.ini';  
427 -  
428 - Try  
429 - Executa_Col_Hard;  
430 - Except  
431 - SetValorChaveRegIni('Col_Hard','nada', 'nada', frm_col_hard.GetValorChaveRegIni('Configs','P_PATH_COLETAS_INI',p_path_cacic + 'cacic2.ini')+'col_hard.ini');  
432 - Application.terminate;  
433 - End;  
434 -end;  
435 -  
436 -end.  
col_moni/col_moni.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
col_moni/col_moni.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev/ES 127 CompanyName=Dataprev/ES
128 FileDescription=Coletor de Informações de Sistemas Monitorados do pelo CACIC 128 FileDescription=Coletor de Informações de Sistemas Monitorados do pelo CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_MONI 134 ProductName=Col_MONI
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=5  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\mitec;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\mitec 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_moni/col_moni.dpr
@@ -18,15 +18,17 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -18,15 +18,17 @@ Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 program col_moni; 18 program col_moni;
19 {$R *.res} 19 {$R *.res}
20 20
21 -uses Windows,  
22 - sysutils,  
23 - inifiles,  
24 - Registry,  
25 - Classes,  
26 - PJVersionInfo,  
27 - DCPcrypt2,  
28 - DCPrijndael,  
29 - DCPbase64; 21 +uses
  22 + Windows,
  23 + sysutils,
  24 + inifiles,
  25 + Registry,
  26 + Classes,
  27 + PJVersionInfo,
  28 + DCPcrypt2,
  29 + DCPrijndael,
  30 + DCPbase64,
  31 + CACIC_Library in '..\CACIC_Library.pas';
30 32
31 var p_path_cacic, v_Res_Search, v_Drive, v_File : string; 33 var p_path_cacic, v_Res_Search, v_Drive, v_File : string;
32 PJVersionInfo1: TPJVersionInfo; 34 PJVersionInfo1: TPJVersionInfo;
@@ -1074,11 +1076,18 @@ begin @@ -1074,11 +1076,18 @@ begin
1074 end; 1076 end;
1075 end; 1077 end;
1076 1078
  1079 +const
  1080 + CACIC_APP_NAME = 'col_moni';
1077 1081
1078 var tstrTripa1 : TStrings; 1082 var tstrTripa1 : TStrings;
1079 intAux : integer; 1083 intAux : integer;
  1084 + oCacic : TCACIC;
  1085 +
1080 begin 1086 begin
1081 - if (ParamCount>0) then 1087 + oCacic := TCACIC.Create();
  1088 +
  1089 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  1090 + if (ParamCount>0) then
1082 Begin 1091 Begin
1083 For intAux := 1 to ParamCount do 1092 For intAux := 1 to ParamCount do
1084 Begin 1093 Begin
@@ -1122,7 +1131,9 @@ begin @@ -1122,7 +1131,9 @@ begin
1122 SetValorDatMemoria('Col_Moni.nada', 'nada', v_tstrCipherOpened1); 1131 SetValorDatMemoria('Col_Moni.nada', 'nada', v_tstrCipherOpened1);
1123 CipherClose(p_path_cacic + 'temp\col_moni.dat', v_tstrCipherOpened1); 1132 CipherClose(p_path_cacic + 'temp\col_moni.dat', v_tstrCipherOpened1);
1124 End; 1133 End;
1125 - Halt(0);  
1126 End; 1134 End;
1127 End; 1135 End;
  1136 +
  1137 + oCacic.Free();
  1138 +
1128 end. 1139 end.
col_moni/col_moni.res
No preview for this file type
col_patr/col_patr.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
col_patr/col_patr.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,23 +126,34 @@ CodePage=1252 @@ -126,23 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Coletor de Informações de Patrimônio do Sistema CACIC 128 FileDescription=Coletor de Informações de Patrimônio do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_PATR 134 ProductName=Col_PATR
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na Licença GPL(General Public License) 136 Comments=Baseado na Licença GPL(General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1  
139 -Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes 138 +Count=2
  139 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=4 145 +Count=10
145 Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 146 Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\mitec;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\mitec 147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_patr/col_patr.dpr
@@ -19,14 +19,42 @@ program col_patr; @@ -19,14 +19,42 @@ program col_patr;
19 19
20 uses 20 uses
21 Forms, 21 Forms,
  22 + Windows,
22 main_col_patr in 'main_col_patr.pas' {FormPatrimonio}, 23 main_col_patr in 'main_col_patr.pas' {FormPatrimonio},
23 - LibXmlParser in 'LibXmlParser.pas',  
24 - XML in 'xml.pas'; 24 + LibXmlParser,
  25 + XML,
  26 + CACIC_Library in '..\CACIC_Library.pas';
25 27
26 {$R *.res} 28 {$R *.res}
27 29
  30 +const
  31 + CACIC_APP_NAME = 'col_patr';
  32 +
  33 +var
  34 + hwind:HWND;
  35 + oCacic : TCACIC;
  36 +
28 begin 37 begin
29 - Application.Initialize;  
30 - Application.CreateForm(TFormPatrimonio, FormPatrimonio);  
31 - Application.Run; 38 + oCacic := TCACIC.Create();
  39 +
  40 + if( oCacic.isAppRunning( CACIC_APP_NAME ) )
  41 + then begin
  42 + hwind := 0;
  43 + repeat // The string 'My app' must match your App Title (below)
  44 + hwind:=Windows.FindWindowEx(0,hwind,'TApplication', CACIC_APP_NAME );
  45 + until (hwind<>Application.Handle);
  46 + IF (hwind<>0) then
  47 + begin
  48 + Windows.ShowWindow(hwind,SW_SHOWNORMAL);
  49 + Windows.SetForegroundWindow(hwind);
  50 + end;
  51 + end
  52 + else begin
  53 + Application.Initialize;
  54 + Application.CreateForm(TFormPatrimonio, FormPatrimonio);
  55 + Application.Run;
  56 + end;
  57 +
  58 + oCacic.Free();
  59 +
32 end. 60 end.
col_patr/col_patr.res
No preview for this file type
col_patr/main_col_patr.pas
@@ -678,14 +678,6 @@ begin @@ -678,14 +678,6 @@ begin
678 var_te_info_patrimonio6 := GetValorDatMemoria('Patrimonio.te_info_patrimonio6',v_tstrCipherOpened); 678 var_te_info_patrimonio6 := GetValorDatMemoria('Patrimonio.te_info_patrimonio6',v_tstrCipherOpened);
679 if (var_te_info_patrimonio6='') then var_te_info_patrimonio6 := DeCrypt(XML.XML_RetornaValor('TE_INFO6', v_configs)); 679 if (var_te_info_patrimonio6='') then var_te_info_patrimonio6 := DeCrypt(XML.XML_RetornaValor('TE_INFO6', v_configs));
680 680
681 - {  
682 - Try  
683 - id_unid_organizacional_nivel1.ItemIndex := id_unid_organizacional_nivel1.Items.IndexOf(RetornaValorVetorUON1(var_id_unid_organizacional_nivel1));  
684 - id_unid_organizacional_nivel1Change(Nil); // Para filtrar os valores do combo2 de acordo com o valor selecionado no combo1  
685 - id_unid_organizacional_nivel2.ItemIndex := id_unid_organizacional_nivel2.Items.IndexOf(RetornaValorVetorUON2(var_id_unid_organizacional_nivel1, var_id_unid_organizacional_nivel2));  
686 - Except  
687 - end;  
688 - }  
689 Try 681 Try
690 id_unid_organizacional_nivel1.ItemIndex := id_unid_organizacional_nivel1.Items.IndexOf(RetornaValorVetorUON1(var_id_unid_organizacional_nivel1)); 682 id_unid_organizacional_nivel1.ItemIndex := id_unid_organizacional_nivel1.Items.IndexOf(RetornaValorVetorUON1(var_id_unid_organizacional_nivel1));
691 id_unid_organizacional_nivel1Change(Nil); // Para filtrar os valores do combo2 de acordo com o valor selecionado no combo1 683 id_unid_organizacional_nivel1Change(Nil); // Para filtrar os valores do combo2 de acordo com o valor selecionado no combo1
@@ -725,52 +717,6 @@ var Parser : TXmlParser; @@ -725,52 +717,6 @@ var Parser : TXmlParser;
725 strTagName, 717 strTagName,
726 strItemName : string; 718 strItemName : string;
727 begin 719 begin
728 -{  
729 - Parser := TXmlParser.Create;  
730 - Parser.Normalize := True;  
731 - Parser.LoadFromBuffer(PAnsiChar(v_configs));  
732 - Parser.StartScan;  
733 - i := -1;  
734 - v_Tag := false;  
735 - While Parser.Scan and (UpperCase(Parser.CurName) <> 'IT2') DO  
736 - Begin  
737 - if ((Parser.CurPartType = ptStartTag) and (UpperCase(Parser.CurName) = 'IT1')) Then  
738 - Begin  
739 - v_Tag := true;  
740 - i := i + 1;  
741 - SetLength(VetorUON1, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos.  
742 - end  
743 - else if (Parser.CurPartType in [ptContent, ptCData]) and v_Tag Then  
744 - if (UpperCase(Parser.CurName) = 'ID1') then VetorUON1[i].id1 := DeCrypt(Parser.CurContent)  
745 - else if (UpperCase(Parser.CurName) = 'NM1') then VetorUON1[i].nm1 := DeCrypt(Parser.CurContent);  
746 - end;  
747 -  
748 - // Código para montar o combo 2  
749 - Parser.StartScan;  
750 -  
751 - v_Tag := false;  
752 - i := -1;  
753 - While Parser.Scan DO  
754 - Begin  
755 - if ((Parser.CurPartType = ptStartTag) and (UpperCase(Parser.CurName) = 'IT2')) Then  
756 - Begin  
757 - v_Tag := TRUE;  
758 - i := i + 1;  
759 - SetLength(VetorUON2, i + 1); // Aumento o tamanho da matriz dinamicamente de acordo com o número de itens recebidos.  
760 - end  
761 - else if (Parser.CurPartType in [ptContent, ptCData]) and v_Tag Then  
762 - if (UpperCase(Parser.CurName) = 'ID1') then VetorUON2[i].id1 := DeCrypt(Parser.CurContent)  
763 - else if (UpperCase(Parser.CurName) = 'ID2') then VetorUON2[i].id2 := DeCrypt(Parser.CurContent)  
764 - else if (UpperCase(Parser.CurName) = 'NM2') then VetorUON2[i].nm2 := DeCrypt(Parser.CurContent);  
765 - end;  
766 - Parser.Free;  
767 - // Como os itens do combo1 nunca mudam durante a execução do programa (ao contrario do combo2), posso colocar o seu preenchimento aqui mesmo.  
768 - id_unid_organizacional_nivel1.Items.Clear;  
769 - For i := 0 to Length(VetorUON1) - 1 Do  
770 - id_unid_organizacional_nivel1.Items.Add(VetorUON1[i].nm1);  
771 - }  
772 -  
773 -  
774 Parser := TXmlParser.Create; 720 Parser := TXmlParser.Create;
775 Parser.Normalize := True; 721 Parser.Normalize := True;
776 Parser.LoadFromBuffer(PAnsiChar(v_Configs)); 722 Parser.LoadFromBuffer(PAnsiChar(v_Configs));
@@ -908,23 +854,6 @@ var i, j: Word; @@ -908,23 +854,6 @@ var i, j: Word;
908 strAux, 854 strAux,
909 strIdUON1 : String; 855 strIdUON1 : String;
910 begin 856 begin
911 - {  
912 - // Filtro os itens do combo2, de acordo com o item selecionado no combo1  
913 - strAux := VetorUON1[id_unid_organizacional_nivel1.ItemIndex].id1;  
914 -  
915 - id_unid_organizacional_nivel2.Items.Clear;  
916 - SetLength(VetorUON2Filtrado, 0);  
917 - For i := 0 to Length(VetorUON2) - 1 Do  
918 - Begin  
919 - if VetorUON2[i].id1 = strAux then  
920 - Begin  
921 - id_unid_organizacional_nivel2.Items.Add(VetorUON2[i].nm2);  
922 - j := Length(VetorUON2Filtrado);  
923 - SetLength(VetorUON2Filtrado, j + 1);  
924 - VetorUON2Filtrado[j] := VetorUON2[i].id2;  
925 - end;  
926 - end;  
927 - }  
928 // Filtro os itens do combo2, de acordo com o item selecionado no combo1 857 // Filtro os itens do combo2, de acordo com o item selecionado no combo1
929 strIdUON1 := VetorUON1[id_unid_organizacional_nivel1.ItemIndex].id1; 858 strIdUON1 := VetorUON1[id_unid_organizacional_nivel1.ItemIndex].id1;
930 id_unid_organizacional_nivel1a.Items.Clear; 859 id_unid_organizacional_nivel1a.Items.Clear;
@@ -998,17 +927,6 @@ var strIdUON1, @@ -998,17 +927,6 @@ var strIdUON1,
998 strRetorno : String; 927 strRetorno : String;
999 tstrAux : TStrings; 928 tstrAux : TStrings;
1000 begin 929 begin
1001 -  
1002 - //Verifico se houve qualquer alteração nas informações.  
1003 - // Só vou enviar as novas informações para o bd ou gravar no registro se houve alterações.  
1004 - {  
1005 - Try  
1006 - strAux1 := VetorUON1[id_unid_organizacional_nivel1.ItemIndex].id1;  
1007 - strAux2 := VetorUON2Filtrado[id_unid_organizacional_nivel2.ItemIndex];  
1008 - Except  
1009 - end;  
1010 - }  
1011 -  
1012 tstrAux := TStrings.Create; 930 tstrAux := TStrings.Create;
1013 tstrAux := explode(VetorUON2Filtrado[id_unid_organizacional_nivel2.ItemIndex],'#'); 931 tstrAux := explode(VetorUON2Filtrado[id_unid_organizacional_nivel2.ItemIndex],'#');
1014 Try 932 Try
@@ -1141,8 +1059,8 @@ end; @@ -1141,8 +1059,8 @@ end;
1141 1059
1142 procedure TFormPatrimonio.FormClose(Sender: TObject; var Action: TCloseAction); 1060 procedure TFormPatrimonio.FormClose(Sender: TObject; var Action: TCloseAction);
1143 begin 1061 begin
1144 - SetValorDatMemoria('Col_Patr.nada', 'nada', v_tstrCipherOpened1);  
1145 - CipherClose(p_path_cacic + 'temp\col_patr.dat', v_tstrCipherOpened1); 1062 + //SetValorDatMemoria('Col_Patr.nada', 'nada', v_tstrCipherOpened1);
  1063 + //CipherClose(p_path_cacic + 'temp\col_patr.dat', v_tstrCipherOpened1);
1146 Application.Terminate; 1064 Application.Terminate;
1147 end; 1065 end;
1148 // Função adaptada de http://www.latiumsoftware.com/en/delphi/00004.php 1066 // Função adaptada de http://www.latiumsoftware.com/en/delphi/00004.php
@@ -1194,8 +1112,6 @@ Function TFormPatrimonio.RemoveCaracteresEspeciais(Texto, p_Fill : String; p_sta @@ -1194,8 +1112,6 @@ Function TFormPatrimonio.RemoveCaracteresEspeciais(Texto, p_Fill : String; p_sta
1194 var I : Integer; 1112 var I : Integer;
1195 strAux : String; 1113 strAux : String;
1196 Begin 1114 Begin
1197 -// if ord(Texto[I]) in [32..126] Then  
1198 -// else strAux := strAux + ' '; // Coloca um espaço onde houver caracteres especiais  
1199 strAux := ''; 1115 strAux := '';
1200 if (Length(trim(Texto))>0) then 1116 if (Length(trim(Texto))>0) then
1201 For I := 0 To Length(Texto) Do 1117 For I := 0 To Length(Texto) Do
col_soft/col_soft.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
col_soft/col_soft.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,25 +126,34 @@ CodePage=1252 @@ -126,25 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Coletor de Informações de Softwares Básicos do Sistema CACIC 128 FileDescription=Coletor de Informações de Softwares Básicos do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_SOFT 134 ProductName=Col_SOFT
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=6  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes;C:\Arquivos de programas\Borland\Delphi7\Mitec\9.60  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\mitec;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
150 -Item5=C:\Arquivos de programas\Borland\Delphi7\mitec 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_soft/col_soft.dpr
@@ -32,7 +32,8 @@ uses @@ -32,7 +32,8 @@ uses
32 MSI_XML_Reports, 32 MSI_XML_Reports,
33 DCPcrypt2, 33 DCPcrypt2,
34 DCPrijndael, 34 DCPrijndael,
35 - DCPbase64; 35 + DCPbase64,
  36 + CACIC_Library in '..\CACIC_Library.pas';
36 37
37 var p_path_cacic, 38 var p_path_cacic,
38 v_CipherKey, 39 v_CipherKey,
@@ -769,13 +770,19 @@ begin @@ -769,13 +770,19 @@ begin
769 End; 770 End;
770 end; 771 end;
771 772
  773 +const
  774 + CACIC_APP_NAME = 'col_soft';
772 775
773 -  
774 -  
775 -var tstrTripa1 : TStrings; 776 +var
  777 + tstrTripa1 : TStrings;
776 intAux : integer; 778 intAux : integer;
  779 + oCacic : TCACIC;
  780 +
777 begin 781 begin
778 - if (ParamCount>0) then 782 + oCacic := TCACIC.Create();
  783 +
  784 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  785 + if (ParamCount>0) then
779 Begin 786 Begin
780 For intAux := 1 to ParamCount do 787 For intAux := 1 to ParamCount do
781 Begin 788 Begin
@@ -820,7 +827,9 @@ begin @@ -820,7 +827,9 @@ begin
820 SetValorDatMemoria('Col_Soft.nada', 'nada', v_tstrCipherOpened1); 827 SetValorDatMemoria('Col_Soft.nada', 'nada', v_tstrCipherOpened1);
821 CipherClose(p_path_cacic + 'temp\col_soft.dat', v_tstrCipherOpened1); 828 CipherClose(p_path_cacic + 'temp\col_soft.dat', v_tstrCipherOpened1);
822 End; 829 End;
823 - Halt(0);  
824 End; 830 End;
825 End; 831 End;
  832 +
  833 + oCacic.Free();
  834 +
826 end. 835 end.
col_soft/col_soft.res
No preview for this file type
col_undi/col_undi.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
col_undi/col_undi.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Coletor de Informações de Unidades de Disco do Sistema CACIC 128 FileDescription=Coletor de Informações de Unidades de Disco do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Col_UNDI 134 ProductName=Col_UNDI
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=5  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\9.60;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\mitec;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\mitec 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
col_undi/col_undi.dpr
@@ -31,7 +31,8 @@ uses @@ -31,7 +31,8 @@ uses
31 MSI_XML_Reports, 31 MSI_XML_Reports,
32 DCPcrypt2, 32 DCPcrypt2,
33 DCPrijndael, 33 DCPrijndael,
34 - DCPbase64; 34 + DCPbase64,
  35 + CACIC_Library in '..\CACIC_Library.pas';
35 36
36 var p_path_cacic, 37 var p_path_cacic,
37 v_CipherKey, 38 v_CipherKey,
@@ -590,10 +591,19 @@ Begin @@ -590,10 +591,19 @@ Begin
590 End; 591 End;
591 end; 592 end;
592 593
593 -var tstrTripa1 : TStrings; 594 +const
  595 + CACIC_APP_NAME = 'col_undi';
  596 +
  597 +var
  598 + tstrTripa1 : TStrings;
594 intAux : integer; 599 intAux : integer;
  600 + oCacic : TCACIC;
  601 +
595 begin 602 begin
596 - if (ParamCount>0) then 603 + oCacic := TCACIC.Create();
  604 +
  605 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  606 + if (ParamCount>0) then
597 Begin 607 Begin
598 For intAux := 1 to ParamCount do 608 For intAux := 1 to ParamCount do
599 Begin 609 Begin
@@ -637,7 +647,9 @@ begin @@ -637,7 +647,9 @@ begin
637 SetValorDatMemoria('Col_Undi.nada', 'nada', v_tstrCipherOpened1); 647 SetValorDatMemoria('Col_Undi.nada', 'nada', v_tstrCipherOpened1);
638 CipherClose(p_path_cacic + 'temp\col_undi.dat', v_tstrCipherOpened1); 648 CipherClose(p_path_cacic + 'temp\col_undi.dat', v_tstrCipherOpened1);
639 End; 649 End;
640 - Halt(0);  
641 End; 650 End;
642 End; 651 End;
  652 +
  653 + oCacic.Free();
  654 +
643 end. 655 end.
col_undi/col_undi.res
No preview for this file type
ger_cols/cacic2.log
@@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
1 -03/11 09:39:39 : ======================> Iniciando o Log <=======================  
2 -03/11 09:39:39 : [Gerente de Coletas] Fui chamado com total de 0 parâmetro(s).  
ger_cols/ger_cols.cfg
@@ -33,3 +33,6 @@ @@ -33,3 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
  36 +-w-UNSAFE_TYPE
  37 +-w-UNSAFE_CODE
  38 +-w-UNSAFE_CAST
ger_cols/ger_cols.dof
@@ -76,9 +76,9 @@ LocaleToUnicode=1 @@ -76,9 +76,9 @@ LocaleToUnicode=1
76 ImagebaseMultiple=1 76 ImagebaseMultiple=1
77 SuspiciousTypecast=1 77 SuspiciousTypecast=1
78 PrivatePropAccessor=1 78 PrivatePropAccessor=1
79 -UnsafeType=1  
80 -UnsafeCode=1  
81 -UnsafeCast=1 79 +UnsafeType=0
  80 +UnsafeCode=0
  81 +UnsafeCast=0
82 [Linker] 82 [Linker]
83 MapFile=0 83 MapFile=0
84 OutputObjs=0 84 OutputObjs=0
@@ -113,9 +113,9 @@ RootDir= @@ -113,9 +113,9 @@ RootDir=
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,11 +126,34 @@ CodePage=1252 @@ -126,11 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Módulo Gerente de Coletas do Sistema CACIC 128 FileDescription=Módulo Gerente de Coletas do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Ger_COLS 134 ProductName=Ger_COLS
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
  137 +[HistoryLists\hlDebugSourcePath]
  138 +Count=2
  139 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  141 +[HistoryLists\hlUnitAliases]
  142 +Count=1
  143 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
  144 +[HistoryLists\hlSearchPath]
  145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
ger_cols/ger_cols.dpr
@@ -34,6 +34,7 @@ uses @@ -34,6 +34,7 @@ uses
34 IdBaseComponent, 34 IdBaseComponent,
35 IdComponent, 35 IdComponent,
36 PJVersionInfo, 36 PJVersionInfo,
  37 + MSI_Machine,
37 MSI_NETWORK, 38 MSI_NETWORK,
38 MSI_XML_Reports, 39 MSI_XML_Reports,
39 StrUtils, 40 StrUtils,
@@ -46,7 +47,8 @@ uses @@ -46,7 +47,8 @@ uses
46 DCPcrypt2, 47 DCPcrypt2,
47 DCPrijndael, 48 DCPrijndael,
48 DCPbase64, 49 DCPbase64,
49 - ZLibEx; 50 + ZLibEx,
  51 + CACIC_Library in '..\CACIC_Library.pas';
50 52
51 {$APPTYPE CONSOLE} 53 {$APPTYPE CONSOLE}
52 var p_path_cacic, 54 var p_path_cacic,
@@ -86,6 +88,8 @@ var v_Debugs, @@ -86,6 +88,8 @@ var v_Debugs,
86 var BatchFile, 88 var BatchFile,
87 Request_Ger_Cols : TStringList; 89 Request_Ger_Cols : TStringList;
88 90
  91 +var
  92 + g_oCacic: TCACIC;
89 93
90 // Some constants that are dependant on the cipher being used 94 // Some constants that are dependant on the cipher being used
91 // Assuming MCRYPT_RIJNDAEL_128 (i.e., 128bit blocksize, 256bit keysize) 95 // Assuming MCRYPT_RIJNDAEL_128 (i.e., 128bit blocksize, 256bit keysize)
@@ -224,8 +228,6 @@ end; {DeCompress} @@ -224,8 +228,6 @@ end; {DeCompress}
224 Function RemoveCaracteresEspeciais(Texto, p_Fill : String; p_start, p_end:integer) : String; 228 Function RemoveCaracteresEspeciais(Texto, p_Fill : String; p_start, p_end:integer) : String;
225 var I : Integer; 229 var I : Integer;
226 Begin 230 Begin
227 -// if ord(Texto[I]) in [32..126] Then  
228 -// else strAux := strAux + ' '; // Coloca um espaço onde houver caracteres especiais  
229 strAux := ''; 231 strAux := '';
230 if (Length(trim(Texto))>0) then 232 if (Length(trim(Texto))>0) then
231 For I := 0 To Length(Texto) Do 233 For I := 0 To Length(Texto) Do
@@ -376,10 +378,6 @@ begin @@ -376,10 +378,6 @@ begin
376 l_IV := PadWithZeros(v_IV,BlockSize); 378 l_IV := PadWithZeros(v_IV,BlockSize);
377 l_Data := PadWithZeros(trim(p_Data),BlockSize); 379 l_Data := PadWithZeros(trim(p_Data),BlockSize);
378 380
379 - //log_DEBUG('Encrypt - HEXA da CHAVE "'+v_CipherKey+'": "'+StringtoHex(l_Key)+'"');  
380 - //log_DEBUG('Encrypt - HEXA do IV "'+v_IV+'": "'+StringtoHex(l_IV)+'"');  
381 - //log_DEBUG('Encrypt - HEXA do DADO "'+trim(p_Data)+'": "'+StringtoHex(l_Data)+'"');  
382 -  
383 // Create the cipher and initialise according to the key length 381 // Create the cipher and initialise according to the key length
384 l_Cipher := TDCP_rijndael.Create(nil); 382 l_Cipher := TDCP_rijndael.Create(nil);
385 if Length(v_CipherKey) <= 16 then 383 if Length(v_CipherKey) <= 16 then
@@ -431,10 +429,6 @@ begin @@ -431,10 +429,6 @@ begin
431 // Decode the Base64 encoded string 429 // Decode the Base64 encoded string
432 l_Data := Base64DecodeStr(trim(v_Data)); 430 l_Data := Base64DecodeStr(trim(v_Data));
433 431
434 - //log_DEBUG('Decrypt - HEXA da CHAVE "'+v_CipherKey+'": "'+StringtoHex(l_Key)+'"');  
435 - //log_DEBUG('Decrypt - HEXA do IV "'+v_IV+'": "'+StringtoHex(l_IV)+'"');  
436 - //log_DEBUG('Decrypt - HEXA do DADO "'+trim(p_Data)+'": "'+StringtoHex(l_Data)+'"');  
437 -  
438 // Create the cipher and initialise according to the key length 432 // Create the cipher and initialise according to the key length
439 l_Cipher := TDCP_rijndael.Create(nil); 433 l_Cipher := TDCP_rijndael.Create(nil);
440 if Length(v_CipherKey) <= 16 then 434 if Length(v_CipherKey) <= 16 then
@@ -569,12 +563,6 @@ var v_strCipherOpenImploded, @@ -569,12 +563,6 @@ var v_strCipherOpenImploded,
569 v_cs_cipher : boolean; 563 v_cs_cipher : boolean;
570 begin 564 begin
571 try 565 try
572 - {  
573 - log_DEBUG('Valores MemoryDAT salvos e arquivo "'+p_DatFileName+ '" devidamente fechado!');  
574 - if v_Debugs then  
575 - for intAux := 0 to (p_tstrCipherOpened.Count-1) do  
576 - log_DEBUG('Posição ['+inttostr(intAux)+']='+p_tstrCipherOpened[intAux]);  
577 - }  
578 FileSetAttr (p_DatFileName,0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000 566 FileSetAttr (p_DatFileName,0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000
579 AssignFile(v_DatFile,p_DatFileName); {Associa o arquivo a uma variável do tipo TextFile} 567 AssignFile(v_DatFile,p_DatFileName); {Associa o arquivo a uma variável do tipo TextFile}
580 568
@@ -656,13 +644,6 @@ begin @@ -656,13 +644,6 @@ begin
656 if Result.Count mod 2 = 0 then 644 if Result.Count mod 2 = 0 then
657 Result.Add(''); 645 Result.Add('');
658 646
659 - {  
660 - log_DEBUG(v_DatFileName+' aberto com sucesso!');  
661 - if v_Debugs then  
662 - for intLoop := 0 to (Result.Count-1) do  
663 - log_DEBUG('Posição ['+inttostr(intLoop)+'] do MemoryDAT: '+Result[intLoop]);  
664 - }  
665 -  
666 end; 647 end;
667 648
668 procedure Apaga_Temps; 649 procedure Apaga_Temps;
@@ -1255,13 +1236,12 @@ Begin @@ -1255,13 +1236,12 @@ Begin
1255 if (strAux = '') then 1236 if (strAux = '') then
1256 strAux := 'A.B.C.D'; // Apenas para forçar que o Gerente extraia via _SERVER[REMOTE_ADDR] 1237 strAux := 'A.B.C.D'; // Apenas para forçar que o Gerente extraia via _SERVER[REMOTE_ADDR]
1257 1238
1258 - // Tratamentos de valores para tráfego POST:  
1259 - // v_te_so => transformar ' ' em <ESPACE> Razão: o mmcrypt se perde quando encontra ' ' (espaço)  
1260 - v_te_so := StringReplace(v_te_so,' ','<ESPACE>',[rfReplaceAll]);  
1261 -  
1262 v_AuxRequest.Values['te_node_address'] := StringReplace(EnCrypt(GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1239 v_AuxRequest.Values['te_node_address'] := StringReplace(EnCrypt(GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1263 v_AuxRequest.Values['id_so'] := StringReplace(EnCrypt(IntToStr(intAux) ,l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1240 v_AuxRequest.Values['id_so'] := StringReplace(EnCrypt(IntToStr(intAux) ,l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1264 - v_AuxRequest.Values['te_so'] := StringReplace(EnCrypt(v_te_so ,l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1241 + // Tratamentos de valores para tráfego POST:
  1242 + // v_te_so => transformar ' ' em <ESPACE> Razão: o mmcrypt se perde quando encontra ' ' (espaço)
  1243 + //v_te_so := StringReplace(v_te_so,' ','<ESPACE>',[rfReplaceAll]);
  1244 + v_AuxRequest.Values['te_so'] := StringReplace(EnCrypt(StringReplace(v_te_so,' ','<ESPACE>',[rfReplaceAll]) ,l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1265 v_AuxRequest.Values['te_ip'] := StringReplace(EnCrypt(strAux ,l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1245 v_AuxRequest.Values['te_ip'] := StringReplace(EnCrypt(strAux ,l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1266 v_AuxRequest.Values['id_ip_rede'] := StringReplace(EnCrypt(GetValorDatMemoria('TcpIp.ID_IP_REDE' , v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1246 v_AuxRequest.Values['id_ip_rede'] := StringReplace(EnCrypt(GetValorDatMemoria('TcpIp.ID_IP_REDE' , v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1267 v_AuxRequest.Values['te_workgroup'] := StringReplace(EnCrypt(GetValorDatMemoria('TcpIp.TE_WORKGROUP' , v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1247 v_AuxRequest.Values['te_workgroup'] := StringReplace(EnCrypt(GetValorDatMemoria('TcpIp.TE_WORKGROUP' , v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
@@ -1852,6 +1832,8 @@ var Request_SVG, v_array_campos, v_array_valores, v_Report : TStringList; @@ -1852,6 +1832,8 @@ var Request_SVG, v_array_campos, v_array_valores, v_Report : TStringList;
1852 v_mac_address,v_metodo_obtencao,v_nome_arquivo,IpConfigLINHA, v_enderecos_mac_invalidos, v_win_dir, v_dir_command, v_dir_ipcfg, v_win_dir_command, v_win_dir_ipcfg, v_te_serv_cacic : string; 1832 v_mac_address,v_metodo_obtencao,v_nome_arquivo,IpConfigLINHA, v_enderecos_mac_invalidos, v_win_dir, v_dir_command, v_dir_ipcfg, v_win_dir_command, v_win_dir_ipcfg, v_te_serv_cacic : string;
1853 tstrTripa1, tstrTripa2, tstrTripa3, tstrTripa4, tstrTripa5, tstrEXCECOES : TStrings; 1833 tstrTripa1, tstrTripa2, tstrTripa3, tstrTripa4, tstrTripa5, tstrEXCECOES : TStrings;
1854 IpConfigTXT, chksis_ini : textfile; 1834 IpConfigTXT, chksis_ini : textfile;
  1835 +
  1836 + v_oMachine : TMiTec_Machine;
1855 v_TCPIP : TMiTeC_TCPIP; 1837 v_TCPIP : TMiTeC_TCPIP;
1856 v_NETWORK : TMiTeC_Network; 1838 v_NETWORK : TMiTeC_Network;
1857 Begin 1839 Begin
@@ -1859,6 +1841,10 @@ Begin @@ -1859,6 +1841,10 @@ Begin
1859 ChecaCipher; 1841 ChecaCipher;
1860 ChecaCompress; 1842 ChecaCompress;
1861 1843
  1844 + v_acao_gercols := 'Instanciando TMiTeC_Machine...';
  1845 + v_oMachine := TMiTec_Machine.Create(nil);
  1846 + v_oMachine.RefreshData();
  1847 +
1862 v_acao_gercols := 'Instanciando TMiTeC_TcpIp...'; 1848 v_acao_gercols := 'Instanciando TMiTeC_TcpIp...';
1863 v_TCPIP := TMiTeC_tcpip.Create(nil); 1849 v_TCPIP := TMiTeC_tcpip.Create(nil);
1864 v_tcpip.RefreshData; 1850 v_tcpip.RefreshData;
@@ -1869,7 +1855,6 @@ Begin @@ -1869,7 +1855,6 @@ Begin
1869 Begin 1855 Begin
1870 log_DEBUG('Montando ambiente para busca de configurações...'); 1856 log_DEBUG('Montando ambiente para busca de configurações...');
1871 v_Report := TStringList.Create; 1857 v_Report := TStringList.Create;
1872 - //v_tcpip.Report(v_Report,false);  
1873 MSI_XML_Reports.TCPIP_XML_Report(v_TCPIP,true,v_Report); 1858 MSI_XML_Reports.TCPIP_XML_Report(v_TCPIP,true,v_Report);
1874 for intAux1:=0 to v_Report.count-1 do 1859 for intAux1:=0 to v_Report.count-1 do
1875 Grava_Debugs(v_report[intAux1]); 1860 Grava_Debugs(v_report[intAux1]);
@@ -1889,7 +1874,7 @@ Begin @@ -1889,7 +1874,7 @@ Begin
1889 Try v_mac_address := v_tcpip.Adapter[v_index_ethernet].Address except v_mac_address := ''; end; 1874 Try v_mac_address := v_tcpip.Adapter[v_index_ethernet].Address except v_mac_address := ''; end;
1890 Try te_mascara := v_tcpip.Adapter[v_index_ethernet].IPAddressMask[0] except te_mascara := ''; end; 1875 Try te_mascara := v_tcpip.Adapter[v_index_ethernet].IPAddressMask[0] except te_mascara := ''; end;
1891 Try te_ip := v_tcpip.Adapter[v_index_ethernet].IPAddress[0] except te_ip := ''; end; 1876 Try te_ip := v_tcpip.Adapter[v_index_ethernet].IPAddress[0] except te_ip := ''; end;
1892 - Try te_nome_host := v_tcpip.HostName except te_nome_host := ''; end; 1877 + Try te_nome_host := v_oMachine.MachineName except te_nome_host := ''; end;
1893 1878
1894 if (v_mac_address='') or (te_ip='') then 1879 if (v_mac_address='') or (te_ip='') then
1895 Begin 1880 Begin
@@ -1904,7 +1889,6 @@ Begin @@ -1904,7 +1889,6 @@ Begin
1904 if (v_Debugs) then 1889 if (v_Debugs) then
1905 Begin 1890 Begin
1906 v_acao_gercols := 'Gerando Report para TMiTeC_Network...'; 1891 v_acao_gercols := 'Gerando Report para TMiTeC_Network...';
1907 - //v_NETWORK.Report(v_Report,false);  
1908 MSI_XML_Reports.Network_XML_Report(v_NETWORK,true,v_Report); 1892 MSI_XML_Reports.Network_XML_Report(v_NETWORK,true,v_Report);
1909 1893
1910 for intAux1:=0 to v_Report.count-1 do 1894 for intAux1:=0 to v_Report.count-1 do
@@ -1917,18 +1901,13 @@ Begin @@ -1917,18 +1901,13 @@ Begin
1917 1901
1918 v_mac_address := parse('TNetwork','MACAdresses','MACAddress[0]',v_Report); 1902 v_mac_address := parse('TNetwork','MACAdresses','MACAddress[0]',v_Report);
1919 te_ip := parse('TNetwork','IPAddresses','IPAddress[0]',v_Report); 1903 te_ip := parse('TNetwork','IPAddresses','IPAddress[0]',v_Report);
  1904 +
1920 v_Report.Free; 1905 v_Report.Free;
1921 End; 1906 End;
1922 1907
1923 // Verifico comunicação com o Módulo Gerente WEB. 1908 // Verifico comunicação com o Módulo Gerente WEB.
1924 Request_SVG := TStringList.Create; 1909 Request_SVG := TStringList.Create;
1925 Request_SVG.Values['in_teste'] := StringReplace(EnCrypt('OK',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1910 Request_SVG.Values['in_teste'] := StringReplace(EnCrypt('OK',l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1926 - //Request_SVG.Values['te_node_address'] := EnCrypt(v_mac_address,l_cs_compress);  
1927 - //Request_SVG.Values['id_so'] := EnCrypt(inttostr(GetWinVer),l_cs_compress);  
1928 - //Request_SVG.Values['te_so'] := EnCrypt(v_te_so,l_cs_compress);  
1929 - //Request_SVG.Values['id_ip_rede'] := EnCrypt(GetIPRede(te_ip, te_mascara),l_cs_compress);  
1930 - //Request_SVG.Values['te_workgroup'] := EnCrypt(GetWorkgroup,l_cs_compress);  
1931 - //Request_SVG.Values['te_nome_computador']:= EnCrypt(te_nome_host,l_cs_compress);  
1932 1911
1933 v_acao_gercols := 'Preparando teste de comunicação com Módulo Gerente WEB.'; 1912 v_acao_gercols := 'Preparando teste de comunicação com Módulo Gerente WEB.';
1934 1913
@@ -1972,13 +1951,6 @@ Begin @@ -1972,13 +1951,6 @@ Begin
1972 // Nova tentativa, preciso reinicializar o objeto devido aos restos da operação anterior... (Eu acho!) :) 1951 // Nova tentativa, preciso reinicializar o objeto devido aos restos da operação anterior... (Eu acho!) :)
1973 Request_SVG.Free; 1952 Request_SVG.Free;
1974 Request_SVG := TStringList.Create; 1953 Request_SVG := TStringList.Create;
1975 - //Request_SVG.Values['te_node_address'] := EnCrypt(v_mac_address,l_cs_compress);  
1976 - //Request_SVG.Values['id_so'] := EnCrypt(inttostr(GetWinVer),l_cs_compress);  
1977 - //Request_SVG.Values['te_so'] := EnCrypt(v_te_so,l_cs_compress);  
1978 - //Request_SVG.Values['id_ip_rede'] := EnCrypt(GetIPRede(te_ip, te_mascara),l_cs_compress);  
1979 - //Request_SVG.Values['te_workgroup'] := EnCrypt(GetWorkgroup,l_cs_compress);  
1980 - //Request_SVG.Values['te_nome_computador']:= EnCrypt(te_nome_host,l_cs_compress);  
1981 - //Request_SVG.Values['te_ip'] := EnCrypt(te_ip,l_cs_compress);  
1982 Request_SVG.Values['in_teste'] := StringReplace(EnCrypt('OK',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 1954 Request_SVG.Values['in_teste'] := StringReplace(EnCrypt('OK',l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
1983 Try 1955 Try
1984 strRetorno := ComunicaServidor('get_config.php', Request_SVG, 'Teste de comunicação com o Módulo Gerente WEB.'); 1956 strRetorno := ComunicaServidor('get_config.php', Request_SVG, 'Teste de comunicação com o Módulo Gerente WEB.');
@@ -2112,10 +2084,10 @@ Begin @@ -2112,10 +2084,10 @@ Begin
2112 if (not p_mensagem_log) then v_mensagem_log := ''; 2084 if (not p_mensagem_log) then v_mensagem_log := '';
2113 2085
2114 // Caso a obtenção dos dados de TCP via MSI_NETWORK/TCP tenha falhado... 2086 // Caso a obtenção dos dados de TCP via MSI_NETWORK/TCP tenha falhado...
2115 - if (v_mac_address='') or (te_mascara='') or (te_ip='') or (te_gateway='') or  
2116 - (te_nome_host='') or (te_serv_dhcp='' ) or (te_dns_primario='') or (te_wins_primario='') or  
2117 - (te_wins_secundario='') then  
2118 - Begin 2087 + // (considerado falha somente se v_mac_address, te_ip ou v_te_so forem nulos
  2088 + // por serem chaves - demais valores devem ser avaliados pelo administrador)
  2089 +
  2090 + if (v_mac_address='') or (te_ip='') then begin
2119 v_nome_arquivo := p_path_cacic + 'Temp\ipconfig.txt'; 2091 v_nome_arquivo := p_path_cacic + 'Temp\ipconfig.txt';
2120 v_metodo_obtencao := 'WMI Object'; 2092 v_metodo_obtencao := 'WMI Object';
2121 v_acao_gercols := 'Criando batch para obtenção de IPCONFIG via WMI...'; 2093 v_acao_gercols := 'Criando batch para obtenção de IPCONFIG via WMI...';
@@ -2160,6 +2132,7 @@ Begin @@ -2160,6 +2132,7 @@ Begin
2160 2132
2161 if ChecaAgente(p_path_cacic + 'modulos', v_scripter) then 2133 if ChecaAgente(p_path_cacic + 'modulos', v_scripter) then
2162 WinExec(PChar(p_path_cacic + 'modulos\' + v_scripter + ' //b ' + p_path_cacic + 'temp\ipconfig.vbs'), SW_HIDE); 2134 WinExec(PChar(p_path_cacic + 'modulos\' + v_scripter + ' //b ' + p_path_cacic + 'temp\ipconfig.vbs'), SW_HIDE);
  2135 +
2163 Except 2136 Except
2164 Begin 2137 Begin
2165 log_diario('Erro na geração do ipconfig.txt pelo ' + v_metodo_obtencao+'.'); 2138 log_diario('Erro na geração do ipconfig.txt pelo ' + v_metodo_obtencao+'.');
@@ -2170,7 +2143,8 @@ Begin @@ -2170,7 +2143,8 @@ Begin
2170 sleep(5000); 2143 sleep(5000);
2171 2144
2172 v_Tamanho_Arquivo := Get_File_Size(p_path_cacic + 'Temp\ipconfig.txt',true); 2145 v_Tamanho_Arquivo := Get_File_Size(p_path_cacic + 'Temp\ipconfig.txt',true);
2173 - if not (FileExists(p_path_cacic + 'Temp\ipconfi1.txt')) or (v_Tamanho_Arquivo='0') then // O arquivo ipconfig.txt foi gerado vazio, tentarei IPConfig ou WinIPcfg! 2146 + // O arquivo ipconfig.txt foi gerado vazio, tentarei IPConfig ou WinIPcfg!
  2147 + if not (FileExists(p_path_cacic + 'Temp\ipconfi1.txt')) or (v_Tamanho_Arquivo='0') then
2174 Begin 2148 Begin
2175 Try 2149 Try
2176 v_win_dir := PegaWinDir(nil); 2150 v_win_dir := PegaWinDir(nil);
@@ -2289,11 +2263,18 @@ Begin @@ -2289,11 +2263,18 @@ Begin
2289 if (te_wins_primario='') then Try te_wins_primario := PegaDadosIPConfig(v_array_campos,v_array_valores,'servidor,wins,prim;wins,server,primary','') Except te_wins_primario := ''; end; 2263 if (te_wins_primario='') then Try te_wins_primario := PegaDadosIPConfig(v_array_campos,v_array_valores,'servidor,wins,prim;wins,server,primary','') Except te_wins_primario := ''; end;
2290 if (te_wins_secundario='') then Try te_wins_secundario := PegaDadosIPConfig(v_array_campos,v_array_valores,'servidor,wins,secund;wins,server,secondary','') Except te_wins_secundario := ''; end; 2264 if (te_wins_secundario='') then Try te_wins_secundario := PegaDadosIPConfig(v_array_campos,v_array_valores,'servidor,wins,secund;wins,server,secondary','') Except te_wins_secundario := ''; end;
2291 2265
2292 - if ((GetWinVer <> 0) and (GetWinVer > 5)) or  
2293 - (abstraiCSD(v_te_so) >= 250) then //Se NT/2K/XP  
2294 - Try te_dominio_windows := PegaDadosIPConfig(v_array_campos,v_array_valores,'usu,rio,logado;usu,rio,logado','') Except te_dominio_windows := 'Não Identificado'; end 2266 + if (g_oCacic.isWindowsNT()) then //Se NT/2K/XP
  2267 + Try
  2268 + te_dominio_windows := PegaDadosIPConfig(v_array_campos,v_array_valores,'usu,rio,logado;usu,rio,logado','')
  2269 + Except
  2270 + te_dominio_windows := 'Não Identificado';
  2271 + end
2295 else 2272 else
2296 - Try te_dominio_windows := GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider\AuthenticatingAgent') + '@' + GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\Network\Logon\username') Except te_dominio_windows := 'Não Identificado'; end 2273 + Try
  2274 + te_dominio_windows := GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider\AuthenticatingAgent') + '@' + GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\Network\Logon\username')
  2275 + Except te_dominio_windows := 'Não Identificado';
  2276 + end;
  2277 +
2297 End // fim do Begin 2278 End // fim do Begin
2298 Else 2279 Else
2299 Begin 2280 Begin
@@ -2352,6 +2333,13 @@ Begin @@ -2352,6 +2333,13 @@ Begin
2352 // O cálculo para obtenção deste parâmetro poderá ser feito pelo módulo Gerente Web através do script get_config.php 2333 // O cálculo para obtenção deste parâmetro poderá ser feito pelo módulo Gerente Web através do script get_config.php
2353 // if (trim(v_mascara)='') then v_mascara := '255.255.255.0'; 2334 // if (trim(v_mascara)='') then v_mascara := '255.255.255.0';
2354 2335
  2336 + if(te_ip<>'') then
  2337 + try
  2338 + SetValorDatMemoria('TcpIp.TE_IP',te_ip, v_tstrCipherOpened);
  2339 + except
  2340 + log_diario('Erro setando TE_IP.');
  2341 + end;
  2342 +
2355 try 2343 try
2356 if (trim(GetIPRede(te_ip, te_mascara))<>'') then 2344 if (trim(GetIPRede(te_ip, te_mascara))<>'') then
2357 SetValorDatMemoria('TcpIp.ID_IP_REDE',GetIPRede(te_ip, te_mascara), v_tstrCipherOpened); 2345 SetValorDatMemoria('TcpIp.ID_IP_REDE',GetIPRede(te_ip, te_mascara), v_tstrCipherOpened);
@@ -2359,19 +2347,16 @@ Begin @@ -2359,19 +2347,16 @@ Begin
2359 log_diario('Erro setando IP_REDE.'); 2347 log_diario('Erro setando IP_REDE.');
2360 end; 2348 end;
2361 2349
  2350 + if( (v_te_so<>'') and (v_mac_address<>'') and (te_ip<>'') ) // Verifica dados chave para controles
  2351 + then log_diario('Dados de rede usados: SO=' + v_te_so + ' MAC=' + v_mac_address + ' IP=' + te_ip)
  2352 + else log_diario('Erro na obtenção de dados de rede: SO=' + v_te_so + ' MAC=' + v_mac_address + ' IP=' + te_ip);
  2353 +
2362 try 2354 try
2363 SetValorDatMemoria('TcpIp.TE_NODE_ADDRESS',StringReplace(v_mac_address,':','-',[rfReplaceAll]), v_tstrCipherOpened); 2355 SetValorDatMemoria('TcpIp.TE_NODE_ADDRESS',StringReplace(v_mac_address,':','-',[rfReplaceAll]), v_tstrCipherOpened);
2364 except 2356 except
2365 log_diario('Erro setando NODE_ADDRESS.'); 2357 log_diario('Erro setando NODE_ADDRESS.');
2366 end; 2358 end;
2367 2359
2368 - // Esta atribuição foi realizada no teste de comunicação mais acima  
2369 - //Try  
2370 - // SetValorDatMemoria('TcpIp.TE_IP',TE_IP, v_tstrCipherOpened);  
2371 - //except  
2372 - // log_diario('Erro setando IP.');  
2373 - //End;  
2374 -  
2375 Try 2360 Try
2376 SetValorDatMemoria('TcpIp.TE_NOME_HOST',TE_NOME_HOST, v_tstrCipherOpened); 2361 SetValorDatMemoria('TcpIp.TE_NOME_HOST',TE_NOME_HOST, v_tstrCipherOpened);
2377 Except 2362 Except
@@ -2395,13 +2380,6 @@ Begin @@ -2395,13 +2380,6 @@ Begin
2395 // Passei a enviar sempre a versão do CACIC... 2380 // Passei a enviar sempre a versão do CACIC...
2396 // Solicito do servidor a configuração que foi definida pelo administrador do CACIC. 2381 // Solicito do servidor a configuração que foi definida pelo administrador do CACIC.
2397 Request_SVG := TStringList.Create; 2382 Request_SVG := TStringList.Create;
2398 - //Request_SVG.Values['te_node_address'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),l_cs_compress);  
2399 - //Request_SVG.Values['id_so'] := EnCrypt(GetValorDatMemoria('Configs.ID_SO' , v_tstrCipherOpened),l_cs_compress);  
2400 - //Request_SVG.Values['te_so'] := EnCrypt(v_te_so,l_cs_compress);  
2401 - //Request_SVG.Values['id_ip_rede'] := EnCrypt(GetValorDatMemoria('TcpIp.ID_IP_REDE' , v_tstrCipherOpened),l_cs_compress);  
2402 - //Request_SVG.Values['te_nome_computador'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR', v_tstrCipherOpened),l_cs_compress);  
2403 - //Request_SVG.Values['te_ip'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_IP' , v_tstrCipherOpened),l_cs_compress);  
2404 - //Request_SVG.Values['te_workgroup'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_WORKGROUP' , v_tstrCipherOpened),l_cs_compress);  
2405 2383
2406 //Tratamento de Sistemas Monitorados 2384 //Tratamento de Sistemas Monitorados
2407 intAux4 := 1; 2385 intAux4 := 1;
@@ -2425,7 +2403,6 @@ Begin @@ -2425,7 +2403,6 @@ Begin
2425 intAux4 := intAux4 + 1; 2403 intAux4 := intAux4 + 1;
2426 end; //While 2404 end; //While
2427 2405
2428 - // Request_SVG.Values['te_tripa_perfis'] := strTripa;  
2429 // Proposital, para forçar a chegada dos perfis, solução temporária... 2406 // Proposital, para forçar a chegada dos perfis, solução temporária...
2430 Request_SVG.Values['te_tripa_perfis'] := StringReplace(EnCrypt('',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 2407 Request_SVG.Values['te_tripa_perfis'] := StringReplace(EnCrypt('',l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
2431 2408
@@ -2461,13 +2438,6 @@ Begin @@ -2461,13 +2438,6 @@ Begin
2461 // Solicito do servidor a configuração que foi definida pelo administrador do CACIC. 2438 // Solicito do servidor a configuração que foi definida pelo administrador do CACIC.
2462 Request_SVG.Free; 2439 Request_SVG.Free;
2463 Request_SVG := TStringList.Create; 2440 Request_SVG := TStringList.Create;
2464 - //Request_SVG.Values['te_node_address'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),l_cs_compress);  
2465 - //Request_SVG.Values['id_so'] := EnCrypt(GetValorDatMemoria('Configs.ID_SO' , v_tstrCipherOpened),l_cs_compress);  
2466 - //Request_SVG.Values['te_so'] := EnCrypt(v_te_so,l_cs_compress);  
2467 - //Request_SVG.Values['id_ip_rede'] := EnCrypt(GetValorDatMemoria('TcpIp.ID_IP_REDE' , v_tstrCipherOpened),l_cs_compress);  
2468 - //Request_SVG.Values['te_nome_computador'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR', v_tstrCipherOpened),l_cs_compress);  
2469 - //Request_SVG.Values['te_ip'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_IP' , v_tstrCipherOpened),l_cs_compress);  
2470 - //Request_SVG.Values['te_workgroup'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_WORKGROUP' , v_tstrCipherOpened),l_cs_compress);  
2471 Request_SVG.Values['te_tripa_perfis'] := StringReplace(EnCrypt('',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 2441 Request_SVG.Values['te_tripa_perfis'] := StringReplace(EnCrypt('',l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
2472 strRetorno := ComunicaServidor('get_config.php', Request_SVG, v_mensagem_log); 2442 strRetorno := ComunicaServidor('get_config.php', Request_SVG, v_mensagem_log);
2473 Seta_l_cs_cipher(strRetorno); 2443 Seta_l_cs_cipher(strRetorno);
@@ -2575,8 +2545,7 @@ Begin @@ -2575,8 +2545,7 @@ Begin
2575 if (te_dominio_windows = '') then 2545 if (te_dominio_windows = '') then
2576 Begin 2546 Begin
2577 Try 2547 Try
2578 - if ((GetWinVer <> 0) and (GetWinVer > 5)) or  
2579 - (abstraiCSD(v_te_so) >= 250) then //Se NT/2K/XP 2548 + if (g_oCacic.isWindowsNT()) then //Se NT/2K/XP
2580 te_dominio_windows := GetNetworkUserName + '@' + GetDomainName 2549 te_dominio_windows := GetNetworkUserName + '@' + GetDomainName
2581 else 2550 else
2582 te_dominio_windows := GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\Network\Logon\username')+ '@' + GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider\AuthenticatingAgent'); 2551 te_dominio_windows := GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\Network\Logon\username')+ '@' + GetValorChaveRegEdit('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider\AuthenticatingAgent');
@@ -2585,13 +2554,6 @@ Begin @@ -2585,13 +2554,6 @@ Begin
2585 End; 2554 End;
2586 2555
2587 Request_SVG := TStringList.Create; 2556 Request_SVG := TStringList.Create;
2588 - //Request_SVG.Values['te_node_address'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_NODE_ADDRESS' , v_tstrCipherOpened),l_cs_compress);  
2589 - //Request_SVG.Values['id_so'] := EnCrypt(GetValorDatMemoria('Configs.ID_SO' , v_tstrCipherOpened),l_cs_compress);  
2590 - //Request_SVG.Values['te_so'] := EnCrypt(v_te_so,l_cs_compress);  
2591 - //Request_SVG.Values['id_ip_rede'] := EnCrypt(GetValorDatMemoria('TcpIp.ID_IP_REDE' , v_tstrCipherOpened),l_cs_compress);  
2592 - //Request_SVG.Values['te_nome_computador'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_NOME_COMPUTADOR', v_tstrCipherOpened),l_cs_compress);  
2593 - //Request_SVG.Values['te_ip'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_IP' , v_tstrCipherOpened),l_cs_compress);  
2594 - //Request_SVG.Values['te_workgroup'] := EnCrypt(GetValorDatMemoria('TcpIp.TE_WORKGROUP' , v_tstrCipherOpened),l_cs_compress);  
2595 Request_SVG.Values['te_mascara'] := StringReplace(EnCrypt(te_mascara,l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 2557 Request_SVG.Values['te_mascara'] := StringReplace(EnCrypt(te_mascara,l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
2596 Request_SVG.Values['te_gateway'] := StringReplace(EnCrypt(te_gateway,l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 2558 Request_SVG.Values['te_gateway'] := StringReplace(EnCrypt(te_gateway,l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
2597 Request_SVG.Values['te_serv_dhcp'] := StringReplace(EnCrypt(te_serv_dhcp,l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 2559 Request_SVG.Values['te_serv_dhcp'] := StringReplace(EnCrypt(te_serv_dhcp,l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
@@ -2693,8 +2655,7 @@ Begin @@ -2693,8 +2655,7 @@ Begin
2693 Begin 2655 Begin
2694 v_acao_gercols := 'Configurando diretório para o CACIC. (Registry para w95/95OSR2/98/98SE/ME)'; 2656 v_acao_gercols := 'Configurando diretório para o CACIC. (Registry para w95/95OSR2/98/98SE/ME)';
2695 // Identifico a versão do Windows 2657 // Identifico a versão do Windows
2696 - If ((GetWinVer <> 0) and (GetWinVer <= 5)) or  
2697 - (abstraiCSD(v_te_so) < 250) then 2658 + If (g_oCacic.isWindows9xME()) then
2698 begin 2659 begin
2699 //Se for 95/95OSR2/98/98SE/ME faço aqui... (Em NT Like isto é feito no LoginScript) 2660 //Se for 95/95OSR2/98/98SE/ME faço aqui... (Em NT Like isto é feito no LoginScript)
2700 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\cacic2', Trim(Copy(ParamStr(intAux),12,Length((ParamStr(intAux))))) + '\cacic2.exe'); 2661 SetValorChaveRegEdit('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\cacic2', Trim(Copy(ParamStr(intAux),12,Length((ParamStr(intAux))))) + '\cacic2.exe');
@@ -2957,8 +2918,6 @@ Begin @@ -2957,8 +2918,6 @@ Begin
2957 Request_Ger_Cols.Values['in_chkcacic'] := StringReplace(EnCrypt('chkcacic',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); 2918 Request_Ger_Cols.Values['in_chkcacic'] := StringReplace(EnCrypt('chkcacic',l_cs_compress),'+','<MAIS>',[rfReplaceAll]);
2958 Request_Ger_Cols.Values['te_fila_ftp'] := StringReplace(EnCrypt('2',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); // Indicará sucesso na operação de FTP e liberará lugar para o próximo 2919 Request_Ger_Cols.Values['te_fila_ftp'] := StringReplace(EnCrypt('2',l_cs_compress),'+','<MAIS>',[rfReplaceAll]); // Indicará sucesso na operação de FTP e liberará lugar para o próximo
2959 Request_Ger_Cols.Values['id_ftp'] := StringReplace(EnCrypt(GetValorDatMemoria('Configs.ID_FTP',v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]); // Indicará sucesso na operação de FTP e liberará lugar para o próximo 2920 Request_Ger_Cols.Values['id_ftp'] := StringReplace(EnCrypt(GetValorDatMemoria('Configs.ID_FTP',v_tstrCipherOpened),l_cs_compress),'+','<MAIS>',[rfReplaceAll]); // Indicará sucesso na operação de FTP e liberará lugar para o próximo
2960 - //Request_Ger_Cols.Values['te_so'] := EnCrypt(v_te_so,l_cs_compress);  
2961 - //Request_Ger_Cols.Values['id_ip_estacao'] := EnCrypt(GetIP,l_cs_compress); // Informará o IP para registro na tabela redes_grupos_FTP  
2962 ComunicaServidor('get_config.php', Request_Ger_Cols, '>> Liberando Grupo FTP!...'); 2921 ComunicaServidor('get_config.php', Request_Ger_Cols, '>> Liberando Grupo FTP!...');
2963 Request_Ger_Cols.Free; 2922 Request_Ger_Cols.Free;
2964 SetValorDatMemoria('Configs.ID_FTP','', v_tstrCipherOpened) 2923 SetValorDatMemoria('Configs.ID_FTP','', v_tstrCipherOpened)
@@ -3382,83 +3341,93 @@ Begin @@ -3382,83 +3341,93 @@ Begin
3382 3341
3383 End; 3342 End;
3384 3343
  3344 +const
  3345 + CACIC_APP_NAME = 'ger_cols';
  3346 +
3385 begin 3347 begin
3386 - Try  
3387 - // Pegarei o nível anterior do diretório, que deve ser, por exemplo \Cacic, para leitura do cacic2.DAT  
3388 - tstrTripa1 := explode(ExtractFilePath(ParamStr(0)),'\');  
3389 - p_path_cacic := '';  
3390 - For intAux := 0 to tstrTripa1.Count -2 do  
3391 - p_path_cacic := p_path_cacic + tstrTripa1[intAux] + '\';  
3392 -  
3393 - v_Debugs := false;  
3394 - if DirectoryExists(p_path_cacic + 'Temp\Debugs') then  
3395 - Begin  
3396 - if (FormatDateTime('ddmmyyyy', GetFolderDate(p_path_cacic + 'Temp\Debugs')) = FormatDateTime('ddmmyyyy', date)) then  
3397 - Begin  
3398 - v_Debugs := true;  
3399 - log_DEBUG('Pasta "' + p_path_cacic + 'Temp\Debugs" com data '+FormatDateTime('dd-mm-yyyy', GetFolderDate(p_path_cacic + 'Temp\Debugs'))+' encontrada. DEBUG ativado.');  
3400 - End;  
3401 - End; 3348 + g_oCacic := TCACIC.Create();
3402 3349
3403 - For intAux := 1 to ParamCount do  
3404 - if LowerCase(Copy(ParamStr(intAux),1,13)) = '/p_cipherkey=' then  
3405 - Begin  
3406 - v_CipherKey := Trim(Copy(ParamStr(intAux),14,Length((ParamStr(intAux)))));  
3407 - log_DEBUG('Parâmetro para cifragem recebido.');  
3408 - End; 3350 + if( not g_oCacic.isAppRunning( CACIC_APP_NAME ) ) then begin
  3351 + Try
  3352 + // Pegarei o nível anterior do diretório, que deve ser, por exemplo \Cacic, para leitura do cacic2.DAT
  3353 + tstrTripa1 := explode(ExtractFilePath(ParamStr(0)),'\');
  3354 + p_path_cacic := '';
  3355 + For intAux := 0 to tstrTripa1.Count -2 do
  3356 + p_path_cacic := p_path_cacic + tstrTripa1[intAux] + '\';
3409 3357
3410 - // Caso tenha sido invocado por um CACIC2.EXE versão antiga, assumo o valor abaixo...  
3411 - // Solução provisória até a convergência das versões do Agente Principal e do Gerente de Coletas  
3412 - if (trim(v_CipherKey)='') then v_CipherKey := 'CacicBrasil'; 3358 + g_oCacic.setCacicPath(p_path_cacic);
3413 3359
3414 - if (trim(v_CipherKey)<>'') then  
3415 - Begin  
3416 - v_IV := 'abcdefghijklmnop'; 3360 + // Obtem a string de identificação do SO (v_te_so), para uso nas comunicações com o Gerente WEB.
  3361 + v_te_so := g_oCacic.getWindowsStrId();
3417 3362
3418 - // De acordo com a versão do OS, determino o ShellCommand para chamadas externas.  
3419 - p_Shell_Command := 'command.com /c ';  
3420 - if ((GetWinVer <> 0) and (GetWinVer > 5)) or  
3421 - (abstraiCSD(v_te_so) >= 250) then p_Shell_Command := 'cmd.exe /c '; //NT/2K/XP 3363 + v_Debugs := false;
  3364 + if DirectoryExists(p_path_cacic + 'Temp\Debugs') then
  3365 + if (FormatDateTime('ddmmyyyy', GetFolderDate(p_path_cacic + 'Temp\Debugs')) = FormatDateTime('ddmmyyyy', date)) then
  3366 + Begin
  3367 + v_Debugs := true;
  3368 + log_DEBUG('Pasta "' + p_path_cacic + 'Temp\Debugs" com data '+FormatDateTime('dd-mm-yyyy', GetFolderDate(p_path_cacic + 'Temp\Debugs'))+' encontrada. DEBUG ativado.');
  3369 + End;
3422 3370
3423 - if not DirectoryExists(p_path_cacic + 'Temp') then  
3424 - ForceDirectories(p_path_cacic + 'Temp'); 3371 + For intAux := 1 to ParamCount do
  3372 + if LowerCase(Copy(ParamStr(intAux),1,13)) = '/p_cipherkey=' then
  3373 + Begin
  3374 + v_CipherKey := Trim(Copy(ParamStr(intAux),14,Length((ParamStr(intAux)))));
  3375 + log_DEBUG('Parâmetro para cifragem recebido.');
  3376 + End;
3425 3377
3426 - // A chave AES foi obtida no parâmetro p_CipherKey. Recomenda-se que cada empresa altere a sua chave.  
3427 - v_DatFileName := p_path_cacic + 'cacic2.dat';  
3428 - v_tstrCipherOpened := TStrings.Create;  
3429 - v_tstrCipherOpened := CipherOpen(v_DatFileName); 3378 + // Caso tenha sido invocado por um CACIC2.EXE versão antiga, assumo o valor abaixo...
  3379 + // Solução provisória até a convergência das versões do Agente Principal e do Gerente de Coletas
  3380 + if (trim(v_CipherKey)='') then
  3381 + v_CipherKey := 'CacicBrasil';
3430 3382
3431 - // Não tirar desta posição  
3432 - SetValorDatMemoria('Configs.ID_SO',IntToStr(GetWinVer), v_tstrCipherOpened); 3383 + if (trim(v_CipherKey)<>'') then
  3384 + Begin
  3385 + v_IV := 'abcdefghijklmnop';
3433 3386
3434 - v_scripter := 'wscript.exe';  
3435 - // A existência e bloqueio do arquivo abaixo evitará que Cacic2.exe chame o Ger_Cols quando este estiver em funcionamento  
3436 - AssignFile(v_Aguarde,p_path_cacic + 'temp\aguarde_GER.txt'); {Associa o arquivo a uma variável do tipo TextFile}  
3437 - {$IOChecks off}  
3438 - Reset(v_Aguarde); {Abre o arquivo texto}  
3439 - {$IOChecks on}  
3440 - if (IOResult <> 0) then // Arquivo não existe, será recriado.  
3441 - Rewrite (v_Aguarde); 3387 + // De acordo com a versão do OS, determina-se o ShellCommand para chamadas externas.
  3388 + p_Shell_Command := 'cmd.exe /c '; //NT/2K/XP
  3389 + if(g_oCacic.isWindows9xME()) then
  3390 + p_Shell_Command := 'command.com /c ';
3442 3391
3443 - Append(v_Aguarde);  
3444 - Writeln(v_Aguarde,'Apenas um pseudo-cookie para o Cacic2 esperar o término de Ger_Cols');  
3445 - Append(v_Aguarde); 3392 + if not DirectoryExists(p_path_cacic + 'Temp') then
  3393 + ForceDirectories(p_path_cacic + 'Temp');
3446 3394
3447 - ChecaCipher;  
3448 - ChecaCompress; 3395 + // A chave AES foi obtida no parâmetro p_CipherKey. Recomenda-se que cada empresa altere a sua chave.
  3396 + v_DatFileName := p_path_cacic + 'cacic2.dat';
  3397 + v_tstrCipherOpened := TStrings.Create;
  3398 + v_tstrCipherOpened := CipherOpen(v_DatFileName);
3449 3399
3450 - // Provoco a alimentação da variável v_te_so, para uso nas comunicações com o Gerente WEB.  
3451 - GetWinVer; 3400 + // Não tirar desta posição
  3401 + SetValorDatMemoria('Configs.ID_SO',IntToStr(GetWinVer), v_tstrCipherOpened);
3452 3402
3453 - Executa_Ger_Cols;  
3454 - Finalizar(true);  
3455 - End;  
3456 - Except  
3457 - Begin  
3458 - log_diario('PROBLEMAS EM EXECUTA_GER_COLS! Ação: ' + v_acao_gercols+'.');  
3459 - CriaTXT(p_path_cacic,'ger_erro');  
3460 - Finalizar(false);  
3461 - SetValorDatMemoria('Erro_Fatal_Descricao', v_acao_gercols, v_tstrCipherOpened);  
3462 - End;  
3463 - End; 3403 + v_scripter := 'wscript.exe';
  3404 + // A existência e bloqueio do arquivo abaixo evitará que Cacic2.exe chame o Ger_Cols quando este estiver em funcionamento
  3405 + AssignFile(v_Aguarde,p_path_cacic + 'temp\aguarde_GER.txt'); {Associa o arquivo a uma variável do tipo TextFile}
  3406 + {$IOChecks off}
  3407 + Reset(v_Aguarde); {Abre o arquivo texto}
  3408 + {$IOChecks on}
  3409 + if (IOResult <> 0) then // Arquivo não existe, será recriado.
  3410 + Rewrite (v_Aguarde);
  3411 +
  3412 + Append(v_Aguarde);
  3413 + Writeln(v_Aguarde,'Apenas um pseudo-cookie para o Cacic2 esperar o término de Ger_Cols');
  3414 + Append(v_Aguarde);
  3415 +
  3416 + ChecaCipher;
  3417 + ChecaCompress;
  3418 +
  3419 + Executa_Ger_Cols;
  3420 + Finalizar(true);
  3421 + End;
  3422 + Except
  3423 + Begin
  3424 + log_diario('PROBLEMAS EM EXECUTA_GER_COLS! Ação: ' + v_acao_gercols+'.');
  3425 + CriaTXT(p_path_cacic,'ger_erro');
  3426 + Finalizar(false);
  3427 + SetValorDatMemoria('Erro_Fatal_Descricao', v_acao_gercols, v_tstrCipherOpened);
  3428 + End;
  3429 + End;
  3430 + End;
  3431 +
  3432 + g_oCacic.Free();
3464 end. 3433 end.
ger_cols/ger_cols.res
No preview for this file type
ger_cols/utils.pas
@@ -1,118 +0,0 @@ @@ -1,118 +0,0 @@
1 -(**  
2 ----------------------------------------------------------------------------------------------------------------------------------------------------------------  
3 -Copyright 2000, 2001, 2002, 2003, 2004, 2005 Dataprev - Empresa de Tecnologia e Informações da Previdência Social, Brasil  
4 -  
5 -Este arquivo é parte do programa CACIC - Configurador Automático e Coletor de Informações Computacionais  
6 -  
7 -O CACIC é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como  
8 -publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença, ou (na sua opinião) qualquer versão.  
9 -  
10 -Este programa é distribuido na esperança que possa ser util, mas SEM NENHUMA GARANTIA; sem uma garantia implicita de ADEQUAÇÂO a qualquer  
11 -MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes.  
12 -  
13 -Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do Software  
14 -Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA  
15 ----------------------------------------------------------------------------------------------------------------------------------------------------------------  
16 -*)  
17 -  
18 -unit utils;  
19 -  
20 -interface  
21 -  
22 -Uses Classes, SysUtils, Windows, TLHELP32;  
23 -  
24 -Function Explode(Texto, Separador : String) : TStrings;  
25 -Function RemoveCaracteresEspeciais(Texto : String) : String;  
26 -function ProgramaRodando(NomePrograma: String): Boolean;  
27 -function LastPos(SubStr, S: string): Integer;  
28 -function Get_File_Size(sFileToExamine: string; bInKBytes: Boolean): string;  
29 -  
30 -implementation  
31 -  
32 -function Get_File_Size(sFileToExamine: string; bInKBytes: Boolean): string;  
33 -var  
34 - SearchRec: TSearchRec;  
35 - sgPath: string;  
36 - inRetval, I1: Integer;  
37 -begin  
38 - sgPath := ExpandFileName(sFileToExamine);  
39 - try  
40 - inRetval := FindFirst(ExpandFileName(sFileToExamine), faAnyFile, SearchRec);  
41 - if inRetval = 0 then  
42 - I1 := SearchRec.Size  
43 - else  
44 - I1 := -1;  
45 - finally  
46 - SysUtils.FindClose(SearchRec);  
47 - end;  
48 - Result := IntToStr(I1);  
49 -end;  
50 -  
51 -function LastPos(SubStr, S: string): Integer;  
52 -var  
53 - Found, Len, Pos: integer;  
54 -begin  
55 - Pos := Length(S);  
56 - Len := Length(SubStr);  
57 - Found := 0;  
58 - while (Pos > 0) and (Found = 0) do  
59 - begin  
60 - if Copy(S, Pos, Len) = SubStr then  
61 - Found := Pos;  
62 - Dec(Pos);  
63 - end;  
64 - LastPos := Found;  
65 -end;  
66 -Function Explode(Texto, Separador : String) : TStrings;  
67 -var  
68 - strItem : String;  
69 - ListaAuxUTILS : TStrings;  
70 - NumCaracteres, I : Integer;  
71 -Begin  
72 - ListaAuxUTILS := TStringList.Create;  
73 - strItem := '';  
74 - NumCaracteres := Length(Texto);  
75 - For I := 0 To NumCaracteres Do  
76 - If (Texto[I] = Separador) or (I = NumCaracteres) Then  
77 - Begin  
78 - If (I = NumCaracteres) then strItem := strItem + Texto[I];  
79 - ListaAuxUTILS.Add(Trim(strItem));  
80 - strItem := '';  
81 - end  
82 - Else strItem := strItem + Texto[I];  
83 - Explode := ListaAuxUTILS;  
84 -end;  
85 -  
86 -  
87 -Function RemoveCaracteresEspeciais(Texto : String) : String;  
88 -var I : Integer;  
89 - strAux : String;  
90 -Begin  
91 - For I := 0 To Length(Texto) Do  
92 - if ord(Texto[I]) in [32..126] Then  
93 - strAux := strAux + Texto[I]  
94 - else strAux := strAux + ' '; // Coloca um espaço onde houver caracteres especiais  
95 - Result := strAux;  
96 -end;  
97 -  
98 -  
99 -function ProgramaRodando(NomePrograma: String): Boolean;  
100 -var  
101 - IsRunning, ContinueTest: Boolean;  
102 - FSnapshotHandle: THandle;  
103 - FProcessEntry32: TProcessEntry32;  
104 -begin  
105 - IsRunning := False;  
106 - FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);  
107 - FProcessEntry32.dwSize := Sizeof(FProcessEntry32);  
108 - ContinueTest := Process32First(FSnapshotHandle, FProcessEntry32);  
109 - while ContinueTest do  
110 - begin  
111 - IsRunning := UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) = UpperCase(NomePrograma);  
112 - if IsRunning then ContinueTest := False  
113 - else ContinueTest := Process32Next(FSnapshotHandle, FProcessEntry32);  
114 - end;  
115 - CloseHandle(FSnapshotHandle);  
116 - Result := IsRunning;  
117 -end;  
118 -end.  
ini_cols/ini_cols.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
ini_cols/ini_cols.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 97 +SearchPath=
98 Packages=dclact 98 Packages=dclact
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,22 +126,34 @@ CodePage=1252 @@ -126,22 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-Unidade Regional Espírito Santo 127 CompanyName=Dataprev-Unidade Regional Espírito Santo
128 FileDescription=Inicializador de Coletas do Sistema CACIC 128 FileDescription=Inicializador de Coletas do Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName=Ini_COLS 134 ProductName=Ini_COLS
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na licença GPL (General Public License) 136 Comments=Baseado na licença GPL (General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=3  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
ini_cols/ini_cols.dpr
@@ -27,8 +27,8 @@ uses @@ -27,8 +27,8 @@ uses
27 PJVersionInfo, 27 PJVersionInfo,
28 DCPcrypt2, 28 DCPcrypt2,
29 DCPrijndael, 29 DCPrijndael,
30 - DCPbase64;  
31 - 30 + DCPbase64,
  31 + CACIC_Library in '..\CACIC_Library.pas';
32 32
33 var p_path_cacic, 33 var p_path_cacic,
34 v_te_senha_login_serv_updates, 34 v_te_senha_login_serv_updates,
@@ -410,9 +410,17 @@ begin @@ -410,9 +410,17 @@ begin
410 End; 410 End;
411 end; 411 end;
412 412
  413 +const
  414 + CACIC_APP_NAME = 'ini_cols';
  415 +
  416 +var
  417 + oCacic : TCACIC;
413 418
414 begin 419 begin
415 - if (ParamCount>0) then // A passagem da chave EAS é mandatória... 420 + oCacic := TCACIC.Create();
  421 +
  422 + if( not oCacic.isAppRunning( CACIC_APP_NAME ) ) then
  423 + if (ParamCount>0) then // A passagem da chave EAS é mandatória...
416 Begin 424 Begin
417 For intAux := 1 to ParamCount do 425 For intAux := 1 to ParamCount do
418 Begin 426 Begin
@@ -545,4 +553,5 @@ begin @@ -545,4 +553,5 @@ begin
545 end; 553 end;
546 End; 554 End;
547 End; 555 End;
  556 + oCacic.Free();
548 end. 557 end.
ini_cols/ini_cols.res
No preview for this file type
@@ -41,7 +41,8 @@ uses Windows, @@ -41,7 +41,8 @@ uses Windows,
41 IdTCPServer, 41 IdTCPServer,
42 IdCustomHTTPServer, 42 IdCustomHTTPServer,
43 IdHTTPServer, 43 IdHTTPServer,
44 - IdFTPServer; 44 + IdFTPServer,
  45 + CACIC_Library;
45 46
46 const WM_MYMESSAGE = WM_USER+100; 47 const WM_MYMESSAGE = WM_USER+100;
47 48
@@ -471,13 +472,6 @@ begin @@ -471,13 +472,6 @@ begin
471 log_DEBUG('Posição ['+inttostr(intAux)+']='+v_tstrCipherOpened[intAux]); 472 log_DEBUG('Posição ['+inttostr(intAux)+']='+v_tstrCipherOpened[intAux]);
472 473
473 try 474 try
474 - {  
475 - v_Tamanho_Arquivo := Get_File_Size(v_DatFileName,true);  
476 -  
477 - if (v_Tamanho_Arquivo = '0') or  
478 - (v_Tamanho_Arquivo = '-1') then FormularioGeral.Matar(p_path_cacic,'cacic2.dat');  
479 - }  
480 -  
481 FileSetAttr (v_DatFileName,0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000 475 FileSetAttr (v_DatFileName,0); // Retira os atributos do arquivo para evitar o erro FILE ACCESS DENIED em máquinas 2000
482 476
483 log_DEBUG('Localizando arquivo: '+v_DatFileName); 477 log_DEBUG('Localizando arquivo: '+v_DatFileName);
@@ -486,16 +480,6 @@ begin @@ -486,16 +480,6 @@ begin
486 log_DEBUG('Abrindo arquivo: '+v_DatFileName); 480 log_DEBUG('Abrindo arquivo: '+v_DatFileName);
487 ReWrite(v_DatFile); {Abre o arquivo texto} 481 ReWrite(v_DatFile); {Abre o arquivo texto}
488 {$IOChecks on} 482 {$IOChecks on}
489 - {  
490 - if (IOResult <> 0) then // Arquivo não existe, será recriado.  
491 - begin  
492 - if v_Debugs then log_DEBUG('Recriando arquivo: '+v_DatFileName);  
493 - Rewrite (v_DatFile);  
494 - if v_Debugs then log_DEBUG('Append(1) no arquivo: '+v_DatFileName);  
495 - Append(v_DatFile);  
496 - end  
497 - else  
498 - }  
499 log_DEBUG('Append(2) no arquivo: '+v_DatFileName); 483 log_DEBUG('Append(2) no arquivo: '+v_DatFileName);
500 Append(v_DatFile); 484 Append(v_DatFile);
501 log_DEBUG('Criando vetor para criptografia.'); 485 log_DEBUG('Criando vetor para criptografia.');
@@ -591,12 +575,6 @@ begin @@ -591,12 +575,6 @@ begin
591 if Result.Count mod 2 = 0 then 575 if Result.Count mod 2 = 0 then
592 Result.Add(''); 576 Result.Add('');
593 577
594 - {  
595 - log_DEBUG(v_DatFileName+' aberto com sucesso!');  
596 - if v_Debugs then  
597 - for intAux := 0 to (v_tstrCipherOpened.Count-1) do  
598 - log_DEBUG('Posição ['+inttostr(intAux)+'] do MemoryDAT: '+Result[intAux]);  
599 - }  
600 End 578 End
601 else log_DEBUG('Cacic2.dat ainda não alterado! Não foi necessário reabrí-lo.'); 579 else log_DEBUG('Cacic2.dat ainda não alterado! Não foi necessário reabrí-lo.');
602 end; 580 end;
@@ -1040,16 +1018,17 @@ var strAux, @@ -1040,16 +1018,17 @@ var strAux,
1040 intAux : integer; 1018 intAux : integer;
1041 v_Aguarde : TextFile; 1019 v_Aguarde : TextFile;
1042 v_SystemDrive : TStrings; 1020 v_SystemDrive : TStrings;
  1021 + oCacic : TCACIC;
1043 begin 1022 begin
1044 // Não mostrar o formulário... 1023 // Não mostrar o formulário...
1045 Application.ShowMainForm:=false; 1024 Application.ShowMainForm:=false;
  1025 + oCacic := TCACIC.Create;
  1026 + oCacic.showTrayIcon(false);
1046 1027
1047 Try 1028 Try
1048 // De acordo com a versão do OS, determino o ShellCommand para chamadas externas. 1029 // De acordo com a versão do OS, determino o ShellCommand para chamadas externas.
1049 - if ((GetWinVer <> 0) and (GetWinVer > 5)) or  
1050 - (abstraiCSD(v_te_so) >= 250) then //Se NT/2K/XP... then 1030 + if (oCacic.isWindowsNTPlataform()) then //Se NT/2K/XP... then
1051 Begin 1031 Begin
1052 - //p_Shell_Command := GetEnvironmentVariable('SYSTEMROOT') + '\system32\cmd.exe /c '; //NT/2K/XP  
1053 p_Shell_Path := HomeDrive + '\system32\'; //NT/2K/XP 1032 p_Shell_Path := HomeDrive + '\system32\'; //NT/2K/XP
1054 p_Shell_Command := 'cmd.exe'; //NT/2K/XP 1033 p_Shell_Command := 'cmd.exe'; //NT/2K/XP
1055 strAux := HomeDrive + '\'; //Ex.: c:\windows\ 1034 strAux := HomeDrive + '\'; //Ex.: c:\windows\
@@ -1058,7 +1037,6 @@ begin @@ -1058,7 +1037,6 @@ begin
1058 Begin 1037 Begin
1059 v_windir := GetEnvironmentVariable('windir'); 1038 v_windir := GetEnvironmentVariable('windir');
1060 if (trim(v_windir) <> '') then v_windir := v_windir + '\'; 1039 if (trim(v_windir) <> '') then v_windir := v_windir + '\';
1061 - //p_Shell_Command := v_windir + 'command.com /c ';  
1062 p_Shell_Path := v_windir; 1040 p_Shell_Path := v_windir;
1063 p_Shell_Command := 'command.com'; 1041 p_Shell_Command := 'command.com';
1064 strAux := GetEnvironmentVariable('windir') + '\'; //Ex.: c:\windows\ 1042 strAux := GetEnvironmentVariable('windir') + '\'; //Ex.: c:\windows\
@@ -1206,7 +1184,7 @@ begin @@ -1206,7 +1184,7 @@ begin
1206 // Envia o ícone para a bandeja com HINT mostrando Versão... 1184 // Envia o ícone para a bandeja com HINT mostrando Versão...
1207 strFraseVersao := 'CACIC V:' + getVersionInfo(ParamStr(0)); 1185 strFraseVersao := 'CACIC V:' + getVersionInfo(ParamStr(0));
1208 if not (getValorDatMemoria('TcpIp.TE_IP',v_tstrCipherOpened) = '') then 1186 if not (getValorDatMemoria('TcpIp.TE_IP',v_tstrCipherOpened) = '') then
1209 - strFraseVersao := strFraseVersao + #13#10 + 'IP: '+ getValorDatMemoria('TcpIp.TE_IP',v_tstrCipherOpened); 1187 + strFraseVersao := strFraseVersao + char(13) + char(10) + 'IP: '+ getValorDatMemoria('TcpIp.TE_IP',v_tstrCipherOpened);
1210 pnVersao.Caption := 'V. ' + getVersionInfo(ParamStr(0)); 1188 pnVersao.Caption := 'V. ' + getVersionInfo(ParamStr(0));
1211 InicializaTray(strFraseVersao); 1189 InicializaTray(strFraseVersao);
1212 CipherClose; 1190 CipherClose;
@@ -1214,11 +1192,24 @@ begin @@ -1214,11 +1192,24 @@ begin
1214 else 1192 else
1215 Begin 1193 Begin
1216 log_DEBUG('Agente finalizado devido a concomitância de sessões...'); 1194 log_DEBUG('Agente finalizado devido a concomitância de sessões...');
  1195 +
  1196 + // Libera memoria referente ao objeto oCacic
  1197 + try
  1198 + oCacic.Free;
  1199 + except
  1200 + end;
  1201 +
1217 Finaliza; 1202 Finaliza;
1218 End; 1203 End;
1219 Except 1204 Except
1220 log_diario('PROBLEMAS NA INICIALIZAÇÃO (2)'); 1205 log_diario('PROBLEMAS NA INICIALIZAÇÃO (2)');
1221 End; 1206 End;
  1207 +
  1208 + // Libera memoria referente ao objeto oCacic
  1209 + try
  1210 + oCacic.Free;
  1211 + except
  1212 + end;
1222 end; 1213 end;
1223 1214
1224 procedure TFormularioGeral.SetaVariaveisGlobais; 1215 procedure TFormularioGeral.SetaVariaveisGlobais;
@@ -1545,58 +1536,7 @@ begin @@ -1545,58 +1536,7 @@ begin
1545 Invoca_GerCols(nil,'UpdatePrincipal'); 1536 Invoca_GerCols(nil,'UpdatePrincipal');
1546 log_diario('Finalizando... (Atualização em aproximadamente 20 segundos).'); 1537 log_diario('Finalizando... (Atualização em aproximadamente 20 segundos).');
1547 Finaliza; 1538 Finaliza;
1548 - {  
1549 - // O método abaixo foi descartado devido à janela MS-DOS que em algumas máquinas  
1550 - // permaneciam abertas e minimizadas e, em alguns casos, escureciam totalmente a tela do usuário,  
1551 - // causando muito descontentamento! :|  
1552 - FileSetAttr(p_path_cacic + 'cacic2.exe', 0);  
1553 - Batchfile := TStringList.Create;  
1554 - Batchfile.Add('@echo off');  
1555 - Batchfile.Add(':Label1');  
1556 - Batchfile.Add('del ' + p_path_cacic + 'cacic2.exe');  
1557 - Batchfile.Add('if Exist ' + p_path_cacic + 'cacic2.exe goto Label1');  
1558 - Batchfile.Add('move ' + p_path_cacic + 'temp\cacic2.exe ' + p_path_cacic + 'cacic2.exe');  
1559 - Batchfile.Add(p_path_cacic + 'cacic2.exe /atualizacao');  
1560 - Batchfile.SaveToFile(p_path_cacic + 'Temp\cacic2.bat');  
1561 - BatchFile.Free;  
1562 - log_diario('* Atualizando versão do módulo Principal');  
1563 - Shell_NotifyIcon(NIM_Delete,@NotifyStruc);  
1564 - Shell_NotifyIcon(NIM_MODIFY,@NotifyStruc);  
1565 - Executa(p_Shell_Path + p_Shell_Command + 'Temp\cacic2.bat /c',SW_HIDE);  
1566 - FreeMemory(0);  
1567 - Halt(0);  
1568 - }  
1569 - End;  
1570 -  
1571 - {  
1572 - // Não usar VBS pois, o processo morre quando o CACIC é finalizado.  
1573 - // E também pela dependência do WSH, certo?!! :|  
1574 - Begin  
1575 - main.frmMain.log_diario('* Atualizando versão do módulo Principal');  
1576 - FileSetAttr(p_path_cacic + 'cacic2.exe', 0);  
1577 - Batchfile := TStringList.Create;  
1578 - Batchfile.Add('Dim fso,fsoDEL,v_pausa,WshShell');  
1579 - Batchfile.Add('Set fsoDEL = CreateObject("Scripting.FileSystemObject")');  
1580 - Batchfile.Add('While (fsoDEL.FileExists("'+p_path_cacic+'cacic2.exe"))');  
1581 - Batchfile.Add(' fsoDEL.DeleteFile("'+p_path_cacic+'cacic2.exe")');  
1582 - Batchfile.Add('Wend');  
1583 - Batchfile.Add('Set fso = CreateObject("Scripting.FileSystemObject")');  
1584 - Batchfile.Add('fso.MoveFile ' + p_path_cacic + 'temp\cacic2.exe, "' + p_path_cacic + 'cacic2.exe"');  
1585 - Batchfile.Add('Set WshShell = WScript.CreateObject("WScript.Shell")');  
1586 - Batchfile.Add('WshShell.Run "' + p_path_cacic + 'cacic2.exe /atualizacao",10,FALSE');  
1587 - Batchfile.Add('For v_pausa = 1 to 5000:next');  
1588 - Batchfile.Add('WScript.Quit');  
1589 - Batchfile.SaveToFile(p_path_cacic + 'Temp\cacic2.vbs');  
1590 - Batchfile.SaveToFile(p_path_cacic + 'Temp\cacic21.vbs');  
1591 - BatchFile.Free;  
1592 - Executa_VBS('cacic2');  
1593 - Shell_NotifyIcon(NIM_Delete,@NotifyStruc);  
1594 - Shell_NotifyIcon(NIM_MODIFY,@NotifyStruc);  
1595 - FreeMemory(0);  
1596 - Halt(0);  
1597 - Application.Terminate;  
1598 End; 1539 End;
1599 - }  
1600 1540
1601 // A existência de "temp\cacic2.bat" significa AutoUpdate já executado! 1541 // A existência de "temp\cacic2.bat" significa AutoUpdate já executado!
1602 // Essa verificação foi usada no modelo antigo de AutoUpdate e deve ser mantida 1542 // Essa verificação foi usada no modelo antigo de AutoUpdate e deve ser mantida
mapa/acesso.dfm
@@ -185,6 +185,7 @@ object frmAcesso: TfrmAcesso @@ -185,6 +185,7 @@ object frmAcesso: TfrmAcesso
185 Width = 100 185 Width = 100
186 Height = 30 186 Height = 30
187 Caption = 'Acessar' 187 Caption = 'Acessar'
  188 + Default = True
188 Enabled = False 189 Enabled = False
189 Font.Charset = DEFAULT_CHARSET 190 Font.Charset = DEFAULT_CHARSET
190 Font.Color = clWindowText 191 Font.Color = clWindowText
mapa/acesso.pas
@@ -84,7 +84,7 @@ begin @@ -84,7 +84,7 @@ begin
84 str_local_Aux := trim(frmMapaCacic.DeCrypt(frmMapaCacic.XML_RetornaValor('TE_VERSAO_MAPA',strRetorno))); 84 str_local_Aux := trim(frmMapaCacic.DeCrypt(frmMapaCacic.XML_RetornaValor('TE_VERSAO_MAPA',strRetorno)));
85 if (str_local_Aux <> '') then 85 if (str_local_Aux <> '') then
86 Begin 86 Begin
87 - MessageDLG(#13#10#13#10+'ATENÇÃO! Foi disponibilizada a versão "'+str_local_Aux+'".'+#13#10#13#10#13#10+'Efetue o download acessando http://www-cacic, na opção Repositório.'+#13#10#13#10,mtInformation,[mbOK],0); 87 + MessageDLG(#13#10#13#10+'ATENÇÃO! Foi disponibilizada a versão "'+str_local_Aux+'".'+#13#10#13#10+'Acesse o gerente cacic na opção "Repositório" e baixe o programa "MapaCACIC"!'+#13#10,mtWarning,[mbOK],0);
88 btCancela.Click; 88 btCancela.Click;
89 End; 89 End;
90 90
@@ -97,12 +97,12 @@ begin @@ -97,12 +97,12 @@ begin
97 End 97 End
98 else 98 else
99 Begin 99 Begin
100 - str_local_Aux := 'Usuário/Senha Incorretos ou Nível de Acesso Não Permitido!'; 100 + str_local_Aux := 'Usuário/Senha incorretos ou Nível de acesso não permitido!';
101 End 101 End
102 End 102 End
103 else 103 else
104 Begin 104 Begin
105 - str_local_Aux := 'Problemas na Comunicação!'; 105 + str_local_Aux := 'Problemas na comunicação!';
106 End; 106 End;
107 107
108 lbMsg_Erro_Senha.Caption := str_local_Aux; 108 lbMsg_Erro_Senha.Caption := str_local_Aux;
mapa/mapacacic.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
mapa/mapacacic.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;MSI_D7_Rtl
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,24 +126,34 @@ CodePage=1252 @@ -126,24 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName=Dataprev-ES 127 CompanyName=Dataprev-ES
128 FileDescription=MapaCacic - Módulo Avulso para Coleta de Informações Patrimoniais para o Sistema CACIC 128 FileDescription=MapaCacic - Módulo Avulso para Coleta de Informações Patrimoniais para o Sistema CACIC
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName= 134 ProductName=
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments=Baseado na Licença GPL(General Public License) 136 Comments=Baseado na Licença GPL(General Public License)
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1  
139 -Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes 138 +Count=2
  139 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=5  
145 -Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion  
146 -Item1=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP  
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes  
148 -Item3=C:\Arquivos de programas\Borland\Delphi7\mitec;C:\Arquivos de programas\Borland\Delphi7\Mitec\D7  
149 -Item4=C:\Arquivos de programas\Borland\Delphi7\mitec 145 +Count=10
  146 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  147 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
mapa/mapacacic.dpr
@@ -19,15 +19,42 @@ program MapaCacic; @@ -19,15 +19,42 @@ program MapaCacic;
19 19
20 uses 20 uses
21 Forms, 21 Forms,
  22 + Windows,
22 main_mapa in 'main_mapa.pas' {frmMapaCacic}, 23 main_mapa in 'main_mapa.pas' {frmMapaCacic},
23 LibXmlParser in 'LibXmlParser.pas', 24 LibXmlParser in 'LibXmlParser.pas',
24 XML in 'xml.pas', 25 XML in 'xml.pas',
25 - acesso in 'acesso.pas' {frmAcesso}; 26 + acesso in 'acesso.pas' {frmAcesso},
  27 + CACIC_Library in '..\CACIC_Library.pas';
26 28
27 {$R *.res} 29 {$R *.res}
28 30
  31 +const
  32 + CACIC_APP_NAME = 'MapaCacic';
  33 +
  34 +var
  35 + hwind:HWND;
  36 + oCacic : TCACIC;
  37 +
29 begin 38 begin
30 - Application.Initialize;  
31 - Application.CreateForm(TfrmMapaCacic, frmMapaCacic);  
32 - Application.Run; 39 + oCacic := TCACIC.Create();
  40 +
  41 + if( oCacic.isAppRunning( CACIC_APP_NAME ) )
  42 + then begin
  43 + hwind := 0;
  44 + repeat // The string 'My app' must match your App Title (below)
  45 + hwind:=Windows.FindWindowEx(0,hwind,'TApplication', CACIC_APP_NAME );
  46 + until (hwind<>Application.Handle);
  47 + IF (hwind<>0) then
  48 + begin
  49 + Windows.ShowWindow(hwind,SW_SHOWNORMAL);
  50 + Windows.SetForegroundWindow(hwind);
  51 + end;
  52 + FreeMemory(0);
  53 + end
  54 + else begin
  55 + Application.Initialize;
  56 + Application.CreateForm(TfrmMapaCacic, frmMapaCacic);
  57 + Application.Run;
  58 + end;
  59 + oCacic.Free();
33 end. 60 end.
mapa/mapacacic.res
No preview for this file type
@@ -33,7 +33,3 @@ @@ -33,7 +33,3 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Mitec\D7"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Mitec\D7"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Mitec\D7"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Mitec\D7"  
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Documents and Settings\d306851\Desktop\MiTeC\Demos\1\ @@ -113,9 +113,9 @@ RootDir=C:\Documents and Settings\d306851\Desktop\MiTeC\Demos\1\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=708
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,10 +126,33 @@ CodePage=1252 @@ -126,10 +126,33 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName= 127 CompanyName=
128 FileDescription= 128 FileDescription=
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.708
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName= 134 ProductName=
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
  136 +[HistoryLists\hlDebugSourcePath]
  137 +Count=2
  138 +Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  139 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  140 +[HistoryLists\hlUnitAliases]
  141 +Count=1
  142 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
  143 +[HistoryLists\hlSearchPath]
  144 +Count=10
  145 +Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  146 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  147 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  148 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  149 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  150 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  151 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  152 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  153 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  154 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  155 +[HistoryLists\hlOutputDirectorry]
  156 +Count=2
  157 +Item0=..\Repositorio
  158 +Item1=Repositorio
vaca/vaca.res
No preview for this file type
vacon/vacon.cfg
@@ -33,10 +33,6 @@ @@ -33,10 +33,6 @@
33 -K$00400000 33 -K$00400000
34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 34 -LE"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl" 35 -LN"c:\arquivos de programas\borland\delphi7\Projects\Bpl"
36 --U"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
37 --O"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
38 --I"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
39 --R"C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP"  
40 -w-UNSAFE_TYPE 36 -w-UNSAFE_TYPE
41 -w-UNSAFE_CODE 37 -w-UNSAFE_CODE
42 -w-UNSAFE_CAST 38 -w-UNSAFE_CAST
vacon/vacon.dof
@@ -94,10 +94,10 @@ OutputDir= @@ -94,10 +94,10 @@ OutputDir=
94 UnitOutputDir= 94 UnitOutputDir=
95 PackageDLLOutputDir= 95 PackageDLLOutputDir=
96 PackageDCPOutputDir= 96 PackageDCPOutputDir=
97 -SearchPath=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 97 +SearchPath=
98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k 98 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k
99 Conditionals= 99 Conditionals=
100 -DebugSourceDirs=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 100 +DebugSourceDirs=
101 UsePackages=0 101 UsePackages=0
102 [Parameters] 102 [Parameters]
103 RunParams= 103 RunParams=
@@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\ @@ -113,9 +113,9 @@ RootDir=C:\Arquivos de programas\Borland\Delphi7\Bin\
113 IncludeVerInfo=1 113 IncludeVerInfo=1
114 AutoIncBuild=0 114 AutoIncBuild=0
115 MajorVer=2 115 MajorVer=2
116 -MinorVer=4 116 +MinorVer=6
117 Release=0 117 Release=0
118 -Build=601 118 +Build=704
119 Debug=0 119 Debug=0
120 PreRelease=0 120 PreRelease=0
121 Special=0 121 Special=0
@@ -126,22 +126,34 @@ CodePage=1252 @@ -126,22 +126,34 @@ CodePage=1252
126 [Version Info Keys] 126 [Version Info Keys]
127 CompanyName= 127 CompanyName=
128 FileDescription= 128 FileDescription=
129 -FileVersion=2.4.0.601 129 +FileVersion=2.6.0.704
130 InternalName= 130 InternalName=
131 LegalCopyright= 131 LegalCopyright=
132 LegalTrademarks= 132 LegalTrademarks=
133 OriginalFilename= 133 OriginalFilename=
134 ProductName= 134 ProductName=
135 -ProductVersion=2.4.0.371 135 +ProductVersion=2.6.0
136 Comments= 136 Comments=
137 [HistoryLists\hlDebugSourcePath] 137 [HistoryLists\hlDebugSourcePath]
138 -Count=1 138 +Count=2
139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 139 Item0=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
  140 +Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
140 [HistoryLists\hlUnitAliases] 141 [HistoryLists\hlUnitAliases]
141 Count=1 142 Count=1
142 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 143 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143 [HistoryLists\hlSearchPath] 144 [HistoryLists\hlSearchPath]
144 -Count=3 145 +Count=10
145 Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP 146 Item0=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
146 Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7 147 Item1=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7
147 -Item2=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes 148 +Item2=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  149 +Item3=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP
  150 +Item4=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\ZLibEx
  151 +Item5=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  152 +Item6=C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7
  153 +Item7=C:\Arquivos de programas\Borland\Delphi7\Source\Rtl\Common;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\Mitec\v1010_Delphi7;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\NTFileSecurity;C:\Arquivos de programas\Borland\Delphi7\Comps_CACIC\PJVersion
  154 +Item8=C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\CriptografiaDCP;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\LibXMLParser;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\MD5;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\Mitec\v10.2.0-D7;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\NTFileSecurity;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\PJVersion;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ShellLinker;C:\Documents and Settings\Adriano S. Vieira\Meus documentos\cacic\Comps_CACIC\ZLibEx
  155 +Item9=C:\Arquivos de programas\Borland\Delphi7\Mitec\D7;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Ciphers;C:\Arquivos de programas\Borland\Delphi7\CriptografiaDCP\Hashes
  156 +[HistoryLists\hlOutputDirectorry]
  157 +Count=2
  158 +Item0=..\Repositorio
  159 +Item1=Repositorio
vacon/vacon.res
No preview for this file type