⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monitor.asm

📁 用ASM实现Server及sql操作
💻 ASM
字号:
.code
StartMonitorLink	proc uses ebx,hWin:DWORD,hSock:DWORD,hPort:DWORD,hMsg:DWORD
	LOCAL	szAddr:sockaddr_in
	LOCAL	nTimeOver:DWORD
	invoke socket,AF_INET,SOCK_STREAM,IPPROTO_IP
	mov ebx,hSock
	mov [ebx],eax
	mov nTimeOver,6000
	invoke setsockopt,[ebx],SOL_SOCKET,SO_RCVTIMEO,addr nTimeOver,sizeof nTimeOver
	mov nTimeOver,1
	invoke setsockopt,[ebx],SOL_SOCKET,SO_REUSEADDR,addr nTimeOver,sizeof nTimeOver
	invoke MemFill,addr szAddr,sizeof szAddr
	mov szAddr.sin_family,AF_INET
	invoke htons,hPort
	mov szAddr.sin_port,ax
	invoke htonl,INADDR_ANY
	mov szAddr.sin_addr,eax
	invoke bind,[ebx],addr szAddr,sizeof szAddr
	invoke WSAAsyncSelect,[ebx],hWin,hMsg,FD_ACCEPT or FD_READ or FD_CLOSE
	invoke listen,[ebx],SOMAXCONN
	ret
StartMonitorLink	endp

CallCrypt	proc uses esi edi ebx,pBuffer:DWORD,iLen:DWORD,key1:DWORD,key2:DWORD
	LOCAL iResult:DWORD
		mov edx,4bch
		xor ecx,ecx
		xor eax,eax
		mov esi,pBuffer
_next1:
		mov al,[esi+ecx]
		mov bl,dh
		xor bl,al
		movzx ax,al
		add eax,edx
		mov [esi+ecx],bl
		lea edx,[eax+eax*2]
		shl edx,3
		sub edx,eax
		shl edx,3
		sub edx,eax
		lea edx,[eax+edx*4]
		shl edx,5
		sub edx,eax
		sub edx,3596h
		inc ecx
		cmp ecx,iLen
		jnz _next1

		mov edx,iLen
		xor ecx,ecx
		xor eax,eax
		dec edx
		mov esi,pBuffer
_next3:
		add al,[esi+ecx]
		inc ecx
		cmp ecx,edx
		jnz _next3
		xor al,byte ptr key1
		mov dl,byte ptr key2
		imul dl
		cmp [esi+ecx],al
		jz _next5
		mov eax,1
		jmp _next4
_next5:
		xor eax,eax
_next4:
		mov iResult,eax
	mov eax,iResult
	ret
CallCrypt	endp

CallUnCrypt	proc uses esi edi ebx,pBuffer:DWORD,iLen:DWORD,key1:DWORD,key2:DWORD
		mov edx,iLen
		xor ecx,ecx
		xor eax,eax
		dec edx
		mov esi,pBuffer
_next3:
		add al,[esi+ecx]
		inc ecx
		cmp ecx,edx
		jnz _next3
		xor al,byte ptr key1
		mov dl,byte ptr key2
		imul dl
		mov [esi+ecx],al

		mov edx,4bch
		xor ecx,ecx
		xor eax,eax
		mov esi,pBuffer
_next1:
		mov al,[esi+ecx]
		mov bl,dh
		xor bl,al
		movzx eax,bl
		add eax,edx
		mov [esi+ecx],bl
		lea edx,[eax+eax*2]
		shl edx,3
		sub edx,eax
		shl edx,3
		sub edx,eax
		lea edx,[eax+edx*4]
		shl edx,5
		sub edx,eax
		sub edx,3596h
		inc ecx
		cmp ecx,iLen
		jnz _next1
		ret
CallUnCrypt	endp

CallCalcProc	proc  uses esi edi ebx,pBuffer:DWORD,iLen:DWORD,lpkey:DWORD
	mov esi,pBuffer
	mov eax,lpkey
	mov [esi],eax
	sub iLen,4
	mov edx,[esi]
	add esi,4
	xor ecx,ecx
	xor eax,eax
_next1:
	mov al,[esi+ecx]
	mov bl,dh
	xor bl,al
	movzx ax,al
	add eax,edx
	mov [esi+ecx],bl
	lea edx,[eax+eax*2]
	shl edx,3
	sub edx,eax
	shl edx,3
	sub edx,eax
	lea edx,[eax+edx*4]
	shl edx,5
	sub edx,eax
	sub edx,1234h
	inc ecx
	cmp ecx,iLen
	jnz _next1
	ret
CallCalcProc	endp

CallUnCalcProc	proc uses esi edi ebx,pBuffer:DWORD,iLen:DWORD
	mov esi,pBuffer
	mov edx,[esi]
	add esi,4
	xor ecx,ecx
	xor eax,eax
_next1:
	mov al,[esi+ecx]
	mov bl,dh
	xor bl,al
	movzx eax,bl
	add eax,edx
	mov [esi+ecx],bl
	lea edx,[eax+eax*2]
	shl edx,3
	sub edx,eax
	shl edx,3
	sub edx,eax
	lea edx,[eax+edx*4]
	shl edx,5
	sub edx,eax
	sub edx,1234h
	inc ecx
	cmp ecx,iLen
	jnz _next1
	ret
CallUnCalcProc	endp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -