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

📄 syscomp.dpr

📁 New tj source www.opensc.ws - trojan source codes.
💻 DPR
字号:
library server_plugin;

uses
  Windows,
  sysutils,
  classes,zlib,
  mmsystem;

type
   pluginreply = procedure (Text: pchar);

var
OwnerAPP:integer;
clientdllname:pchar;

procedure Init(Owner: Integer); far
begin
	OwnerAPP := Owner;
end;

function FileExists(const FileName: string): Boolean; 
var 
  lpFindFileData: TWin32FindData; 
  hFile: Cardinal; 
begin 
  hFile := FindFirstFile(PChar(FileName), lpFindFileData); 
  if hFile <> INVALID_HANDLE_VALUE then 
  begin 
    result := True; 
    Windows.FindClose(hFile) 
  end 
  else 
    result := False; 
end;

procedure CompressStream(inpStream, outStream: TStream);far
var
  InpBuf, OutBuf: Pointer;
  InpBytes, OutBytes: Integer; 
begin 
  InpBuf := nil; 
  OutBuf := nil; 
  try 
    GetMem(InpBuf, inpStream.Size); 
    inpStream.Position := 0; 
    InpBytes := inpStream.Read(InpBuf^, inpStream.Size); 
    CompressBuf(InpBuf, InpBytes, OutBuf, OutBytes); 
    outStream.Write(OutBuf^, OutBytes); 
  finally 
    if InpBuf <> nil then FreeMem(InpBuf); 
    if OutBuf <> nil then FreeMem(OutBuf); 
  end; 
end;


function CompressFile(fn:string):Pchar; far
var
  ms1, ms2: TMemoryStream;
begin
  ms1 := TMemoryStream.Create;
  try
    ms2 := TMemoryStream.Create; 
    try
      ms1.LoadFromFile(fn);
      CompressStream(ms1, ms2);
      Result := Pchar(Format('File compression ratio: %d %%',
        [round(100 / ms1.Size * ms2.Size)])+
        ', New file: '+fn+'.$');
      ms2.SaveToFile(fn+'.$');
      pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+result));
    finally
      ms1.Free;
    end;
  finally
    ms2.Free;
  end;
end;


procedure plugin(data:pchar); far;
begin
//here you put the client plugin name:
clientdllname:='compressor.dll';
if fileexists(data) then begin
//send message to the server.dll
pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+'Compression of '+data+' started'));
//start compressing file
compressfile(data);
end else
pluginreply(GetProcAddress(OwnerApp, 'pluginreply'))(pchar(clientdllname+';'+'File doesnt exists!'));
end;



procedure DLLEntryPoint(dwReason: DWORD);
begin
   // blank
end;

exports
init,CompressFile,plugin;

begin
  DLLProc := @DLLEntryPoint;
  DLLEntryPoint(DLL_PROCESS_ATTACH);
end.


⌨️ 快捷键说明

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