1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-06-27 16:25:54 +00:00

fixed important bugs while creating IPS patches and applying some BPS patches

This commit is contained in:
Marc Robledo 2018-09-26 12:47:44 +02:00
parent 860a2c33c4
commit 9d85db3baa
5 changed files with 24 additions and 10 deletions

4
ips.js
View file

@ -1,4 +1,4 @@
/* IPS module for RomPatcher.js v20180919 - Marc Robledo 2016-2018 - http://www.marcrobledo.com/license */
/* IPS module for RomPatcher.js v20180925 - Marc Robledo 2016-2018 - http://www.marcrobledo.com/license */
/* File format specification: http://www.smwiki.net/wiki/IPS_file_format */
var MAX_IPS_SIZE=16777216;
@ -169,7 +169,7 @@ function createIPSFromFiles(original, modified){
/* force length to be 0xffff-6 bytes to keep IPS standard */
var nearbyDifference=true;
while(nearbyDifference && length<(0xffff-6)){
if(seek+6>modified.fileSize){
if((seek+6)>=modified.fileSize){
var finalSeek=modified.fileSize-seek-1;
length+=finalSeek;
seek+=finalSeek;