This commit is contained in:
2025-11-19 22:01:25 +02:00
parent afef35b6f6
commit 3a7686713f
16 changed files with 276 additions and 212 deletions

View File

@@ -6,16 +6,16 @@ import { setConsoleTitle } from "@ocbwoy3/libocbwoy3";
setConsoleTitle("Roblox Studio patcher");
const SIGNATURE = Buffer.from([
0x48, 0x81, 0xEC, 0x40, 0x03, 0x00, 0x00, 0x84, 0xD2, 0x74, 0x05, 0xE8
0x48, 0x81, 0xec, 0x40, 0x03, 0x00, 0x00, 0x84, 0xd2, 0x74, 0x05, 0xe8,
]);
const PATCH = Buffer.from([
0x48, 0x81, 0xEC, 0x40, 0x03, 0x00, 0x00, 0x84, 0xD2, 0x90, 0x90, 0xE8
0x48, 0x81, 0xec, 0x40, 0x03, 0x00, 0x00, 0x84, 0xd2, 0x90, 0x90, 0xe8,
]);
const baseDir = path.join(
os.homedir(),
".var/app/org.vinegarhq.Vinegar/data/vinegar/versions"
".var/app/org.vinegarhq.Vinegar/data/vinegar/versions",
);
function findSignature(buffer: Buffer, signature: Buffer): number {
@@ -40,18 +40,25 @@ async function patchFile(folder: string) {
try {
binary = await fs.readFile(exePath);
} catch (err) {
console.error(`[ERROR] Could not read ${exePath}/RobloxStudioBeta.exe:`, err);
console.error(
`[ERROR] Could not read ${exePath}/RobloxStudioBeta.exe:`,
err,
);
return;
}
if (findSignature(binary, PATCH)) {
console.log(`[SKIP] ${folder}/RobloxStudioBeta.exe has already been patched`);
console.log(
`[SKIP] ${folder}/RobloxStudioBeta.exe has already been patched`,
);
return;
}
const offset = findSignature(binary, SIGNATURE);
if (offset === -1) {
console.error(`[FAIL] Signature not found in ${exePath}/RobloxStudioBeta.exe`);
console.error(
`[FAIL] Signature not found in ${exePath}/RobloxStudioBeta.exe`,
);
return;
}
@@ -85,7 +92,7 @@ async function main() {
const start = Date.now();
await Promise.all(folders.map(patchFile));
console.log(
`[DONE] Patched internal Roblox Studio in ${Date.now() - start}ms`
`[DONE] Patched internal Roblox Studio in ${Date.now() - start}ms`,
);
}