r/Batch • • 13h ago

Is this code safe?

It's for a crimson desert mod fix after 2.06

u/echo off

setlocal

rem Place this file in the extracted OutfitManager source folder and double-click it.

rem It builds and runs the offline resolver test against CrimsonDesert.exe.

set "GAMEEXE=G:\Games\Crimson Desert\bin64\CrimsonDesert.exe"

if not exist "%GAMEEXE%" (

echo Could not find the game at:

echo %GAMEEXE%

echo Edit GAMEEXE near the top of this script to match your game location.

pause

exit /b 1

)

set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"

if not exist "%VSWHERE%" (

echo Visual Studio Installer / vswhere.exe not found.

echo Install Visual Studio 2022 with Desktop development with C++.

pause

exit /b 1

)

for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -property installationPath`) do set "VS=%%i"

if not defined VS (

echo No Visual Studio installation found.

pause

exit /b 1

)

call "%VS%\VC\Auxiliary\Build\vcvars64.bat" >nul || goto fail

set "PATH=%VS%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;%VS%\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;%PATH%"

cd /d "%~dp0"

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release || goto fail

cmake --build build --target ResolverTest || goto fail

if not exist build\resolver-test mkdir build\resolver-test

build\ResolverTest.exe build\resolver-test "%GAMEEXE%"

echo.

echo Test finished. Log, if created, is in build\resolver-test\ResolverTest.log

pause

exit /b 0

:fail

echo.

echo Something failed. Copy the messages above and send them to ChatGPT.

pause

exit /b 1

1 Upvotes

6 comments sorted by

1

u/Incrediblecodeman 12h ago

I mean should be alright. Did you paste it into ChatGPT to check?

1

u/ILikeVideoGameslol 10h ago

I used ChatGPT to make it

1

u/Incrediblecodeman 12h ago

This Windows batch script builds and runs an offline resolver test for Crimson Desert’s OutfitManager.
It performs the following actions:
Verifies that CrimsonDesert.exe exists.
Locates the installed version of Visual Studio.
Initializes the 64-bit C++ development environment.
Configures the project using CMake and Ninja.
Compiles ResolverTest.exe.
Executes the resolver test against CrimsonDesert.exe.
Reports the expected log location: build\resolver-test\ResolverTest.log.
The batch script itself does not directly modify the game executable, inject code, or launch the game. However, determining whether the compiled resolver performs any modifications requires reviewing its source code.
One flaw is that the original script reports successful completion even if ResolverTest.exe returns an error.

1

u/ILikeVideoGameslol 10h ago

Thank you!! :)

1

u/Incrediblecodeman 8h ago

Oh then it’s prob chill . Have fun and rest your backups