mirror of
https://git.sanhost.net/sanasol/hytale-f2p.git
synced 2026-02-26 06:41:47 -03:00
Add offset logging to debug which locations are being patched
Shows hex offset, bytes before/after each patch location to help identify if we're patching false positives. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user