buddy-reroll 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/companion.js +2 -0
- package/lib/companion.test.js +6 -0
- package/package.json +1 -1
package/lib/companion.js
CHANGED
|
@@ -113,6 +113,8 @@ function findCurrentSalt(binaryData) {
|
|
|
113
113
|
for (const candidate of candidates) {
|
|
114
114
|
if (/[\d-]/.test(candidate)) return candidate;
|
|
115
115
|
}
|
|
116
|
+
// Brute-forced salts can be purely alphabetic — accept any candidate
|
|
117
|
+
if (candidates.size > 0) return candidates.values().next().value;
|
|
116
118
|
|
|
117
119
|
return null;
|
|
118
120
|
}
|
package/lib/companion.test.js
CHANGED
|
@@ -127,6 +127,12 @@ describe("findCurrentSalt", () => {
|
|
|
127
127
|
expect(findCurrentSalt(data)).toBe(patchedSalt);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
+
it("finds purely-alphabetic patched salt via context markers", () => {
|
|
131
|
+
const alphaSalt = "zaxZaEwKsjWqmfz";
|
|
132
|
+
const data = Buffer.from(`some data "${alphaSalt}" inspirationSeed more data`);
|
|
133
|
+
expect(findCurrentSalt(data)).toBe(alphaSalt);
|
|
134
|
+
});
|
|
135
|
+
|
|
130
136
|
it("returns null when no salt found", () => {
|
|
131
137
|
const data = Buffer.from("no salt here at all");
|
|
132
138
|
expect(findCurrentSalt(data)).toBeNull();
|