-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.cmd
56 lines (46 loc) · 1.42 KB
/
debug.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@ECHO OFF
REM --------------------------------------------------------------------
REM Debug.cmd v 1.0.1
REM --------------------------------------------------------------------
SET FILENAME=main
SET FILERES=rsrc
REM --------------------------------------------------------------------
REM Fixing up AsmPad bugs
FOR /L %%i IN (1, 1, 5) DO (
IF NOT EXIST %FILENAME%.asm. (
CD ..
) ELSE (
GOTO ENDLOOP
)
)
:ENDLOOP
REM --------------------------------------------------------------------
SET PROJECT_BIN=%CD%\bin
REM --------------------------------------------------------------------
REM --------------------------------------------------------------------
SET DBGPATH=\Programs\Development\RCE\Debuggers\OllyDBG
SET CHECK_DRIVES=C Y Z
FOR %%i IN (%CHECK_DRIVES%) DO (
IF EXIST %%i:%DBGPATH%. SET DBGPATH=%%i:%DBGPATH%
)
SET DBGEXE=%DBGPATH%\asphx.exe
IF NOT EXIST %DBGEXE%. (
ECHO NO DEBUGGER FOUND! CHECK PATH IN DEBUG.CMD
ECHO DBG=%DBGEXE%
GOTO ERROR
)
REM --------------------------------------------------------------------
IF EXIST %PROJECT_BIN%\%FILENAME%.exe. (
START /D"%DBGPATH%" "" "%DBGEXE%" "%PROJECT_BIN%\%FILENAME%.exe"
GOTO FINISH
)
SET /P CHOISE=Compile it first. Launch make.cmd? (y/n)
IF %CHOISE%==y (
START /D"%CD%" make.cmd
GOTO FINISH
)
:ERROR
PAUSE>nul
:FINISH
EXIT
REM --------------------------------------------------------------------