神州数码解密程序32位汇编版

out33.asm

;triones produce it form 12:04 2006-1-10 to 11:30 2006-1-12 Windows XP SP1.
;作为对32位汇编熟悉的一个测试。
;具体版权声明与使用说明请参见"使用说明",欢迎交流与探讨.

.386
.model flat, stdcall
option casemap :none

include		windows.inc
include		user32.inc
includelib	user32.lib
include		kernel32.inc
includelib	kernel32.lib
include		comdlg32.inc
includelib	comdlg32.lib
include		shell32.inc
includelib	shell32.lib

ICO_MAIN	equ	1000
DLG_MAIN	equ	1000
IDM_MAIN	equ	4210

IDC_INF		equ	1001
IDC_Load	equ	1002
IDC_Pass	equ	1003
IDC_Password	equ	1004
IDC_OPEN	equ	1005
IDC_copyright	equ	1006
IDC_help 	equ	1007
IDC_EXIT	equ	1100


.data?
hInstance	dd	?
hWinMain	dd	?
szProfileName	db	MAX_PATH dup (?)	;主要路径
szPass		db	100 dup (?)
lpInfo		dd	?				;A Piont to pinot some output infomation
icheck		dd	?

.const
theKey		db	0Bh,1Eh,49h,60h,0Fh,78h,27h,5Eh,25h,02h,77h,2Ah,55h,20h,35h,7Ah,1Bh,0Eh,59h,47h
szCopyRight	db	10,"江西理工大学 环境032班  ",10,10,9,"章文雄",10,10,"  版权所有  2006(c)",0
szCRCaption	db	"版权声明",0
szHelp		db	22h,"使用说明",22h,"文件丢失!",0
szHelpName	db	"使用说明.txt",0
szWarning	db	"出错:",10,10,"-不存在密文",10,"-非神州数码INI文件",0
szhaha		db	"搞笑呢大哥,这哪个牛人的密码哦,谢绝程序测试 -_|||",0
szFilter	db	'*.ini',0,'*.ini',0,'所有文件',0,'*.*',0,0
szALoad		db	'C:/Progra~1/Digita~1/Digial~1'
szFileName	db	'/dot1xS~1.ini',0		;文件名修改这里
szSec		db	'登录参数',0		;小节名修改这里
szKey		db	'Password',0		;键名修改这里
FindInOwn	db	'-当前目录Find,解密结果:',0
FindInLoad	db	'-安装文件夹Find,解密结果:',0
FindInNone	db	'-未找到或密码未保存,请指定或输入密文:',0
FindInput	db	'-以下即输入密文的解密结果:',0
FindInpoint	db	'-指定文件分析结果:',0

.code


;主要的解密操作过程
Out33		proc
	
	pushad
	
	lea esi,offset szPass
	lea ebx,offset theKey
	mov edi,esi
	xor eax,eax
	xor ecx,ecx
	cld
	;主限制了16位的密码解密,如果要增加长度,可以把32改大点喽.
	.while ecx < 32
		lodsb
		.break .if al==0
		inc ecx
		mov	ah,al
		lodsb
		.break .if al==0
		inc ecx
		and	ax,4f4fh
		.if al > 40h
			sub	al,37h
		.endif
		.if ah > 40h
			sub	ah,37h
		.endif
		shl ah,4
		add al,ah
		mov ah,[ebx]
		xor al,ah
		.if (al < 21h)||(al > 7Eh)
			invoke	MessageBox,hWinMain,addr szhaha,NULL,MB_OK or MB_ICONWARNING
			jmp	@F
		.endif
		stosb
		inc ebx
	.endw
	xor al,al
	stosb
	invoke	SetDlgItemText,hWinMain,IDC_Password,addr szPass
@@:	
	popad	
	ret

Out33 endp

GetInput	proc
	
	pushad
	invoke	GetDlgItemText,hWinMain,IDC_Pass,addr szPass,128
	invoke	SetDlgItemText,hWinMain,IDC_INF,addr FindInput
	invoke	Out33
	popad	
	ret

GetInput endp


;从INI文件中取得密文
GetPass	proc

	local	@szBuffer[100]:byte
	pushad
	
	invoke	GetPrivateProfileString,addr szSec,addr szKey,NULL,addr szPass,99,addr szProfileName
	.if	eax == 0
		mov	eax,icheck
		.if	eax == 0
			invoke	GetPrivateProfileString,addr szSec,addr szKey,NULL,addr szPass,99,addr szALoad
			.if	eax == 0
				invoke	SetDlgItemText,hWinMain,IDC_INF,addr FindInNone
				jmp	@F
			.endif
			invoke	SetDlgItemText,hWinMain,IDC_Load,addr szALoad
			mov	lpInfo,offset	FindInLoad
			jmp	secYes
		.endif
		invoke	MessageBox,hWinMain,addr szWarning,NULL,MB_OK or MB_ICONWARNING
		jmp	@F
	.endif
	invoke	SetDlgItemText,hWinMain,IDC_Load,addr szProfileName
secYes:
	invoke	SetDlgItemText,hWinMain,IDC_INF,lpInfo
	invoke	SetDlgItemText,hWinMain,IDC_Pass,addr szPass
	invoke Out33
@@:
	popad
	ret

GetPass	endp

StratGet proc

	pushad
	invoke	GetCurrentDirectory,MAX_PATH,addr szProfileName
	mov	esi,offset szProfileName
	invoke	lstrlen,esi
	mov	ecx,offset szFileName
	.if	byte ptr [esi+eax-1] == '/'
		inc	ecx
	.endif
	invoke	lstrcat,esi,ecx
	mov	icheck,0
	invoke	GetPass
	popad
	ret
	
StratGet endp

GetFileName	proc

	local	stFile:OPENFILENAME
	
	pushad
	invoke	RtlZeroMemory,addr stFile,sizeof stFile
	mov	stFile.lStructSize,sizeof stFile
	push	hWinMain
	pop	stFile.hwndOwner
	mov	stFile.lpstrFilter,offset szFilter
	mov	stFile.lpstrFile,offset szProfileName	;文件的全路径放在这里喽
	mov	stFile.nMaxFile,MAX_PATH
	mov	stFile.Flags,OFN_FILEMUSTEXIST or OFN_PATHMUSTEXIST
	invoke	GetOpenFileName,addr stFile
	.if	eax != 0
		mov	lpInfo,offset	FindInpoint
		invoke	GetPass
	.endif
	popad
	ret

GetFileName endp

DlgMain	proc	hWnd,wMsg,wParam,lParam

	local	@szBuffer[256]:byte
	
	pushad
	mov	eax,wMsg
	
	.if	eax ==	WM_CLOSE
		invoke	EndDialog,hWnd,NULL
		
	.elseif	eax ==	WM_INITDIALOG
			push	hWnd
			pop	hWinMain
			invoke	LoadIcon,hInstance,ICO_MAIN
			invoke	SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
			xor ecx,ecx
			mov	icheck,ecx		;set the icheck to 0 and check two path have the ini.
			inc	ecx
			mov	lpInfo,offset	FindInOwn
			invoke	StratGet
			mov	icheck,ecx
	.elseif	eax ==	WM_COMMAND
		mov	eax,wParam
		.if	ax ==	IDOK
			invoke	GetInput
		.elseif ax == IDC_copyright
			invoke	MessageBox,hWnd,addr szCopyRight,addr szCRCaption,MB_OK or MB_ICONINFORMATION
		.elseif	ax == IDC_help
			invoke	ShellExecute,0,0,addr szHelpName,0,0,SW_SHOW
			.if	eax < 31
				invoke	MessageBox,hWnd,addr szHelp,NULL,MB_OK or MB_ICONWARNING
			.endif
		.elseif	ax == IDC_OPEN
			invoke	GetFileName
		.elseif	ax == IDC_EXIT
			invoke	EndDialog,hWnd,NULL
		.endif
	.else
		mov	eax,FALSE
		ret
	.endif
	
	mov	eax,TRUE
	popad
	ret
DlgMain	endp


start:
		invoke	GetModuleHandle,NULL
		mov	hInstance,eax
		invoke	DialogBoxParam,eax,DLG_MAIN,NULL,offset DlgMain,NULL
		invoke	ExitProcess,NULL

		end	start


out22.rc
#include  "D:/masm32/include/resource.h"

#define	ICO_MAIN	1000
#define	DLG_MAIN	1000

#define	IDM_MAIN	4210

#define	IDC_INF		1001
#define	IDC_Load	1002
#define	IDC_Pass	1003
#define	IDC_Password	1004
#define IDC_OPEN	1005
#define IDC_copyright	1006
#define IDC_help 	1007
#define	IDC_EXIT	1100


ICO_MAIN	ICON		"cm02_triones.ico"

DLG_MAIN DIALOG 240,200,200,100
MENU	IDM_MAIN
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_3DLOOK
CAPTION "OUT3.3 (Win32ASM ver 0.2)"
FONT 9, "宋体"
{
 CONTROL "", -1, "Static", SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE,0,0,200,1
 GROUPBOX "神州数码解密程序32位汇编版",-1,2,5,196,92
 
 EDITTEXT IDC_Password,28,63,70,11,ES_READONLY
 
 EDITTEXT IDC_INF,4,15,192,12, ES_AUTOHSCROLL | ES_READONLY
 RTEXT "路径:",-1,4,36,25,10
 EDITTEXT IDC_Load,28,34,168,11, ES_AUTOHSCROLL | ES_READONLY
 RTEXT "密文:", -1,4,51,25,10
 EDITTEXT IDC_Pass, 28,49, 140, 11
 RTEXT "密码:", -1,4,64, 25, 10

 PUSHBUTTON	"解密(&J)",IDOK,144,63,50,14
 PUSHBUTTON	"打开文件(&O)",IDC_OPEN,5,80,50,14
 PUSHBUTTON	"关于(&A)",IDC_copyright,60,80,50,14
 PUSHBUTTON	"关闭(&X)",IDC_EXIT,144,80,50,14
 
}

IDM_MAIN	MENU	discardable
{
 popup	"操作(&F)"
	{
	 menuitem	"打开(&O).../tAlt+O",IDC_OPEN
	 menuitem	"解密(&J)/tAlt+J",IDOK
	 menuitem	separator
	 menuitem	"退出(&X)",IDC_EXIT
	}
 popup	"帮助(&H)"
	{
	 menuitem	"帮助(&H)",IDC_help
	 menuitem	separator
	 menuitem	"关于(&A)",IDC_copyright
	}
}


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值