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

📄 struct.asm

📁 一个十六进制编辑器源代码,cool!
💻 ASM
字号:
;结构映射
.data
	szFileStruct db 'struct.ini',0
DlgFileStructProc proto :DWORD,:DWORD,:DWORD,:DWORD
.code
DlgFileStructProc proc uses esi edi ebx @hDlg,uMsg,wParam,lParam
local @szBufSection[100]:BYTE ,@szBufKey[100]:BYTE ,@szBuf[200]:BYTE 
	mov eax,uMsg
	.if eax==WM_INITDIALOG
		invoke _IniSetFileName,addr szFileStruct,0
		call _IniGetSections
		mov esi,lpIniBuf
		.while BYTE ptr [esi]
			__senddlgmessage 1002,CB_ADDSTRING ,0,esi
			invoke lstrlen,esi
			inc eax
			add esi,eax
		.endw
		invoke SendMessage,@hDlg,WM_COMMAND ,1006,0
		invoke SendDlgItemMessage,@hDlg,1007,BM_SETCHECK ,1,0
	.elseif eax==WM_COMMAND
		mov eax,wParam
		.if ax==1004
			invoke GetDlgItemText,@hDlg,1002,addr @szBufSection,255
			.if eax
						invoke _IniSetFileName,addr szFileStruct,0
						invoke _IniGetSectionKeys,addr @szBufSection
						invoke IsDlgButtonChecked,@hDlg,1007
						.if eax
							__senddlgmessage 1003,LB_RESETCONTENT
						.endif
						mov esi,lpIniBuf
						.while BYTE ptr [esi]						
							invoke lstrcpy,addr @szBufKey,esi
							.while BYTE ptr [eax]!='='
								inc eax
							.endw
							mov BYTE ptr [eax],0

							invoke _IniGetInt,addr @szBufSection,addr @szBufKey
							push eax
							__senddlgmessage 1003,LB_ADDSTRING ,0,addr @szBufKey
							pop ebx
							__senddlgmessage 1003,LB_SETITEMDATA ,eax,ebx
							invoke lstrlen,esi
							inc eax
							add esi,eax
						.endw
			.endif
		.elseif ax==1006
			invoke wsprintf,addr @szBuf,ctext("%08Xh"),dwBlockEnd
			invoke SetDlgItemText,@hDlg,1005,addr @szBuf
		.else
			shr eax,16
			.if ax==LBN_DBLCLK
					invoke _GetInt,@hDlg,1005
					push eax
					__senddlgmessage 1003,LB_GETCURSEL 
					mov esi,eax
					xor edi,edi
					xor ebx,ebx
					.while edi<esi
						__senddlgmessage 1003,LB_GETITEMDATA ,edi
						add ebx,eax
						inc edi
					.endw
					pop eax
					add ebx,eax
					mov dwBlockStart,ebx
					mov dwCurPos,ebx
					__senddlgmessage 1003,LB_GETITEMDATA,esi
					add ebx,eax
					dec ebx
					mov dwBlockEnd,ebx					
					call _Scroll2Visible
			.endif
		.endif	
	.elseif eax==WM_CLOSE
		invoke ShowWindow,@hDlg,SW_HIDE 
	.else
		xor eax,eax
		ret
	.endif
	mov eax,TRUE
	ret
DlgFileStructProc endp

⌨️ 快捷键说明

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