Commit: a7d73a21e5348e7d47089874bcb12c618d6f6cb9 Parent: 4b5c34cd8a945d0aa48de17aecd10874391b6161 Author: Vi Grey Date: 2018-02-01 12:33 UTC Summary: Add safety buffer for end of zero padding of PRG neszip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neszip.py b/neszip.py index 03c1a31..16e1ac7 100755 --- a/neszip.py +++ b/neszip.py @@ -79,7 +79,8 @@ def reoffset_zip(n, z, i): def create_polyglot(n, z): new_nes_contents = b'' if len(n) - 8208 >= 16384: - i = n.rfind(b'\x00' * len(z), 16, 16400) + # 16392 gives an 8 byte buffer for end of PRG + i = n.rfind(b'\x00' * len(z), 16, 16392) if i != -1: new_nes_contents += n[:i] z_reoffset = reoffset_zip(n, z, i)