Skip to content

Commit e2234da

Browse files
committed
refactor SetupPatcher/Y2K38Patcher
1 parent 9fd2b7e commit e2234da

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

patches/SetupPatcher/SetupPatcher/SetupPatcher.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int main() {
6767
BOOL success = CreateProcess(NULL, setupExePath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
6868

6969
if (!success) {
70-
std::cerr << "Failed to execute setup.exe." << std::endl;
70+
fprintf(stderr, "Failed to execute setup.exe.");
7171
return 1;
7272
}
7373

@@ -81,7 +81,7 @@ int main() {
8181
CloseHandle(pi.hProcess);
8282
CloseHandle(pi.hThread);
8383

84-
std::cout << "SetupPatcher installed with the 2026 Bypass the Game sucessfully" << std::endl;
84+
printf("SetupPatcher installed with the 2026 Bypass the Game sucessfully");
8585

8686
return 0;
8787
}

patches/Y2K38Patcher/Y2K38Patcher/Y2K38Patcher.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <ctime>
77
#include <string>
88

9+
#include "common-code/ConsoleUtils.h"
10+
911
// TODO:
1012
// Change the clock date back to the realtime value when the process (setup.exe) is being closed/terminated.
1113
// Current Workaround, sync the Time between PC and Time Server over the Settings, to change it back to the current timedate
@@ -70,9 +72,8 @@ int main() {
7072
printf("When you done playing your DEV7 game, set the Date back to the one you currently have.\n");
7173

7274
if (!success) {
73-
std::cerr << "Failed to execute Loader7.exe." << std::endl;
74-
std::cout << "Press Enter to exit\n" << std::endl;
75-
std::cin.get();
75+
fprintf(stderr, "Failed to execute %s.", loaderExeName);
76+
TaskExecution::pressEnterToExit();
7677
return 1;
7778
}
7879

@@ -87,9 +88,8 @@ int main() {
8788
success = CreateProcess(NULL, devExePath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
8889

8990
if (!success) {
90-
std::cerr << "Failed to execute Dev7VM.EXE." << std::endl;
91-
std::cout << "Press Enter to exit\n" << std::endl;
92-
std::cin.get();
91+
fprintf(stderr, "Failed to execute Dev7VM.EXE.");
92+
TaskExecution::pressEnterToExit();
9393
return 1;
9494
}
9595

@@ -101,8 +101,7 @@ int main() {
101101

102102
// Close process and thread handles
103103
printf("When you done playing your DEV7 game, set the Date back to the one you currently have.\n");
104-
printf("Pres Enter to exit Y2K38Patcher\n");
105-
std::cin.get();
104+
TaskExecution::pressEnterToExit();
106105
CloseHandle(pi.hProcess);
107106
CloseHandle(pi.hThread);
108107

0 commit comments

Comments
 (0)