News: 11 March 2016 - Forum Rules

Author Topic: ipsnect, an IPS patch inspector  (Read 1972 times)

NaOH

  • Jr. Member
  • **
  • Posts: 36
  • Modernizing old games
    • View Profile
ipsnect, an IPS patch inspector
« on: February 03, 2018, 08:42:34 pm »
While trying to track down a stray byte I edited in the ROMhack I'm working on, I decided to write my own utility to aid in the search.

IPSnect is a command-line utility that displays a list of all hunks in an IPS patch, and the content of each hunk. You can also provide it with a binary file to compare against, and it will show you the new bytes, original bytes, and an optional surrounding context of bytes.

Windows: https://github.com/nstbayless/ipsnect/releases/download/v1.01/ipsnect.exe
Linux: https://github.com/nstbayless/ipsnect/releases/download/v1.01/ipsnect
Source: https://github.com/nstbayless/ipsnect

Sample output:

Code: [Select]
$ ./ipsnect patch.ips base.bin

====== IPS summary ======
hunks: 3
regular hunks: 2
RLE hunks:     1
sum of hunk lengths: x00000044 bytes (68 bytes)
========= hunks =========

regular hunk on bytes x017F17-x017F3B (37 bytes)
------------- in unpatched binary: ------------
C5 FF FF FF 85 FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF A3 FF FF FF FF FF
FF FF FF FF D3
---------------- in IPS patch: ----------------
A0 00 8C 09 05 AD 20 05 10 01 60 A5 2A 29 04 D0
F9 A2 10 A9 00 20 DE FC D0 F0 EA EA EA EA EA EA
EA A2 00 8A 48


regular hunk on byte x03965D (1 byte)
------------- in unpatched binary: ------------
9D
---------------- in IPS patch: ----------------
8D


RLE hunk on bytes x001016-x000FF6 (30 bytes)
------------- in unpatched binary: ------------
A5 2A 85 10 A2 00 A9 16 9D 00 04 A9 00 9D C1 05
A9 09 9D A5 2A 85 10 A2 00 A9 16 9D 00 04
---------------- in IPS patch: ----------------
FE FE FE FE ... (repeats for 30 bytes)