sorr-vita icon indicating copy to clipboard operation
sorr-vita copied to clipboard

prepare.cmd will delete random .exe and .dll from System32 if run as an administrator

Open infamoussabre opened this issue 3 years ago • 3 comments

As the title says, prepare.cmd will delete random .exe and .dll from System32 if run as an administrator. This only resulted in having to reinstall DirectX and GPU drivers for me, but YMMV.

infamoussabre avatar Oct 25 '21 19:10 infamoussabre

@infamoussabre you need to run it in cmd prompt from data directory. @rynho can you add checks to make sure we're running from proper place (and maybe update instructions), because double-clicking indeed runs script in system32?

isage avatar Oct 25 '21 20:10 isage

The .cmd does not appear to be written to be run from the /data directory. If it was, it would not contain "cd data". If the author intends for it to be run from within /data, they should put it in /data. That still wouldn't fix the issue, however.

Double clicking the .cmd works just fine. If one intentionally runs it as an administrator, this is when the issues occur. As you said, checks are necessary.

infamoussabre avatar Oct 25 '21 21:10 infamoussabre

Sorry @infamoussabre.. The .cmd was directly translate line by line from .sh, which is not considering windows binaries. It’s a problem when you double-click the .cmd from any parent folder of unintended windows folders, e.g., c:\; or right-click and choose “run as admin”, because windows would launch cmd in “system32” folder, thus making damage.

@isage, I fixed in pull-request #12, by adding working folder check.

rynho avatar Nov 04 '21 12:11 rynho