pretty
This commit is contained in:
@@ -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`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user