Skip to content

Commit c3685f2

Browse files
committed
add improved LoaderMDO variants
This executables run directly with the Debug Menu over the -break argument
1 parent fb0fcb3 commit c3685f2

File tree

15 files changed

+713
-0
lines changed

15 files changed

+713
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
LoaderMDO was used as Adibou3.EXE in Adibou 3 and as ADI5.EXE in ADI 5.
3+
It was developed to be linked to Loader7.exe to run it.
4+
This version is ported for running Loader7 with the Debug Menu directly.
5+
***********************************************************************
6+
This is an attempt to recreate that EXE in C++ as it was developed back then by Coktel/MDO.
7+
It was originally developed for ADI 5 version 5.00 in the Year 2000.
8+
Requirements:
9+
- Compile under MSVC 6.0 build 8168 (Any newer build of MSVC6.0 work aswell but Coktel/MDO used back then used exactly this version of the Compiler.)
10+
Compiling:
11+
- Compile in Release mode to keep it original in Release mode as it was back then. (directly from Visual Studio 6.0)
12+
- build_release.bat: if you compile it over this batch file it whil be smaller then original in size.
13+
- build_debug.bat: if you compile over that batch file you have the exact same filesize with debug symbols included.
14+
*/
15+
16+
#include <windows.h>
17+
#include <process.h> // Include for _spawnl
18+
19+
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
20+
HANDLE MutexA;
21+
22+
// Create a mutex named "ADI5_LAUNCH_MUTEX"
23+
MutexA = CreateMutexA(NULL, TRUE, "ADI5_LAUNCH_MUTEX");
24+
25+
// Check if mutex creation failed or if it already exists
26+
if (!MutexA || GetLastError() == ERROR_ALREADY_EXISTS) {
27+
return 0; // Exit if mutex already exists or creation failed
28+
}
29+
30+
// Check if a window with the title "LoaderMDO" exists, and wait if it does
31+
while (FindWindowA(NULL, "LoaderMDO")) {
32+
Sleep(100); // Sleep for 100 milliseconds
33+
}
34+
35+
// Launch Loader7.exe with -break argument for Debug Menu using _spawnl
36+
_spawnl(_P_NOWAIT, "Loader7.exe", "Loader7.exe", "-break", NULL);
37+
38+
// Close the mutex handle after the process is created
39+
CloseHandle(MutexA);
40+
return 0;
41+
}

rewritten-improved-software/LoaderMDO32/LoaderMDO.dsp

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Microsoft Developer Studio Workspace File, Format Version 6.00
2+
# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GEL�SCHT WERDEN!
3+
4+
###############################################################################
5+
6+
Project: "LoaderMDO"=.\LoaderMDO.dsp - Package Owner=<4>
7+
8+
Package=<5>
9+
{{{
10+
}}}
11+
12+
Package=<4>
13+
{{{
14+
}}}
15+
16+
###############################################################################
17+
18+
Global:
19+
20+
Package=<5>
21+
{{{
22+
}}}
23+
24+
Package=<3>
25+
{{{
26+
}}}
27+
28+
###############################################################################
29+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Makefile LoaderMDO compilable over nmake
2+
# nmake release compiles the release exe
3+
# nmake debug compiles the debug exe including debug symbols
4+
5+
# Compiler and linker
6+
CC = cl
7+
LINK = link
8+
9+
# Compiler and linker flags for release mode
10+
CFLAGS_RELEASE = /O2 /EHsc /MT
11+
LDFLAGS_RELEASE =
12+
13+
# Compiler and linker flags for debug mode
14+
CFLAGS_DEBUG = /Zi /EHsc /MDd /MTd
15+
LDFLAGS_DEBUG = /DEBUG /PDB:LoaderMDO.pdb /MAP /SUBSYSTEM:WINDOWS
16+
17+
# Source files
18+
SRCS = LoaderMDO.cpp
19+
20+
# Object files
21+
OBJS = $(SRCS:.cpp=.obj)
22+
23+
# Target executables
24+
TARGET_RELEASE = LoaderMDO_Release.exe
25+
TARGET_DEBUG = LoaderMDO_Debug.exe
26+
27+
# Default target
28+
all: release
29+
30+
# Build rule for release mode
31+
release: $(TARGET_RELEASE)
32+
33+
$(TARGET_RELEASE): $(OBJS)
34+
$(LINK) $(LDFLAGS_RELEASE) $(OBJS) /OUT:$(TARGET_RELEASE) user32.lib
35+
36+
# Build rule for debug mode
37+
debug: $(TARGET_DEBUG)
38+
39+
$(TARGET_DEBUG): $(OBJS)
40+
$(LINK) $(LDFLAGS_DEBUG) $(OBJS) /OUT:$(TARGET_DEBUG) user32.lib
41+
42+
.cpp.obj:
43+
$(CC) $(CFLAGS_RELEASE) /c $<
44+
45+
# Clean rule
46+
clean:
47+
del $(OBJS) $(TARGET_RELEASE) $(TARGET_DEBUG) LoaderMDO.pdb LoaderMDO.map
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@echo off
2+
title Debug Mode Compile Script for LoaderMDO
3+
echo Welcome to the LoaderMDO compilation script (Debug mode)!
4+
5+
REM Prompt the user to compile in debug mode
6+
set /p compile_debug=Compile LoaderMDO in debug mode? (yes/no):
7+
8+
REM Check the user input
9+
if /i "%compile_debug%"=="yes" (
10+
echo Compiling LoaderMDO in debug mode...
11+
REM Compile the source file
12+
cl.exe /Zi /EHsc /MDd /MT /c LoaderMDO.cpp
13+
REM Link the object file
14+
link.exe /DEBUG /PDB:LoaderMDO.pdb /MAP /SUBSYSTEM:WINDOWS /OUT:LoaderMDO.exe LoaderMDO.obj user32.lib
15+
) else if /i "%compile_debug%"=="no" (
16+
echo Exiting without compilation.
17+
exit
18+
) else (
19+
echo Invalid input. Please enter "yes" or "no".
20+
)
21+
22+
echo Compilation completed successfully.
23+
pause
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@echo off
2+
title Release Mode Compile Script for LoaderMDO
3+
echo Welcome to the LoaderMDO compilation script (Release mode)!
4+
5+
REM Prompt the user to compile in release mode
6+
set /p compile_release=Compile LoaderMDO in release mode? (yes/no):
7+
8+
REM Check the user input
9+
if /i "%compile_release%"=="yes" (
10+
echo Compiling LoaderMDO in release mode...
11+
REM Compile the source file
12+
cl.exe /O2 /EHsc /c /MT LoaderMDO.cpp
13+
REM Link the object file
14+
link.exe /OUT:LoaderMDO.exe LoaderMDO.obj user32.lib
15+
) else if /i "%compile_release%"=="no" (
16+
echo Exiting without compilation.
17+
exit
18+
) else (
19+
echo Invalid input. Please enter "yes" or "no".
20+
)
21+
22+
echo Compilation completed successfully.
23+
pause
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@echo off
2+
echo Cleaning up LoaderMDO project directory...
3+
4+
rem Change the current directory to the script's directory
5+
cd %~dp0
6+
7+
rem Function to prompt for deletion confirmation
8+
:confirm_delete
9+
set /P choice=Do you want to delete these files? (y/n):
10+
if /I "%choice%"=="y" goto :delete_files
11+
if /I "%choice%"=="n" goto :cleanup_complete
12+
echo Invalid choice. Please enter y for Yes or n for No.
13+
goto :confirm_delete
14+
15+
:delete_files
16+
rem Remove object files
17+
echo Removing object files...
18+
del /s /q *.obj 2>nul
19+
20+
rem Remove Debug directory
21+
rd /s /q Debug 2>nul
22+
23+
rem Remove Release directory
24+
rd /s /q Release 2>nul
25+
26+
rem Remove temporary files
27+
echo Removing temporary files...
28+
del /s /q *.pch 2>nul
29+
del /s /q *.plg 2>nul
30+
del /s /q *.ncb 2>nul
31+
del /s /q *.opt 2>nul
32+
del /s /q *.ilk 2>nul
33+
del /s /q *.pdb 2>nul
34+
del /s /q *.aps 2>nul
35+
del /s /q *.sbr 2>nul
36+
del /s /q *.html 2>nul
37+
del /s /q *.map 2>nul
38+
39+
echo Removing tempory files from IDA
40+
del /s /q *.idb 2>nul
41+
del /s /q *.nam 2>nul
42+
del /s /q *.id0 2>nul
43+
del /s /q *.id1 2>nul
44+
del /s /q *.til 2>nul
45+
echo Remove the LoaderMDO.exe.i64 manually if its not required.
46+
47+
rem Remove executables
48+
echo Removing executables...
49+
del /s /q *.exe 2>nul
50+
51+
echo Cleanup complete.
52+
pause
53+
exit
54+
55+
:cleanup_complete
56+
echo Cleanup aborted.
57+
pause
58+
exit
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
title LoaderMDO Copy Utility v1.0
4+
5+
REM Get the current directory
6+
set "currentDir=%~dp0"
7+
8+
REM Check if LoaderMDO.exe exists in the current directory
9+
if not exist "%currentDir%LoaderMDO.exe" (
10+
echo LoaderMDO.exe not found in the current directory.
11+
goto end
12+
)
13+
14+
echo LoaderMDO.exe found. Checking for DEV7 games...
15+
16+
REM Initialize a counter
17+
set "counter=0"
18+
set "drives=C D E F G H I J K L M N O P Q R S T U V W X Y Z"
19+
20+
REM Find all drives and search for directories containing Loader7.exe or Dev7VM.exe
21+
for %%D in (%drives%) do (
22+
if exist %%D:\ (
23+
for /d %%F in (%%D:\coktel\*) do (
24+
if exist "%%F\Loader7.exe" (
25+
set /a counter+=1
26+
set "dir!counter!=%%F"
27+
echo !counter!: %%F
28+
) else if exist "%%F\Dev7VM.exe" (
29+
set /a counter+=1
30+
set "dir!counter!=%%F"
31+
echo !counter!: %%F
32+
)
33+
)
34+
)
35+
)
36+
37+
REM Check if any directories with Loader7.exe or Dev7VM.exe were found
38+
if %counter%==0 (
39+
echo No directories were detected which are for DEV7 games.
40+
goto end
41+
)
42+
43+
REM Prompt the user to select a directory
44+
:input
45+
set /p "choice=Enter the number of the directory where you want to copy LoaderMDO.exe: "
46+
47+
REM Validate the user's choice
48+
if not defined dir%choice% (
49+
echo Invalid choice. Please enter a valid number.
50+
goto input
51+
)
52+
53+
REM Set the destination directory
54+
set "destination=!dir%choice%!"
55+
56+
REM Check if LoaderMDO.exe exists in the destination directory
57+
if exist "%destination%\LoaderMDO.exe" (
58+
echo LoaderMDO.exe already exists in %destination%.
59+
set /p "overwrite=Do you want to overwrite it? (Y/N): "
60+
if /I not "!overwrite!"=="Y" (
61+
echo Copy operation cancelled.
62+
goto end
63+
)
64+
)
65+
66+
REM Copy LoaderMDO.exe to the selected directory
67+
echo Copying LoaderMDO.exe to %destination%
68+
copy "%currentDir%LoaderMDO.exe" "%destination%\"
69+
70+
echo Copy process completed.
71+
72+
:end
73+
endlocal
74+
pause
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Adibou3.EXE ef60cd9fa84c26d10a8aa87f75e03c32
2+
ADI5.EXE ef60cd9fa84c26d10a8aa87f75e03c32

0 commit comments

Comments
 (0)