我的操作系统:win7 旗舰版
首先,我建议把MASM32安装在C盘根目录下。MASM32安装包不会对注册表进行写操作,安装后,它会在桌面创建qeditor.exe的快捷方式,qeditor是MASM32的IDE环境,我们要做的事就是对这个IDE进行设置。
①右击快捷方式,选择以管理员方式运行(打钩),确定。
②选择EDIT->SETTINGS->EDIT MENUS ,进去以后开始进行设置。把所有内容删除,将以下内容粘贴进去然后SAVE。
[&Project]
Compile &Resource File,C:\MASM32\BIN\Bres.bat {b}
&Assemble ASM file,C:\MASM32\BIN\Assmbl.bat {b}
-
&Link OBJ File,C:\MASM32\BIN\Lnk.bat {b}
As&semble && Link,C:\MASM32\BIN\Build.bat {b}
&Build All,C:\MASM32\BIN\Bldall.bat {b}
-
Console Link &OBJ File,C:\MASM32\BIN\Lnkc.bat {b}
&Console Assemble && Link,C:\MASM32\BIN\Buildc.bat {b}
Console Build &All,C:\MASM32\BIN\Bldallc.bat {b}
-
&Run Program,"{b}.exe"
[&Tools]
; -----------------------------
; put you resource editor here
; -----------------------------
&Microsoft Image Editor,C:\MASM32\BIN\Imagedit.exe
Microsoft &Zoomin Utility,C:\masm32\bin\zoomin.exe
-
&TopGun Wordwrap Editor,{e}topgun.exe
-
&Procedure Browser,C:\MASM32\qetb.exe \MASM32\procs
Browse MASM32 &Lib,C:\masm32\qetb.exe \masm32\m32lib
-
Map App &Procedures,{e}procmap.exe {e}qeditor.exe
-
&Hex to Mnemonic,C:\MASM32\Mnemonix.exe
&MASM32 Folder,C:\MASM32\Shellex.exe \masm32
-
Load Binary File As Hex,{e}\plugins\bin2hex.dll
Save Hex File As Binary,{e}\plugins\hex2bin.dll
-
Righ Trim Block,{e}\plugins\rtrim.dll
-
&Dis-assemble EXE file,C:\MASM32\BIN\dasm.bat {b}
Dis-&assemble DLL,C:\masm32\BIN\Dasmd.bat {b}
Format DumpPE Output,{e}\plugins\dumpcu.dll
-
&Indent .IF Block,{e}\plugins\Indentb.dll
Swap 32 bit registers,{e}\plugins\regswap.dll
-
Block &C++ Comment,{e}\plugins\cblockc.dll
Block &ASM Comment,{e}\plugins\ablockc.dll
[&Code]
Create New GUI Application,{e}\prostart.exe
Create New Console Application,{e}\script\console.qse
Create New &DLL,{e}\script\dll.qse
Create New Library Module,{e}\script\libmod.qse
Create New QE Plugin,{e}\script\plugin.qse
-
Create New Control Subclass,C:\MASM32\subclass.exe
Create New Object Module From File,{e}\fda2.exe
-
Create New Jump Table,{e}\tproc.exe
Create New Word List Jump Table,{e}\jtmake.exe
Create New Character Table,{e}\maketbl.exe
-
&Binary to DB Convertor,C:\masm32\Bintodb.exe
&RC Menu to .IF asm code,C:\masm32\Mnutoasm.exe
-
Small &Algo Testbed,C:\masm32\Testbed.qsc
Large Algo Testbed,C:\masm32\bigtstbd.qsc
-
Dialog &Template,C:\MASM32\dlgproc.qsc
Add In &Dialog,C:\MASM32\dlgtmplt.qsc
-
Create bld&lib.bat,C:\masm32\Libbat.qsc
-
Fast Insert Dialog Template,{e}\text\blankdlg.txt
Fast Insert Console Template,{e}\text\contemp.txt
[Scr&ipt]
Convert Text to Script,{e}\plugins\txt2qse.dll
Convert Binary to Script,{e}\plugins\bin2qse.dll
-
Debug MsgBox,{e}\text\dbmsgbox.txt
MessageBox,{e}\text\msgbox.txt
Last Error MessageBox,{e}\text\lasterr.txt
Debug Print,{e}\text\dbprint.txt
-
&Create EXE makeit.bat,C:\masm32\Bldmakit.qsc
&Create CONSOLE makeit.bat,C:\masm32\makecon.qsc
Create Sample &RC file,{e}\text\samplerc.txt
-
Insert switch$ Block,{e}\text\switch$.txt
Insert Normal switch Block,{e}\text\switch.txt
-
Insert Prologue Code,{e}\text\prolog.txt
Insert Epilogue Code,{e}\text\epilog.txt
-
Push 3 regs,{e}\text\push3.txt
Pop 3 regs,{e}\text\pop3.txt
-
3 nops,{e}\text\nops3.txt
-
插入注释分割*******************,{e}\text\comment0.txt
[help]
Quick Editor Help,{e}\help\qeditor.chm
-
&MASM32 Help,{e}\HELP\masm32.chm
High Level Macro Help,{e}\help\hlhelp.chm
MASM32 &Library Reference,{e}\HELP\Masmlib.chm
MASM32 Dialog Help,{e}\HELP\imdialog.chm
&FPU Lib Help,{e}\HELP\Fpuhelp.chm
Date Time Reference,{e}\HELP\datetime.chm
-
&Opcodes Help,{e}\HELP\Opcodes.chm
&ASM Intro Help,{e}\HELP\Asmintro.chm
-
&VKdebug Help,{e}\help\VKDebug.chm
然后找到C盘根目录下MASM32里面的TEXT目录,删掉里面的comment0.txt到comment8.txt,新建一个文本文件,里面的内容如下:
;********************************************************************************
保存为comment0.txt。
③现在对bin目录里面的bat文件动手术哈!
(1)assmbl.bat(这个批处理对应qeditor.exe里面的Assemble ASM file选项)
把内容改为:
@echo off
title hunter'assembly batch command
color f0
if exist "%1.obj" del "%1.obj"
c:\masm32\bin\ml /c /coff "%1.asm" > c:\masm32\bin\asmbl.txt
if errorlevel 0 dir "%1.*" >> c:\masm32\bin\asmbl.txt
start c:\masm32\tview.exe c:\masm32\bin\asmbl.txt
(2)bldall.bat(这个批处理文件对应qeditor.exe的Build All选项)
@echo off
if not exist rsrc.rc goto over1
c:\masm32\bin\rc /v rsrc.rc
c:\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1
if exist "%1.obj" del "%1.obj"
if exist "%1.exe" del "%1.exe"
c:\masm32\bin\ml /c /coff "%1.asm"
if errorlevel 1 goto errasm
if not exist rsrc.obj goto nores
c:\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "%1.obj" rsrc.obj
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:nores
c:\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "%1.obj"
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:errlink
echo _
echo Link error
goto TheEnd
:errasm
echo _
echo Assembly Error
goto TheEnd
:TheEnd
pause
(3)bldallc.bat(bldall.bat的console版本,用于创建命令行窗口)
@echo off
if not exist rsrc.rc goto over1
c:\masm32\bin\rc /v rsrc.rc
c:\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1
if exist "%1.obj" del "%1.obj"
if exist "%1.exe" del "%1.exe"
c:\masm32\bin\ml /c /coff "%1.asm"
if errorlevel 1 goto errasm
if not exist rsrc.obj goto nores
c:\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF "%1.obj" rsrc.obj
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:nores
c:\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF "%1.obj"
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:errlink
echo _
echo Link error
goto TheEnd
:errasm
echo _
echo Assembly Error
goto TheEnd
:TheEnd
pause
(4)bres.bat(对应qeditor.exe的Compile Resource File选项,用于编译资源文件)
@echo off
title hunter'assembly batch command
color f0
c:\masm32\bin\rc /v rsrc.rc
c:\masm32\bin\cvtres /machine:ix86 rsrc.res
pause
(5)build.bat(对应qeditor.exe的Assemble & Link选项,编译链接)
@echo off
title hunter'assembly batch command
color f0
if exist "%1.obj" del "%1.obj"
if exist "%1.exe" del "%1.exe"
@echo %1
c:\masm32\bin\ml /c /coff "%1.asm"
if errorlevel 1 goto errasm
if not exist rsrc.obj goto nores
c:\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "%1.obj" rsrc.obj
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:nores
c:\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "%1.obj"
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:errlink
echo _
echo Link error
goto TheEnd
:errasm
echo _
echo Assembly Error
goto TheEnd
:TheEnd
pause
(6)buildc.bat(build.bat的console版本,用于创建命令行窗口)
@echo off
title hunter'assembly batch command
color f0
if exist "%1.obj" del "%1.obj"
if exist "%1.exe" del "%1.exe"
\masm32\bin\ml /c /coff "%1.asm"
if errorlevel 1 goto errasm
if not exist rsrc.obj goto nores
\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF "%1.obj" rsrc.obj
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:nores
\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF "%1.obj"
if errorlevel 1 goto errlink
dir "%1.*"
goto TheEnd
:errlink
echo _
echo Link error
goto TheEnd
:errasm
echo _
echo Assembly Error
goto TheEnd
:TheEnd
pause
(7)lnk.bat(链接,对应于qeditor.exe的Link OBJ File 选项)
@echo off
if exist "%1.exe" del "%1.exe"
if not exist rsrc.obj goto nores
c:\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "%1.obj" rsrc.obj
dir "%1.*"
goto TheEnd
:nores
c:\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "%1.obj"
dir "%1.*"
:TheEnd
if errorlevel 0 dir "%1.*" > c:\masm32\bin\lnk.txt
start c:\masm32\tview.exe c:\masm32\bin\lnk.txt
(8)lnkc.bat(lnk.bat的console版本,用于创建命令行窗口)
@echo off
var
if exist "%1.exe" del "%1.exe"
if not exist rsrc.obj goto nores
c:\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF "%1.obj" rsrc.obj
dir "%1.*"
goto TheEnd
:nores
c:\masm32\bin\Link /SUBSYSTEM:CONSOLE /OPT:NOREF "%1.obj"
dir "%1.*"
:TheEnd
if errorlevel 0 dir "%1.*" > c:\masm32\bin\lnk.txt
start c:\masm32\tview.exe c:\masm32\bin\lnk.txt
(9)关于dasm.bat和dasmd.bat ,这两个批处理分别对应于Dis-assemble EXE file和Dis-assemble Dll两个选项,用于反向分析,初学者暂时用不到。不过还是要把里面的内容修改完善:
$$$$$$$$$$$$$$$ dasm.bat的内容改为:
@echo off
if not exist c:\masm32\bin\dumppe.exe goto message
c:\masm32\bin\dumppe -disasm "%1.exe" > disasm.txt
c:\masm32\qeditor.exe disasm.txt
goto TheEnd
:message
echo.
echo To use this menu option, you must first unzip
echo the file called DUMPPE.ZIP in the BIN directory.
echo.
echo You can then dis-assemble the executable files
echo that you have assembled.
echo.
pause
:TheEnd
$$$$$$$$$$$$$$$ dasmd.bat的内容改为:
@echo off
if not exist c:\masm32\bin\dumppe.exe goto message
c:\masm32\bin\dumppe -disasm "%1.dll" > disasm.txt
c:\masm32\qeditor.exe disasm.txt
goto TheEnd
:message
echo.
echo To use this menu option, you must first unzip
echo the file called DUMPPE.ZIP in the BIN directory.
echo.
echo You can then dis-assemble the executable files
echo that you have assembled.
echo.
pause
:TheEnd
④创建自己的inc文件,把它放在“C:\masm32\bin”里面,现在我展示一下我自己的inc文件(纯文本):
文件名:hunter.inc
文件路径:C:\masm32\bin\hunter.inc
文件内容:(用记事本编辑)
include c:\masm32\include\windows.inc
include c:\masm32\include\masm32.inc
include c:\masm32\include\kernel32.inc
include c:\masm32\include\gdi32.inc
include c:\masm32\include\user32.inc
includelib c:\masm32\lib\masm32.lib
includelib c:\masm32\lib\kernel32.lib
includelib c:\masm32\lib\gdi32.lib
includelib c:\masm32\lib\user32.lib
好了,这就是我的inc文件,以后我写assemble文件就可以引用这个头文件,比如:
include C:\masm32\bin\hunter.inc
这样就不用麻烦的设置环境变量,也不用麻烦的每次都写出所有的引用头文件了,(*^__^*) 嘻嘻……
好的,以上调整完毕,可以随心所欲的使用这个IDE了,本文原创,转载请注明出处!
关键字:masm32 masm32设置 qeditor设置 汇编软件设置