;DriverStudio 3.2 注册机源码
INCLUDE c:\masm32\include\macros.inc
INCLUDE c:\masm32\include\windows.inc
INCLUDE c:\masm32\include\kernel32.inc
INCLUDE c:\masm32\include\user32.inc
INCLUDE c:\masm32\include\gdi32.inc
INCLUDE c:\masm32\include\comdlg32.inc
INCLUDE c:\masm32\include\comctl32.inc
;==================================================================================================
INCLIB c:\masm32\lib\kernel32.lib
INCLIB c:\masm32\lib\user32.lib
INCLIB c:\masm32\lib\gdi32.lib
INCLIB c:\masm32\lib\comdlg32.lib
INCLIB c:\masm32\lib\comctl32.lib
;==================================================================================================
.EQU APPICON ,10
.EQU MAINDLGBMP ,20
.EQU MAINDLG ,200
;--------------------------------------------------------------------------------------------------
.EQU IDC_SERIAL ,1000
.EQU IDC_LICENSE ,1001
;==================================================================================================
defdata?
;==================================================================================================
VAR hInstance:HINSTANCE
VAR gBuffer:CHAR,16 DUP(?)
VAR FilePath:CHAR,MAX_PATH DUP(?)
;==================================================================================================
defdata
;==================================================================================================
VAR Seed:UINT,12345678
;==================================================================================================
defcode
;==================================================================================================
;显示打开文件对话框。
;==================================================================================================
PROCPRV SaveFileDlg,hWnd@:HWND
;------------------------
LOCAL @ofn:OPENFILENAME
;------------------------
mov @ofn.lStructSize,SIZEOF OPENFILENAME
mtm @ofn.hWndOwner,hWnd@
mov @ofn.hInstance,NULL
mtm @ofn.lpstrFilter,_T("授权文件(*.lic)",0,"*.lic",0,"所有文件(*.*)",0,"*.*",0)
mov @ofn.nFilterIndex,1
mtm @ofn.lpstrFile,_A(FilePath)
mov @ofn.nMaxFile,MAX_PATH
mov @ofn.lpstrFileTitle,NULL
mov @ofn.nMaxFileTitle,0
mov @ofn.lpstrInitialDir,0
mtm @ofn.lpstrTitle,_T("授权文件保存为")
mtm @ofn.lpstrDefExt,_T("lic")
mov @ofn.lpstrCustomFilter,NULL
mov @ofn.nMaxCustFilter,0
mov @ofn.nFileOffset,0
mov @ofn.nFileExtension,0
mov @ofn.Flags,OFN_OVERWRITEPROMPT OR OFN_HIDEREADONLY
mov @ofn.lCustData,0
mov @ofn.lpfnHook,NULL
mov @ofn.lpTemplateName,NULL
.IF !FilePath
;{
invoke lstrcpyn,_A(FilePath),_T("DriverStudio.lic"),MAX_PATH
;}
.ENDIF
invoke GetSaveFileName,_A(@ofn)
return
ENDPROC
;==================================================================================================
.LABEL License:BYTE
;--------------------------------------------------------------------------------------------------
BYTE "FEATURE DriverStudio compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " 1847B0CF1A6E VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=174",0dh,0ah
BYTE "FEATURE SoftICE-Suite compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " B0D576FFDFAB VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=182",0dh,0ah
BYTE "FEATURE DevPartner64 compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " B2A367EF918B VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=94",0dh,0ah
BYTE "FEATURE VisualSoftICE compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " FB1083353D54 VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=82",0dh,0ah
BYTE "FEATURE BoundsCheckerD compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " 0A7FE6A5A2EF VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=213",0dh,0ah
BYTE "FEATURE TrueCoverageD compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " 1A0579B510D0 VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=71",0dh,0ah
BYTE "FEATURE TrueTimeD compuware 003.020 23-jun-2023 uncounted \",0dh,0ah
BYTE " 43BE7D6A8D79 VENDOR_STRING=10000;0;FIXED HOSTID=ANY \",0dh,0ah
BYTE " ISSUER=PARAROX ISSUED=23-jun-2003 ck=156",0dh,0ah
BYTE "FEATURE SI-4-DPS compuware 003.020 23-jun-2023 uncounted B927628A36D3 \",0dh,0ah
BYTE " VENDOR_STRING=10000;0;FIXED HOSTID=ANY ISSUER=PARAROX \",0dh,0ah
BYTE " ISSUED=23-jun-2003 ck=149",0dh,0ah
BYTE "FEATURE SoftICE compuware 003.020 23-jun-2023 uncounted 5B502D5845E0 \",0dh,0ah
BYTE " VENDOR_STRING=10000;0;FIXED HOSTID=ANY ISSUER=PARAROX \",0dh,0ah
BYTE " ISSUED=23-jun-2003 ck=117",0dh,0ah
;--------------------------------------------------------------------------------------------------
.EQU cbLicense,%($-License) ;注意此处必须使用%运算符,否则计算的结果不正确
;==================================================================================================
PROCPRV GenLicense,hWnd@:HWND,pszFileName@:LPCSTR
;----------------------
LOCAL @hFile :HANDLE
LOCAL @cbWrite:UINT
;----------------------
invoke SaveFileDlg,hWnd@
.IF eax
;{
;----------------------------------------------------------
;生成文件的完整路径并创建它然后将资源中对应的数据写入该文件
;----------------------------------------------------------
invoke CreateFile,_A(FilePath),GENERIC_WRITE,FILE_SHARE_READ,
NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
.IF eax!=INVALID_HANDLE_VALUE
;{
mov @hFile,eax
;--------------------------
;将资源中对应的数据写入文件
;--------------------------
invoke WriteFile,@hFile,_A(License),cbLicense,_A(@cbWrite),NULL
invoke CloseHandle,@hFile
invoke MessageBox,hWnd@,_T("生成授权文件成功!"),
_T("DriverStudio3.2注册机"),MB_OK OR MB_ICONINFORMATION
;}
.ELSE
;{
invoke MessageBox,hWnd@,_T("生成授权文件失败!"),
_T("DriverStudio3.2注册机"),MB_OK OR MB_ICONSTOP
;}
.ENDIF
;}
.ENDIF
return
ENDPROC
;==================================================================================================
PROCPRV Random,Range@:UINT
mov eax,Seed
xor edx,edx
mov ecx,1f31dh
div ecx
mov ecx,eax
mov eax,41a7h
mul edx
mov edx,ecx
mov ecx,eax
mov eax,0b14h
mul edx
sub ecx,eax
xor edx,edx
mov eax,ecx
mov Seed,ecx
div Range@
return edx
ENDPROC
;==================================================================================================
.LABEL Encode:BYTE
BYTE 0fh,01h,0bh,03h,08h,04h,0dh,07h,0ch,00h,0ah,0ch,01h,08h,02h,00h
BYTE 09h,0fh,05h,0bh,09h,05h,0ch,02h,07h,06h,0fh,04h,0eh,0ah,03h,04h
BYTE 0ch,0bh,01h,0ah,0dh,08h,00h,0eh,0dh,01h,06h,0bh,08h,0ah,0eh,04h
BYTE 03h,0ch,07h,0bh,06h,0ah,05h,09h,04h,08h,00h,03h,00h,0dh,03h,0fh
BYTE 0ah,08h,02h,0ch,04h,06h,09h,05h,0dh,01h,03h,0bh,0ch,04h,02h,08h
;==================================================================================================
PROCPRV GenKey
;-----------------------
LOCAL @Buffer[16]:CHAR
;-----------------------
mov UINT PTR gBuffer,383837h
mov UINT PTR @Buffer,080807h
invoke Random,10
mov @Buffer+3,al
add al,30h
mov gBuffer+3,al
mov gBuffer+4,'-'
invoke Random,10
mov @Buffer+4,al
add al,30h
mov gBuffer+5,al
invoke Random,10
mov @Buffer+5,al
add al,30h
mov gBuffer+6,al
invoke Random,10
mov @Buffer+6,al
add al,30h
mov gBuffer+7,al
invoke Random,10
mov @Buffer+7,al
add al,30h
mov gBuffer+8,al
xor eax,eax
mov edx,_A(Encode)
cycle
;{
movsx ecx,@Buffer[eax]
mov cl,BYTE PTR [ecx+edx]
mov @Buffer[eax],cl
add edx,10
inc eax
breakat eax>=8
;}
endc
mov al,@Buffer
xor al,@Buffer+4
or al,@Buffer+7
add al,30h
.IF al>39h
;{
add al,7
;}
.ENDIF
mov gBuffer+9,al
mov al,@Buffer+1
xor al,@Buffer+5
or al,@Buffer+7
add al,30h
.IF al>39h
;{
add al,7
;}
.ENDIF
mov gBuffer+10,al
mov gBuffer+11,'-'
mov al,@Buffer+2
xor al,@Buffer+6
or al,@Buffer+7
add al,30h
.IF al>39h
;{
add al,7
;}
.ENDIF
mov gBuffer+12,al
mov al,@Buffer+3
xor al,@Buffer+7
or al,@Buffer+7
add al,30h
.IF al>39h
;{
add al,7
;}
.ENDIF
mov gBuffer+13,al
mov gBuffer+14,0
return _A(gBuffer)
ENDPROC
;==================================================================================================
PROCPRV WmMainDlgInitDialog,hDlg@:HWND
invoke SetWindowPos,hDlg@,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE
invoke LoadIcon,hInstance,APPICON
invoke SendMessage,hDlg@,WM_SETICON,ICON_SMALL,eax
invoke GenKey
invoke SetDlgItemText,hDlg@,IDC_SERIAL,eax
return
ENDPROC
;==================================================================================================
PROCPRV WmMainDlgCommand,hDlg@:HWND,wParam@:WPARAM
movzx eax,WORD PTR wParam@
case IDOK
invoke GenKey
invoke SetDlgItemText,hDlg@,IDC_SERIAL,eax
andcase IDCANCEL
invoke PostMessage,hDlg@,WM_CLOSE,0,0
andcase IDC_LICENSE
invoke GenLicense,hDlg@,_T("DriverStudio.dat")
default
return FALSE
endcase
return TRUE
ENDPROC
;==================================================================================================
PROCPRV MainDlgProc,hDlg@:HWND,uMsg@:UINT,wParam@:WPARAM,lParam@:LPARAM
switch uMsg@
case WM_INITDIALOG
invoke WmMainDlgInitDialog,hDlg@
andcase WM_COMMAND
invoke WmMainDlgCommand,hDlg@,wParam@
return
andcase WM_CLOSE
invoke EndDialog,hDlg@,0
default
return FALSE
endcase
return TRUE
ENDPROC
;==================================================================================================
Start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,hInstance,MAINDLG,NULL,_A(MainDlgProc),0
invoke ExitProcess,0
invoke InitCommonControls
;==================================================================================================
END Start
;资源文件
#include "c:\masm32\include\resource.rh"
//=====================================================================================================================
#define APPICON 10
#define MAINDLGBMP 20
#define MAINDLG 200
//---------------------------------------------------------------------------------------------------------------------
#define IDC_SERIAL 1000
#define IDC_LICENSE 1001
//=====================================================================================================================
APPICON ICON DISCARDABLE "Keygen.ico"
//=====================================================================================================================
MAINDLG DIALOG DISCARDABLE 0,0,144,68
STYLE DS_MODALFRAME|DS_CENTER|WS_POPUP|WS_VISIBLE|WS_CLIPCHILDREN|WS_CAPTION|WS_SYSMENU
CAPTION "DriverStudio3.2注册机"
FONT 9,"宋体"
BEGIN
DEFPUSHBUTTON "生成序列号",IDOK,16,43,47,14
PUSHBUTTON "生成授权文件",IDC_LICENSE,73,43,55,14
LTEXT "序列号:",IDC_STATIC,16,13,32,8
EDITTEXT IDC_SERIAL,51,11,77,12,ES_CENTER|ES_AUTOHSCROLL|ES_READONLY
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,33,146,1
END
//=====================================================================================================================
MANIFESTID RT_MANIFEST DISCARDABLE
BEGIN
"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>\r\n" //,
"<assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0"">\r\n" //,
"<assemblyIdentity\r\n" //,
" version=""1.0.0.0""\r\n" //,
" processorArchitecture=""X86""\r\n" //,
" name=""hechuang.liyanchang.application""\r\n" //,
" type=""win32""/>\r\n" //,
"<description>MSN Messenger Service</description>\r\n" //,
"<dependency>\r\n" //,
" <dependentAssembly>\r\n" //,
" <assemblyIdentity\r\n" //,
" type=""win32""\r\n" //,
" name=""Microsoft.Windows.Common-Controls""\r\n" //,
" version=""6.0.0.0""\r\n" //,
" processorArchitecture=""X86""\r\n" //,
" publicKeyToken=""6595b64144ccf1df""\r\n" //,
" language=""*""/>\r\n" //,
" </dependentAssembly>\r\n" //,
"</dependency>\r\n" //,
"</assembly>\r\n"
END
//=====================================================================================================================
VERSIONID VERSIONINFO
FILEVERSION 1,0,0,0
FILETYPE 0x1L
//FILEOS 0x50000L
//PRODUCTVERSION 1,0,0,0
//FILEFLAGSMASK 0x3fL
//FILEFLAGS 0x0L
//FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080404b0"
BEGIN
VALUE "CompanyName" ,"hchzdh@public.ty.sx.cn\0"
VALUE "FileDescription" ,"DriverStudio3.2注册机\0"
VALUE "ProductName" ,"DriverStudio3.2注册机\0"
VALUE "FileVersion" ,"1.0\0"
VALUE "LegalCopyright" ,"版权所有:hchzdh,2005\0"
//VALUE "ProductVersion" ,"1.0\0"
//VALUE "LegalTrademarks" ,"\0"
//VALUE "OriginalFilename" ,"Keygen.exe\0"
//VALUE "PrivateBuild" ,"\0"
//VALUE "InternalName" ,"DriverStudio3.2注册机\0"
//VALUE "SpecialBuild" ,"\0"
//VALUE "Comments" ,"\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation",0x804,1200
END
END
;[说明]MASM32宏定义文件
;[作者]李彦昌
;[更新]2004年9月
;======================================================================================================================
.586P
.MODEL FLAT,STDCALL
;----------------------------------------
;下面的语句指定所有的标号均为函数内部私有
;----------------------------------------
OPTION SCOPED
OPTION CASEMAP:NONE ;区分大小写
OPTION PROC:PRIVATE
OPTION DOTNAME
OPTION LJMP
;======================================================================================================================
IFNDEF _MACROS_INC
_MACROS_INC EQU 1
;----------------------------------------------------------------------------------------------------------------------
;存储段描述符结构类型定义
;----------------------------------------------------------------------------------------------------------------------
DESC STRUC
LimitL DW 0 ;段界限(BIT0-15)
BaseL DW 0 ;段基地址(BIT0-15)
BaseM DB 0 ;段基地址(BIT16-23)
Attributes DB 0 ;段属性
LimitH DB 0 ;段界限(BIT16-19)(含段属性的高4位)
BaseH DB 0 ;段基地址(BIT24-31)
DESC ENDS
;----------------------------------------------------------------------------------------------------------------------
;门描述符结构类型定义
;----------------------------------------------------------------------------------------------------------------------
GATE STRUC
OffsetL DW 0 ;32位偏移的低16位
Selector DW 0 ;选择子
DCount DB 0 ;双字计数
GType DB 0 ;类型
OffsetH DW 0 ;32位偏移的高16位
GATE ENDS
;----------------------------------------------------------------------------------------------------------------------
;伪描述符结构类型定义(用于装入全局或中断描述符表寄存器)
;----------------------------------------------------------------------------------------------------------------------
PDESC STRUC
Limit DW 0 ;16位界限
Base DD 0 ;32位基地址
PDESC ENDS
;----------------------------------------------------------------------------------------------------------------------
;任务状态段结构类型定义
;----------------------------------------------------------------------------------------------------------------------
TSS STRUC
TRLink DW 0 ;链接字段
DW 0 ;不使用,置为0
TRESP0 DD 0 ;0级堆栈指针
TRSS0 DW 0 ;0级堆栈段寄存器
DW 0 ;不使用,置为0
TRESP1 DD 0 ;1级堆栈指针
TRSS1 DW 0 ;1级堆栈段寄存器
DW 0 ;不使用,置为0
TRESP2 DD 0 ;2级堆栈指针
TRSS2 DW 0 ;2级堆栈段寄存器
DW 0 ;不使用,置为0
TRCR3 DD 0 ;CR3
TREIP DD 0 ;EIP
TREFlag DD 0 ;EFLAGS
TREAX DD 0 ;EAX
TRECX DD 0 ;ECX
TREDX DD 0 ;EDX
TREBX DD 0 ;EBX
TRESP DD 0 ;ESP
TREBP DD 0 ;EBP
TRESI DD 0 ;ESI
TREDI DD 0 ;EDI
TRES DW 0 ;ES
DW 0 ;不使用,置为0
TRCS DW 0 ;CS
DW 0 ;不使用,置为0
TRSS DW 0 ;SS
DW 0 ;不使用,置为0
TRDS DW 0 ;DS
DW 0 ;不使用,置为0
TRFS DW 0 ;FS
DW 0 ;不使用,置为0
TRGS DW 0 ;GS
DW 0 ;不使用,置为0
TRLDTR DW 0 ;LDTR
DW 0 ;不使用,置为0
TRTrip DW 0 ;调试陷阱标志(只用位0)
TRIOMap DW $+2 ;指向I/O许可位图区的段内偏移
TSS ENDS
;----------------------------------------------------------------------------------------------------------------------
;存储段描述符类型值说明
;----------------------------------------------------------------------------------------------------------------------
ATDR = 90h ;存在的只读数据段类型值
ATDW = 92h ;存在的可读写数据段属性值
ATDWA = 93h ;存在的已访问可读写数据段类型值
ATCE = 98h ;存在的只执行代码段属性值
ATCER = 9ah ;存在的可执行可读代码段属性值
ATCCO = 9ch ;存在的只执行一致代码段属性值
ATCCOR = 9eh ;存在的可执行可读一致代码段属性值
;----------------------------------------------------------------------------------------------------------------------
;系统段描述符类型值说明
;----------------------------------------------------------------------------------------------------------------------
ATLDT = 82h ;局部描述符表段类型值
ATTaskGate = 85h ;任务门类型值
AT386TSS = 89h ;可用386任务状态段类型值
AT386CGate = 8ch ;386调用门类型值
AT386IGate = 8eh ;386中断门类型值
AT386TGate = 8fh ;386陷阱门类型值
;----------------------------------------------------------------------------------------------------------------------
;DPL值说明
;----------------------------------------------------------------------------------------------------------------------
DPL0 = 00h ;DPL=0
DPL1 = 20h ;DPL=1
DPL2 = 40h ;DPL=2
DPL3 = 60h ;DPL=3
;----------------------------------------------------------------------------------------------------------------------
;RPL值说明
;----------------------------------------------------------------------------------------------------------------------
RPL0 = 00h ;RPL=0
RPL1 = 01h ;RPL=1
RPL2 = 02h ;RPL=2
RPL3 = 03h ;RPL=3
;----------------------------------------------------------------------------------------------------------------------
;IOPL值说明
;----------------------------------------------------------------------------------------------------------------------
IOPL0 = 0000h ;IOPL=0
IOPL1 = 1000h ;IOPL=1
IOPL2 = 2000h ;IOPL=2
IOPL3 = 3000h ;IOPL=3
;----------------------------------------------------------------------------------------------------------------------
;其它常量值说明
;----------------------------------------------------------------------------------------------------------------------
D32 = 40h ;32位代码段标志
GL = 80h ;段界限以4K为单位标志
TIL = 04h ;TI=1(局部描述符表标志)
VMFL = 00020000h ;VMF=1
VMFLW = 0002h
IFL = 00000200h ;IF=1
RFL = 00010000h ;RF=1(重启动标志,为1表示忽略调试故障)
RFLW = 0001h
NTL = 00004000h ;NT=1
;----------------------------------------------------------------------------------------------------------------------
;分页机制使用的常量说明
;----------------------------------------------------------------------------------------------------------------------
PL = 1 ;页存在属性位
RWR = 0 ;R/W属性位值,读/执行
RWW = 2 ;R/W属性位值,读/写/执行
USS = 0 ;U/S属性位值,系统级
USU = 4 ;U/S属性位值,用户级
;======================================================================================================================
SIGNEDD EQU <SDWORD PTR>
SIGNEDW EQU <SWORD PTR>
SIGNEDB EQU <SBYTE PTR>
;======================================================================================================================
return MACRO Value@
IFNB <Value@>
IFDIFI <Value@>,<eax>
mov eax,Value@
ENDIF
ENDIF
ret
ENDM
;======================================================================================================================
;switch EQU <mov eax,>
;case EQU <.IF eax==>
;andcase EQU <.ELSEIF eax==>
;orcase EQU < || eax==>
default EQU <.ELSE>
endcase EQU <.ENDIF>
switch MACRO Value@
IFDIFI <Value@>,<eax>
mov eax,Value@
ENDIF
ENDM
case MACRO Condition@:VARARG
LOCAL arg@,Args@,Index@
Index@ = 0
Args@ TEXTEQU <>
FOR arg@,<Condition@>
IF Index@
Args@ CATSTR Args@,< || >
ELSE
Index@ = 1
ENDIF
Args@ CATSTR Args@,<eax==(>,<arg@>,<)>
ENDM
.IF Args@
ENDM
andcase MACRO Condition@:VARARG
LOCAL arg@,Args@,Index@
Index@ = 0
Args@ TEXTEQU <>
FOR arg@,<Condition@>
IF Index@
Args@ CATSTR Args@,< || >
ELSE
Index@ = 1
ENDIF
Args@ CATSTR Args@,<eax==(>,<arg@>,<)>
ENDM
.ELSEIF Args@
ENDM
;======================================================================================================================
cycle EQU <.WHILE 1>
endc EQU <.ENDW>
breakc EQU <.BREAK>
breakat EQU <.BREAK .IF>
renew EQU <.CONTINUE>
renewat EQU <.CONTINUE .IF>
;======================================================================================================================
??segment??type?? = 7fh
;----------------------------------------------------------------------------------------------------------------------
defdata MACRO
??segment??type?? = 0
.DATA
ENDM
;----------------------------------------------------------------------------------------------------------------------
defdata? MACRO
??segment??type?? = 1
.DATA?
ENDM
;----------------------------------------------------------------------------------------------------------------------
defconst MACRO
??segment??type?? = 2
.CONST
ENDM
;----------------------------------------------------------------------------------------------------------------------
defcode MACRO CodeName@
??segment??type?? = 3
??code??segment??name TEXTEQU <CodeName@>
.CODE CodeName@
ENDM
;======================================================================================================================
define MACRO Token,Value
IFNB <Value>
Token EQU Value
ELSE
Token EQU <>
ENDIF
ENDM
@define EQU <define>
_define EQU <define>
;======================================================================================================================
OFF EQU <OFFSET>
OFF32 EQU <OFFSET FLAT:>
INCLIB EQU <INCLUDELIB>
DECLARE EQU <EXTERNDEF>
;======================================================================================================================
_A MACRO Var@
IF ((OPATTR (Var@)) AND 01000000b)
EXITM <ADDR Var@>
ELSE
EXITM <OFFSET Var@>
ENDIF
ENDM
;======================================================================================================================
LJUMP MACRO Selector,Offs
DB 0eah ;;操作码
DD Offs
DW Selector ;;段值或段选择子
ENDM
LCALL MACRO Selector,Offs
DB 9ah ;;操作码
DD Offs
DW Selector ;;段值或段选择子
ENDM
MJUMP EQU <jmp FWORD PTR>
MCALL EQU <call FWORD PTR>
NJUMP EQU <jmp DWORD PTR>
sjump EQU <NJUMP>
sjmp EQU <sjump>
NCALL EQU <call DWORD PTR>
scall EQU <NCALL>
;======================================================================================================================
DSZ MACRO Name@,Text@:VARARG
IFNB <Text@>
Name@ DB Text@,0
ELSE
Name@ DB 0
ENDIF
ENDM
;======================================================================================================================
m2m MACRO M1,M2
push M2
pop M1
ENDM
mtm MACRO M1,M2
mov eax,M2
mov M1,eax
ENDM
;======================================================================================================================
malloc PROTO C :DWORD
free PROTO C :PTR BYTE
;----------------------------------------------------------------------------------------------------------------------
new EQU <invoke malloc,>
delete EQU <invoke free,>
galloc EQU <invoke GlobalAlloc,>
gfree EQU <invoke GlobalFree,>
glock EQU <invoke GlobalLock,>
gunlock EQU <invoke GlobalUnlock,>
;======================================================================================================================
LOWORD MACRO bigword
mov eax,bigword
and eax,0ffffh
ENDM
HIWORD MACRO bigword
mov eax,bigword
shr eax,16
ENDM
MAKELONG MACRO l,h
mov ax,h
shl eax,16
mov ax,l
EXITM <eax>
ENDM
;======================================================================================================================
;RGB MACRO r,g,b
; xor eax,eax
; mov ah,b
; shl eax,8
; mov ah,g
; mov al,r
; ENDM
RGB MACRO r,g,b
EXITM %((((b)AND 0ffh) SHL 16)OR(((g)AND 0ffh) SHL 8)OR ((r)AND 0ffh))
ENDM
MRGB MACRO r,g,b
EXITM %((((r)AND 0ffh) SHL 16)OR(((g)AND 0ffh) SHL 8)OR ((b)AND 0ffh))
ENDM
PALETTERGB MACRO r,g,b
EXITM %((((b)AND 0ffh) SHL 16)OR(((g)AND 0ffh) SHL 8)OR ((r)AND 0ffh) OR 02000000h)
ENDM
PALETTEINDEX MACRO i
EXITM %((i) AND 0ffffh OR 01000000h)
ENDM
;======================================================================================================================
MAX MACRO word1,word2
mov eax,word1
.IF eax<word2
mov eax,word2
.ENDIF
ENDM
MIN MACRO word1,word2
mov eax,word1
.IF eax>word2
mov eax,word2
.ENDIF
ENDM
min EQU MIN
max EQU MAX
;======================================================================================================================
EXPPROC EQU <PROC EXPORT>
EXPFUNC EQU <PROC EXPORT USES ebx esi edi>
PRVPROC EQU <PROC PRIVATE>
PUBPROC EQU <PROC PUBLIC>
PRVFUNC EQU <PROC PRIVATE USES ebx esi edi>
PUBFUNC EQU <PROC PUBLIC USES ebx esi edi>
FUNC EQU <PROC USES ebx esi edi>
ENDPP EQU <ENDP>
ENDPF EQU <ENDP>
ENDEP EQU <ENDP>
ENDEF EQU <ENDP>
ENDF EQU <ENDP>
;======================================================================================================================
?marg MACRO name,num
?AM&num MACRO
push name
ENDM
ENDM
;======================================================================================================================
?invprg MACRO name
?AM&name
PURGE ?AM&name
ENDM
;======================================================================================================================
PushCParams MACRO arglst:VARARG
??_argc =0
IRP x,<arglst>
??_argc =??_argc+1
?marg <x>,%??_argc
ENDM
?count =??_argc
REPT ??_argc
?invprg %?count
?count =?count-1
ENDM
ENDM
;======================================================================================================================
ClearCParams MACRO
IF ??_argc NE 0
add esp,??_argc * 4
ENDIF
ENDM
;======================================================================================================================
gosub MACRO Function,paramlist:VARARG
IFB <Function>
EXITM
ENDIF
PushCParams <paramlist>
call Function
ENDM
;======================================================================================================================
;声明虚函数指针表结构的宏
;----------------------------------------------------------------------------------------------------------------------
BEGIN_VTABLE_DECLARE MACRO Interface,BaseInterface
LOCAL Count,BFUNCDEF
;;--------------------------
VFUNCDEF MACRO Function,Index,Types:VARARG
IFNB <Types>
??&Interface&_FuncPro_&Index TYPEDEF PROTO STDCALL :PTR,Types
ELSE
??&Interface&_FuncPro_&Index TYPEDEF PROTO STDCALL :PTR
ENDIF
??&Interface&_FuncPtr_&Index TYPEDEF PTR ??&Interface&_FuncPro_&Index
??&Interface&_FuncOff_&Index TEXTEQU <OFFSET Interface&_&Function>
??&Interface&_FuncName_&Index TEXTEQU <Function>
Function ??&Interface&_FuncPtr_&Index ?
ENDM ;;VFUNCDEF Macro
;;----------------------------------
IFB <BaseInterface>
??&Interface&_MethodNumber = 0
ELSE
??&Interface&_MethodNumber = ??&BaseInterface&_MethodNumber
ENDIF
;;-------------------------------------
VIRTUAL MACRO Function,Types:VARARG
;;-------------------------------------
VFUNCDEF Function,%(??&Interface&_MethodNumber),Types
??&Interface&_MethodNumber = ??&Interface&_MethodNumber+1
ENDM ;;VIRTUAL Macro
STDMETHOD TEXTEQU <VIRTUAL>
;;------------------------------------
LP_&Interface TEXTEQU <PTR Interface&_VTable>
Interface&_VTable STRUC
;;----------------------------------
IFNB <BaseInterface>
BFUNCDEF MACRO Index
??&Interface&_FuncPro_&Index TYPEDEF ??&BaseInterface&_FuncPro_&Index
??&Interface&_FuncPtr_&Index TYPEDEF PTR ??&Interface&_FuncPro_&Index
??&Interface&_FuncOff_&Index CATSTR <OFFSET >,<Interface>,<_>,??&BaseInterface&_FuncName_&Index
??&Interface&_FuncName_&Index TEXTEQU ??&BaseInterface&_FuncName_&Index
??&BaseInterface&_FuncName_&Index ??&Interface&_FuncPtr_&Index ?
ENDM
Count = 0
REPT ??&BaseInterface&_MethodNumber
BFUNCDEF %Count
Count = Count+1
ENDM
PURGE BFUNCDEF
ENDIF
ENDM
;----------------------------------------------------------------------------------------------------------------------
END_VTABLE_DECLARE MACRO Interface
Interface&_VTable ENDS
PURGE STDMETHOD
PURGE VIRTUAL
PURGE VFUNCDEF
ENDM
;----------------------------------------------------------------------------------------------------------------------
BEGIN_VTABLE_DEFINE TEXTEQU <BEGIN_VTABLE_DECLARE>
END_VTABLE_DEFINE TEXTEQU <END_VTABLE_DECLARE>
;----------------------------------------------------------------------------------------------------------------------
;实现虚函数指针表宏
;----------------------------------------------------------------------------------------------------------------------
IMPLEMENT_VTABLE MACRO Interface,Name
LOCAL nCount,IMPV
IMPV MACRO Index
DD ??&Interface&_FuncOff_&Index
ENDM
Name LABEL DWORD
nCount = 0
REPT ??&Interface&_MethodNumber
IMPV %(nCount)
nCount = nCount+1
ENDM
PURGE IMPV
ENDM
;======================================================================================================================
_PVT TEXTEQU <??m_pvfpTable??>
;======================================================================================================================
_BC MACRO BaseClass
EXITM <m_&BaseClass>
ENDM
;======================================================================================================================
BEGIN_CLASS_DECLARE MACRO Interface,BaseClass:VARARG
LOCAL Base,BMem
;;-------------------
CONSTRUCT MACRO Types:VARARG
IFNB <Types>
Interface&_Construct PROTO :PTR,Types
ELSE
Interface&_Construct PROTO :PTR
ENDIF
ENDM ;;CONSTRUCT
;;-------------------
DESTRUCT MACRO
Interface&_Destruct PROTO :PTR
ENDM ;;DESTRUCT
;;-------------------
METHOD MACRO Function,Types:VARARG
IFNB <args>
Interface&_&Function PROTO :PTR,Types
ELSE
Interface&_&Function PROTO :PTR
ENDIF
ENDM ;;METHOD
;;-------------------
Interface STRUC
_PVT DD 0
FOR Base,<BaseClass>
BMem CATSTR <m_>,<Base>
BMem Base {}
ENDM
ENDM
;----------------------------------------------------------------------------------------------------------------------
END_CLASS_DECLARE MACRO Interface
Interface ENDS
PURGE METHOD
PURGE DESTRUCT
PURGE CONSTRUCT
ENDM
;----------------------------------------------------------------------------------------------------------------------
BEGIN_CLASS_DEFINE TEXTEQU <BEGIN_CLASS_DECLARE>
END_CLASS_DEFINE TEXTEQU <END_CLASS_DECLARE>
;======================================================================================================================
DEFVTP MACRO Interface,Name
Name TEXTEQU <PTR Interface&_VTable>
ENDM
;DEFVTP MACRO Interface,Name
;Name TYPEDEF PTR Interface&_VTable
; ENDM
;======================================================================================================================
;成员函数定义宏
;----------------------------------------------------------------------------------------------------------------------
BEGIN_METHOD MACRO Interface,Name,args:VARARG
;-------------------------
stdinv MACRO Function,Arguments:VARARG
coinv this@,Interface,Function,Arguments
ENDM ;;stdinv Macro
;-------------------------
IFNB <args>
Interface&_&Name PROC this@:PTR,args
ELSE
Interface&_&Name PROC this@:PTR
ENDIF
ENDM
;----------------------------------------------------------------------------------------------------------------------
END_METHOD MACRO Interface,Name
Interface&_&Name ENDP
PURGE stdinv
ENDM
;======================================================================================================================
DECLARE_METHOD MACRO Interface,Function,args:VARARG
IFNB <args>
Interface&_&Function PROTO :PTR,args
ELSE
Interface&_&Function PROTO :PTR
ENDIF
ENDM
;======================================================================================================================
DECLARE_CONSTRUCT MACRO Interface,args:VARARG
IFNB <args>
Interface&_Construct PROTO :PTR,args
ELSE
Interface&_Construct PROTO :PTR
ENDIF
ENDM
;======================================================================================================================
DECLARE_DESTRUCT MACRO Interface
Interface&_Destruct PROTO :PTR
ENDM
;======================================================================================================================
DEFINE_METHOD TEXTEQU <DECLARE_METHOD>
DEFINE_CONSTRUCT TEXTEQU <DECLARE_CONSTRUCT>
DEFINE_DESTRUCT TEXTEQU <DECLARE_DESTRUCT>
;======================================================================================================================
;构造函数定义宏
;----------------------------------------------------------------------------------------------------------------------
BEGIN_CONSTRUCT MACRO Interface,args:VARARG
;;-------------------------
stdinv MACRO Function,Arguments:VARARG
coinv this@,Interface,Function,Arguments
ENDM ;;stdinv Macro
;;-------------------------
IFNB <args>
Interface&_Construct PROC this@:PTR,args
ELSE
Interface&_Construct PROC this@:PTR
ENDIF
ENDM
;----------------------------------------------------------------------------------------------------------------------
END_CONSTRUCT MACRO Interface
Interface&_Construct ENDP
PURGE stdinv
ENDM
;======================================================================================================================
;析构函数定义宏
;----------------------------------------------------------------------------------------------------------------------
BEGIN_DESTRUCT MACRO Interface
;-------------------------
stdinv MACRO Function,Arguments:VARARG
coinv this@,Interface,Function,Arguments
ENDM ;;stdinv Macro
;-------------------------
Interface&_Destruct PROC this@:PTR
ENDM
;----------------------------------------------------------------------------------------------------------------------
END_DESTRUCT MACRO Interface
Interface&_Destruct ENDP
PURGE stdinv
ENDM
;======================================================================================================================
conew EQU <invoke CoTaskMemAlloc,>
comnew EQU <invoke CoTaskMemAlloc,SIZEOF>
codel EQU <invoke CoTaskMemFree,>
comdel EQU <invoke CoTaskMemFree,>
;======================================================================================================================
;通过指向对象的指针调用对象成员函数的宏
;----------------------------------------------------------------------------------------------------------------------
coinv MACRO ppv:REQ,Interface:REQ,Function:REQ,args:VARARG
LOCAL arg
FOR arg,<args>
IFIDNI <arg>,<edx>
.ERR <edx is not allowed as a coinv parameter>
ENDIF
ENDM
IF (OPATTR(ppv)) AND 00010000b
mov edx,DWORD PTR [ppv]
ELSE
mov edx,ppv
mov edx,DWORD PTR [edx]
ENDIF
IFNB <args>
invoke (Interface&_VTable PTR [edx]).Function,ppv,args
ELSE
invoke (Interface&_VTable PTR [edx]).Function,ppv
ENDIF
ENDM
;======================================================================================================================
cominv EQU <coinv>
;======================================================================================================================
;调用对象构造函数的宏
;----------------------------------------------------------------------------------------------------------------------
coninv MACRO ThisPointer,Interface,args:VARARG
IFNB <args>
invoke Interface&_Construct,ThisPointer,args
ELSE
invoke Interface&_Construct,ThisPointer
ENDIF
ENDM
;======================================================================================================================
;调用对象析构函数的宏
;----------------------------------------------------------------------------------------------------------------------
desinv MACRO ThisPointer,Interface
invoke Interface&_Destruct,ThisPointer
ENDM
;======================================================================================================================
;调用对象成员函数的宏
;----------------------------------------------------------------------------------------------------------------------
clsinv MACRO ThisPointer,Interface,Function,args:VARARG
IFNB <args>
invoke Interface&_&Function,ThisPointer,args
ELSE
invoke Interface&_&Function,ThisPointer
ENDIF
ENDM
;======================================================================================================================
guidequ EQU <invoke IsEqualGUID,>
;----------------------------------------------------------------------------------------------------------------------
IDEQ MACRO pGuid1@,pGuid2@
invoke IsEqualGUID,pGuid1@,pGuid2@
EXITM <eax>
ENDM
;======================================================================================================================
DECLARE_GUID MACRO Name,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11
Name TEXTEQU <{d1,d2,d3,{d4,d5,d6,d7,d8,d9,d10,d11}}>
ENDM
DECLARE_CLSID EQU <DECLARE_GUID>
DECLARE_IID EQU <DECLARE_GUID>
DEFINE_GUID MACRO Name,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11
Name GUID {d1,d2,d3,{d4,d5,d6,d7,d8,d9,d10,d11}}
ENDM
DEFINE_CLSID EQU <DEFINE_GUID>
DEFINE_IID EQU <DEFINE_GUID>
;======================================================================================================================
SUCCEEDED TEXTEQU <SIGNEDD eax!>=0>
FAILED TEXTEQU <SIgNEDD eax!<0>
;======================================================================================================================
;COMMENTS TEXTEQU <IF 0>
;COMMENTE TEXTEQU <ENDIF>
;======================================================================================================================
snew MACRO Size@ ;;Size@必须为4的整数倍
sub esp,Size@
mov eax,esp
ENDM
;----------------------------------------------------------------------------------------------------------------------
sdelete MACRO Size@ ;;Size@必须为4的整数倍
add esp,Size@
ENDM
;======================================================================================================================
_S MACRO Text@:VARARG
;;--------------------------------------
LOCAL ?str,?chr,?sch,?bgn,?dbsch,?args
;;--------------------------------------
IFB <Text@>
EXITM <>
ENDIF
;;-------------------------
?str TEXTEQU <>
;;-------------------------
FOR ?args,<Text@>
?sch SUBSTR <?args>,1,1
IFIDN ?sch,<'>
?dbsch = 0
ELSEIFIDN ?sch,<">
?dbsch = 0
ELSE
?dbsch = 1
ENDIF
IF ?dbsch
IFDIF ?str,<>
?str CATSTR ?str,<,>
ENDIF
?str CATSTR ?str,<?args>
ELSE
?bgn = 1
;;-------------------------
FORC ?chr,<?args>
IF ?bgn
?bgn = 0
ELSEIFIDN <?chr>,?sch
?dbsch = ?dbsch+1
IF ?dbsch EQ 2
?dbsch = 0
;;-------------------------
IFDIF ?str,<>
?str CATSTR ?str,<,>
ENDIF
;;-------------------------
IFIDN <?chr>,<'>
?str CATSTR ?str,<''>,<?chr>,<'>
ELSE
?str CATSTR ?str,<'>,<?chr>,<'>
ENDIF
;;-------------------------
ENDIF
ELSE
IF ?dbsch EQ 1
IFIDN ?sch,<">
.ERR <Missing ">
ELSE
.ERR <Missing '>
ENDIF
ENDIF
;;-------------------------
IFDIF ?str,<>
?str CATSTR ?str,<,>
ENDIF
;;-------------------------
IFIDN <?chr>,<'>
?str CATSTR ?str,<''>,<?chr>,<'>
ELSE
?str CATSTR ?str,<'>,<?chr>,<'>
ENDIF
;;-------------------------
ENDIF
ENDM
IF ?dbsch NE 1
IFIDN ?sch,<">
.ERR <Missing ">
ELSE
.ERR <Missing '>
ENDIF
ENDIF
ENDIF ;;IF ?dbsch
ENDM
EXITM ?str
ENDM
;======================================================================================================================
_ST MACRO Text@:VARARG
EXITM <<_S(Text@)>>
ENDM
;======================================================================================================================
_T MACRO Text@:VARARG
LOCAL szText
IF ??segment??type?? NE 2
.CONST
ENDIF
szText BYTE Text@,0
IF ??segment??type?? EQ 0
.DATA
ELSEIF ??segment??type?? EQ 1
.DATA?
ELSEIF ??segment??type?? EQ 3
.CODE ??code??segment??name
ENDIF
EXITM <OFFSET szText>
ENDM
;======================================================================================================================
WCHAR TYPEDEF WORD
;======================================================================================================================
_L MACRO Text@:VARARG
LOCAL szText,?str
IF ??segment??type?? NE 2
.CONST
ENDIF
?str TEXTEQU _S(Text@)
IFNB ?str
szText WORD ?str,0
ELSE
szText WORD 0
ENDIF
IF ??segment??type?? EQ 0
.DATA
ELSEIF ??segment??type?? EQ 1
.DATA?
ELSEIF ??segment??type?? EQ 3
.CODE ??code??segment??name
ENDIF
EXITM <OFFSET szText>
ENDM
;======================================================================================================================
_R MACRO Type@:VARARG
EXITM <>
ENDM
_IO MACRO Param@
LOCAL ?Index
?Index INSTR 1,<Param@>,<:>
IF ?Index
EXITM <Param@>
ELSE
EXITM <:Param@>
ENDIF
ENDM
_I MACRO Param@
LOCAL ?Index
?Index INSTR 1,<Param@>,<:>
IF ?Index
EXITM <Param@>
ELSE
EXITM <:Param@>
ENDIF
ENDM
_O MACRO Param@
LOCAL ?Index
?Index INSTR 1,<Param@>,<:>
IF ?Index
EXITM <Param@>
ELSE
EXITM <:Param@>
ENDIF
ENDM
;======================================================================================================================
DEFVTP IUnknown,pUnknown
BEGIN_VTABLE_DECLARE IUnknown
VIRTUAL _R(HRESULT) QueryInterface,_I(DWORD),_O(PTR pUnknown)
VIRTUAL _R(ULONG) AddRef
VIRTUAL _R(ULONG) Release
END_VTABLE_DECLARE IUnknown
;======================================================================================================================
PROTYPE MACRO Name@,Args@:VARARG
IFNB <Args@>
Name@ TYPEDEF PROTO,Args@
ELSE
Name@ TYPEDEF PROTO
ENDIF
ENDM
;======================================================================================================================
PROCPTR MACRO Name@,Value@,Args@:VARARG
LOCAL @TempProto
LOCAL @TempProtoP
@TempProto TYPEDEF PROTO Args@
@TempProtoP TYPEDEF PTR @TempProto
Name@ @TempProtoP Value@
ENDM
;======================================================================================================================
.LABEL MACRO NameAndType@
LOCAL Len@,Type@,Name@
Len@ INSTR 1,<NameAndType@>,<:>
IF Len@
Len@ = Len@+1
Type@ SUBSTR <NameAndType@>,Len@
Len@ = Len@-2
Name@ SUBSTR <NameAndType@>,1,Len@
ELSE
Type@ SUBSTR <NameAndType@>,1
Name@ TEXTEQU <>
ENDIF
Name@ LABEL Type@
ENDM
;======================================================================================================================
.EQU MACRO Name@,Param@:REQ
Name@ EQU <Param@>
ENDM
;----------------------------------------------------------------------------------------------------------------------
DEFTYPE MACRO Name@,Type@
Name@ TYPEDEF Type@
ENDM
;DEFTYPE MACRO NameAndType@
; LOCAL Len@,Type@,Name@
;Len@ INSTR 1,<NameAndType@>,<:>
; IF Len@
;Len@ = Len@+1
;Type@ SUBSTR <NameAndType@>,Len@
;Len@ = Len@-2
;Name@ SUBSTR <NameAndType@>,1,Len@
;Name@ TYPEDEF Type@
; ELSE
; .ERR <Missing :>
; ENDIF
; ENDM
;----------------------------------------------------------------------------------------------------------------------
.EQUT MACRO Name@,Param@:REQ
Name@ TEXTEQU <Param@>
ENDM
;----------------------------------------------------------------------------------------------------------------------
.EQUC MACRO Name@,Param@:REQ
Name@ = Param@
ENDM
;----------------------------------------------------------------------------------------------------------------------
VAR MACRO NameAndType@,Param@:VARARG
LOCAL Len@,Type@,Name@
Len@ INSTR 1,<NameAndType@>,<:>
IF Len@
Len@ = Len@+1
Type@ SUBSTR <NameAndType@>,Len@
Len@ = Len@-2
Name@ SUBSTR <NameAndType@>,1,Len@
ELSE
Type@ SUBSTR <NameAndType@>,1
Name@ TEXTEQU <>
ENDIF
IFNB <Param@>
Name@ Type@ Param@
ELSE
Name@ Type@ ?
ENDIF
ENDM
;======================================================================================================================
??StructureOrUnionNestLevel?? = 0
;----------------------------------------------------------------------------------------------------------------------
.STRUCT MACRO Name@,Align@:VARARG
??StructureOrUnionNestLevel?? = ??StructureOrUnionNestLevel??+1
;-------------
DefName MACRO ??Name,Index@
IFNB <??Name>
??Structure??Union??Name??&Index@ TEXTEQU <??Name>
ELSE
??Structure??Union??Name??&Index@ TEXTEQU <>
ENDIF
ENDM
;-------------
DefName Name@,%(??StructureOrUnionNestLevel??)
PURGE DefName
Name@ STRUCT Align@
ENDM
;----------------------------------------------------------------------------------------------------------------------
.UNION MACRO Name@,Align@:VARARG
??StructureOrUnionNestLevel?? = ??StructureOrUnionNestLevel??+1
;-------------
DefName MACRO ??Name,Index@
IFNB <??Name>
??Structure??Union??Name??&Index@ TEXTEQU <??Name>
ELSE
??Structure??Union??Name??&Index@ TEXTEQU <>
ENDIF
ENDM
;-------------
DefName Name@,%(??StructureOrUnionNestLevel??)
PURGE DefName
Name@ UNION Align@
ENDM
;----------------------------------------------------------------------------------------------------------------------
.ENDS MACRO
;-------------
DefEnds MACRO Index@
??Structure??Union??Name??&Index@ ENDS
ENDM
;-------------
DefEnds %(??StructureOrUnionNestLevel??)
PURGE DefEnds
??StructureOrUnionNestLevel?? = ??StructureOrUnionNestLevel??-1
ENDM
;----------------------------------------------------------------------------------------------------------------------
.PROTO MACRO Name@,Param@:VARARG
Name@ PROTO Param@
ENDM
;======================================================================================================================
PROCPRV MACRO Name@,Param@:VARARG
??Function??Name?? TEXTEQU <Name@>
Name@ PROC PRIVATE Param@
ENDM
;----------------------------------------------------------------------------------------------------------------------
PROCPUB MACRO Name@,Param@:VARARG
??Function??Name?? TEXTEQU <Name@>
Name@ PROC PUBLIC Param@
ENDM
;----------------------------------------------------------------------------------------------------------------------
FUNCPRV MACRO Name@,Param@:VARARG
??Function??Name?? TEXTEQU <Name@>
Name@ PROC PRIVATE USES ebx esi edi Param@
ENDM
;----------------------------------------------------------------------------------------------------------------------
FUNCPUB MACRO Name@,Param@:VARARG
??Function??Name?? TEXTEQU <Name@>
Name@ PROC PUBLIC USES ebx esi edi Param@
ENDM
;----------------------------------------------------------------------------------------------------------------------
PROCEXP MACRO Name@,Param@:VARARG
??Function??Name?? TEXTEQU <Name@>
Name@ PROC EXPORT Param@
ENDM
;----------------------------------------------------------------------------------------------------------------------
ENDPROC EQU <??Function??Name?? ENDP>
ENDFUNC EQU <??Function??Name?? ENDP>
;======================================================================================================================
ENDIF
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!