首页
社区
课程
招聘
[原创]多桌面切换程序-通杀所有网管程序
发表于: 2007-11-29 00:11 19196

[原创]多桌面切换程序-通杀所有网管程序

2007-11-29 00:11
19196
程序说明:
   程序启动后没用任何界面,只会再创建一个桌面,用WIN+1和WIN+2组合键在两个桌面间切换。一个桌面用于工作,一个桌面用于娱乐,互不干扰。


;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;  Programmed by nohacks, nohacks@163.com
;  Website: http://hi.baidu.com/nohacks
;           Win32 ASM is Masm
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;  版本信息
;     多桌面切换系统V1.0 -  可以两个桌面之间任意切换
;     
;                         2007年 11 月  28 日
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.486 
.model flat,stdcall 
option casemap:none 

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;        Include 数据
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc 
include kernel32.inc 
include shell32.inc
include advapi32.inc

include debug.inc
includelib kernel32.lib 
include user32.inc 
includelib user32.lib 
includelib shell32.lib
includelib advapi32.lib

m2m	Macro M1,M2
	push	M2
	pop		M1
endm

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;        Equ 数据 RC资源
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CREATE_DEFAULT_ERROR_MODE EQU         4000000H
ICO_ICO                   EQU         1
;DLG_MAIN                  EQU         1000

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

.data 

IdDesktop db "http://hi.baidu.com/nohacks",0
ClassName db "SimpleWinClass",0       
AppName db " ",0       


.data?
 
hInstance HINSTANCE ?      
CommandLine LPSTR ? 
hWinMain    dd		?
hDesktopCurrent dd     ?  ;//当前桌面
hmyDesktop  dd         ?  ;//新桌面

.code 

;********************************************************************

StartMyExplore proc
  
LOCAL  sui:STARTUPINFO
LOCAL  pi:PROCESS_INFORMATION	

;invoke	RtlZeroMemory,addr sui,SIZEOF STARTUPINFO   
mov sui.cb,SIZEOF STARTUPINFO
mov sui.lpDesktop,offset IdDesktop
invoke CreateProcess,NULL,CTEXT("explorer"),NULL,NULL,TRUE,CREATE_DEFAULT_ERROR_MODE or CREATE_SEPARATE_WOW_VDM,NULL,NULL,addr sui,addr pi

[COLOR="Red"]invoke CreateProcess,NULL,CTEXT("ctfmon"),NULL,NULL,TRUE,CREATE_DEFAULT_ERROR_MODE or CREATE_SEPARATE_WOW_VDM,NULL,NULL,addr sui,addr pi[/COLOR]  ;解决新桌面输入法不可用的问题

ret

StartMyExplore endp

SetDesktop proc 
		
 invoke GetCurrentThreadId
 
 invoke GetThreadDesktop,eax   

 mov hDesktopCurrent,eax      ;//当前桌面
 
 mov hmyDesktop,0
 
 invoke OpenDesktop,addr IdDesktop,0,FALSE,0   ;检查桌面是否已经存在
     
      .if eax!=0
  	  	 	
     invoke CloseDesktop,eax
   
    .endif
 
invoke CreateDesktop,addr IdDesktop,NULL,NULL,0,MAXIMUM_ALLOWED,NULL
 
 mov hmyDesktop,eax
 
 .if eax==0
 
 ret
 	
 .endif
 
 invoke SetThreadDesktop,hmyDesktop
 
invoke SwitchDesktop,hmyDesktop
 
 invoke StartMyExplore
 
 ret

SetDesktop endp 


WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM 

    .IF uMsg==WM_DESTROY 
       invoke  UnregisterHotKey,hWnd,hWnd      
       invoke  SwitchDesktop,hDesktopCurrent
       invoke CloseDesktop,hmyDesktop
       invoke PostQuitMessage,NULL            
        
     .ELSEIF   uMsg==  WM_CREATE
    
       push hWnd
       pop  hWinMain
      invoke LoadIcon,hInstance,ICO_ICO
       invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax    ;设置窗口图标  
       invoke SetWindowPos,hWnd,HWND_TOPMOST,0,0,0,0, SWP_NOMOVE or SWP_NOSIZE ;窗口置顶
       invoke RegisterHotKey,hWnd,7787,MOD_WIN,48   ;WIN+0
       invoke RegisterHotKey,hWnd,7788,MOD_WIN,49   ;WIN+1
       invoke RegisterHotKey,hWnd,7789,MOD_WIN,50   ;WIN+2
       invoke     SetDesktop

     .ELSEIF  uMsg==WM_HOTKEY
     
         .if wParam==7787
   	
   	 invoke  SwitchDesktop,hDesktopCurrent
         invoke PostQuitMessage,NULL               
 
        .endif
         
        .if  wParam==7788
       
        invoke SwitchDesktop,hDesktopCurrent
       
        .endif
       
       .if wParam==7789
   
        invoke SwitchDesktop,hmyDesktop
           
        .endif
     
       .ELSE
  
        invoke DefWindowProc,hWnd,uMsg,wParam,lParam     
        ret 
   .ENDIF
   
    xor eax,eax 
    ret 
WndProc endp 


WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD 
    LOCAL wc:WNDCLASSEX                                           
    LOCAL msg:MSG 
    LOCAL hwnd:HWND 

    mov   wc.cbSize,SIZEOF WNDCLASSEX                   
    mov   wc.style, CS_HREDRAW or CS_VREDRAW 
    mov   wc.lpfnWndProc, OFFSET WndProc 
    mov   wc.cbClsExtra,NULL 
    mov   wc.cbWndExtra,NULL 
    push  hInstance 
    pop   wc.hInstance 
    mov   wc.hbrBackground,COLOR_WINDOW+1 
    mov   wc.lpszMenuName,NULL 
    mov   wc.lpszClassName,OFFSET ClassName 
    invoke LoadIcon,NULL,IDI_APPLICATION 
    mov   wc.hIcon,eax 
    mov   wc.hIconSm,eax 
    invoke LoadCursor,NULL,IDC_ARROW 
    mov   wc.hCursor,eax 
    invoke RegisterClassEx, addr wc                      
    invoke CreateWindowEx,NULL,\ 
                ADDR ClassName,\ 
                ADDR AppName,\ 
                WS_OVERLAPPEDWINDOW,\ 
                CW_USEDEFAULT,\ 
                CW_USEDEFAULT,\ 
                CW_USEDEFAULT,\ 
                CW_USEDEFAULT,\ 
                NULL,\ 
                NULL,\ 
                hInst,\ 
                NULL 
    mov   hwnd,eax 
   ;invoke ShowWindow, hwnd,CmdShow              
   ; invoke UpdateWindow, hwnd                                 

    .WHILE TRUE                                                        
                invoke GetMessage, ADDR msg,NULL,0,0 
                .BREAK .IF (!eax) 
                invoke TranslateMessage, ADDR msg 
                invoke DispatchMessage, ADDR msg 
   .ENDW 
    mov     eax,msg.wParam                                          
    ret 
WinMain endp 


;********************************************************************

start:
   invoke GetModuleHandle, NULL           
                                                                      
  mov hInstance,eax 
  invoke GetCommandLine                       
                                                               
  mov CommandLine,eax 
  invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT      
  
  invoke ExitProcess, eax                           

;********************************************************************

end        start





   不知道大家想过没有,这个程序还可用来免费上网,切换到新桌面以后,网管程序对桌面的锁定操作对新桌面无效,后在加个拦截关机,拦截鼠标锁定的功能(用HOOKAPI),这样在结账下机
后计算机仍然是开放状态达到免费上网的目的,可以基本通杀所有网管程序!

我根据上面的原理写了个工具:网吧超级防锁专家

下载地址:http://hi.baidu.com/nohacks/blog/item/4665f68db997f511b21bba2f.html

大家可以看看

[课程]Android-CTF解题方法汇总!

上传的附件:
收藏
免费 7
支持
分享
最新回复 (33)
雪    币: 1852
活跃值: (504)
能力值: (RANK:1010 )
在线值:
发帖
回帖
粉丝
2
叫系统有点大了
2007-11-29 10:11
0
雪    币: 750
活跃值: (228)
能力值: ( LV9,RANK:780 )
在线值:
发帖
回帖
粉丝
3
呵呵,是有点,已修正!
2007-11-29 11:40
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
不错的东东哈。。。。
2007-11-29 13:09
0
雪    币: 268
活跃值: (40)
能力值: ( LV10,RANK:170 )
在线值:
发帖
回帖
粉丝
5
不错啊,支持个

2007-11-29 13:49
0
雪    币: 66
活跃值: (16)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
6
nice job  :)

我们这儿网吧的插卡器跟机箱电源连着-。-
2007-11-29 15:36
0
雪    币: 486
活跃值: (13)
能力值: ( LV9,RANK:430 )
在线值:
发帖
回帖
粉丝
7
强大啊。佩服。
(而我还是那么菜。 )
以后多发原创啊。

请教一下,程序的原理就是创建一个新的桌面,接着加个拦截关机,拦截鼠标锁定的功能,就是这么简单吗??

你是怎么想到用这个来实现突破网吧限制的??

问题是如果上面的拦截功能被客户端给先拦截了,那会怎么样?
2007-11-29 21:37
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
8
虚拟桌面吧。codeproject上早有了。。。

Introduction
In my mind by far the coolest feature that a desktop manager can have is proper multiple (virtual) desktopping (shallow, I know). So, Windows XP doesn't have this feature, ah well there's a PowerTool that does it. Except - you can't change desktop just by mousing off the edge, and more seriously there doesn't appear to be any mechanism to transfer windows between desktops - which is very annoying, as things never open where you want them to.
Concept
I thought that the easiest way to do this is simply to show and hide windows in such a way as to give the impression of more than one desktop. About halfway through writing this I discovered SwitchDesktop, which looked quite complicated so I didn't bother trying it that way.
Technical Details
The program is an MFC Dialog App.
I found out how to list all the windows on the system and show and hide them from the tbarsort article. I ask Windows for handles to every window on the system using EnumWindows and filter out the irrelevant ones.
bool ValidWindow(HWND hwnd)
{
  if (!IsWindowVisible(hwnd)) return false;
  if (GetWindowTextLength(hwnd) == 0) return false;
  if (GetAsyncKeyState(VK_LBUTTON) && hwnd==GetForegroundWindow()) return false;
  char str[100];
  GetWindowText(hwnd,str,99);
  if(strncmp(str,"Desktop",100)==0) return false;
  if(strncmp(str,"Program Manager",100)==0) return false;
  return true;
}
BOOL CALLBACK AddToList(HWND hwnd,LPARAM ret)
{
  std::vector<HWND>* vecret=(std::vector<HWND>*)ret;
  if(ValidWindow(hwnd)) vecret->push_back(hwnd);
  return TRUE;
}
std::vector<HWND> WindowList()
{
  std::vector<HWND> windows;
  EnumWindows(AddToList,LPARAM(&windows));
  return windows;
}
Desktops can be switched by pressing the relevant button or with a keyboard shortcut, implemented with RegisterHotKey, for example Win+1 is registered by
RegisterHotKey(GetSafeHwnd(),1,MOD_WIN,'1');
For some reason the MFC ClassWizard doesn't know about the WM_HOTKEY message, so it has to be added manually to the message map:
ON_MESSAGE(WM_HOTKEY,OnHotKey)
By far the hardest thing to do was to detect when the mouse touched the edge of the screen (which is when the desktops change). Eventually I found the MouseHookDlg project (although I can't currently find a reference for it), which shows how to install a global mouse hook. All I have to do is package the dll with my app and call the simple function API_SetHooks to register a mouse callback, and put a handler in the message map:
ON_REGISTERED_MESSAGE(UWM_MOUSEMOVE, OnHookMouseMove)
having first registered this mesage by
UWM_MOUSEMOVE = RegisterWindowMessage(UWM_SHELL_HOOK_MSG);
Finally, I wanted it to be possible to drag windows off the side of the screen and have them come with you to the new desktop. I failed to find an actual way of checking if any windows are being dragged (I suspect it can be done with another global hook), instead if the left mouse button is down as the desktops are switched then the foreground window is transfered, hence the line
if (GetAsyncKeyState(VK_LBUTTON) && hwnd==GetForegroundWindow()) return false;
in the ValidWindow above, this works well but occasionally leads to accidental window transfers.
Conclusion
The program works fine, with one or two minor bugs (not bad for only a few hours' work). Occasionally windows get transfered when not intended, and much worse occasionally they get permanently hidden (don't do any absolutely vital work whilst using this program, there is a small chance that this will happen and you will be unable to save). I would be glad of suggestions for bug fixes especially for improving the dragging detection, extra features are unlikely to get added.
Blatant plug: visit my site for mostly various games written using OpenGL with MFC or GLUT.
2007-11-29 21:50
0
雪    币: 709
活跃值: (2420)
能力值: ( LV12,RANK:1010 )
在线值:
发帖
回帖
粉丝
9


上传的附件:
2007-11-30 06:34
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
10
下载了,如何不顶一下。
2007-11-30 12:27
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
11
冒昧问下。这个代码咋没有呀HookDll.dll
2007-11-30 12:29
0
雪    币: 145
活跃值: (85)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
12
sudami
--------------------Configuration: Multiple Desktops - Win32 Debug--------------------
Error scanning file C:\Documents and Settings\Administrator\桌面\multipledesktops\res\Multiple Desktops.rc2 for dependencies.
Compiling resources...
C:\Documents and Settings\Administrator\桌面\multipledesktops\Multiple Desktops.rc(186) : 致命错误 RC1015: 无法打开包含文件 'res\Multiple Desktops.rc2'.
执行 rc.exe 时出错.

------------------------
编译出现这个问题。
2007-11-30 12:36
0
雪    币: 224
活跃值: (147)
能力值: ( LV9,RANK:970 )
在线值:
发帖
回帖
粉丝
13
就只是个虚拟桌面....
2007-11-30 15:27
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
太强了,顶一下
2007-11-30 15:30
0
雪    币: 321
活跃值: (271)
能力值: ( LV13,RANK:1050 )
在线值:
发帖
回帖
粉丝
15
好,帮顶。。。
2007-11-30 16:04
0
雪    币: 1844
活跃值: (35)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
16
很好,有意思
2007-11-30 17:54
0
雪    币: 1852
活跃值: (504)
能力值: (RANK:1010 )
在线值:
发帖
回帖
粉丝
17
这次网吧被你搞的非安全了
能从多桌面切换联想到网吧,很邪恶
2007-11-30 21:06
0
雪    币: 437
活跃值: (273)
能力值: ( LV12,RANK:240 )
在线值:
发帖
回帖
粉丝
18
正好我常驻网吧 试试看
2007-11-30 22:17
0
雪    币: 424
活跃值: (10)
能力值: ( LV9,RANK:850 )
在线值:
发帖
回帖
粉丝
19
na ni!?
我不常驻网吧的也要试试看
2007-12-3 01:09
0
雪    币: 707
活跃值: (1301)
能力值: ( LV9,RANK:190 )
在线值:
发帖
回帖
粉丝
20
有时两个桌面间切换没响应,这是BUG吗?
2007-12-3 14:48
0
雪    币: 20
活跃值: (37)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
21
呵呵!挺好的如果能杀掉那个讨厌的实名卡更好了,你们都不知道辽宁省为了赚更多的钱强制每个网吧必须使用实名卡!如果没有这个卡就不让上网,网吧老板为不赔本只能让每个来上网的客户来买这个“实名卡”。
郁闷!
2007-12-3 16:50
0
雪    币: 20
活跃值: (37)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
22
如果我有双翅膀坚决飞离这个垃圾地方。
2007-12-3 16:51
0
雪    币: 210
活跃值: (28)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
23
以前用过,不过是用非asm写的,几百K,下了,用fasm的格式重写一下“”“”“”
2007-12-3 22:34
0
雪    币: 210
活跃值: (28)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
24
看了,作者好像是黑防的VIP。只讨论tech,不看个人
2007-12-3 22:40
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
25
我们这边下机直接关电源,有没有拦截对电源操作的软件。
2007-12-12 10:08
0
游客
登录 | 注册 方可回帖
返回
//