diff --git a/backend/utils/clientPatcher.js b/backend/utils/clientPatcher.js index 33e2df2..1922725 100644 --- a/backend/utils/clientPatcher.js +++ b/backend/utils/clientPatcher.js @@ -163,6 +163,14 @@ class ClientPatcher { const positions = this.findAllOccurrences(result, oldBytes); for (const pos of positions) { + // Log offset and surrounding bytes for debugging + const before = result.slice(Math.max(0, pos - 8), pos); + const after = result.slice(pos + oldBytes.length, Math.min(result.length, pos + oldBytes.length + 8)); + console.log(` Patching at offset 0x${pos.toString(16)} (${pos})`); + console.log(` Before: ${before.toString('hex')}`); + console.log(` Old pattern: ${oldBytes.slice(0, 20).toString('hex')}${oldBytes.length > 20 ? '...' : ''}`); + console.log(` After: ${after.toString('hex')}`); + // First fill the entire old pattern region with zeros // This prevents leftover bytes from causing memory corruption if (newBytes.length < oldBytes.length) {