Advertisement
aaaaaa123456789

Sample source code for the ipspatch IPS builder

May 1st, 2016
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :This is a sample source file for the IPS builder/compiler in ipspatch.
  2.  
  3. :Blank lines are ignored. Everything that starts with a colon (in column 1!) is considered a comment, too.
  4.  
  5.  
  6. :Each line will be built to a block of its own. Each block tells the IPS patcher where to start writing, and what to write.
  7.  
  8.  
  9. :A regular block just contains the start address and the data to write. All addresses must fit within 24 bits, and the data cannot exceed 65,535 bytes per block.
  10. :Also, you cannot use 454f46 as an address, because it is the end-of-file marker.
  11.  
  12. 012345: 12 23 34 45 56
  13. :That block tells the patcher to start writing at 0x012345, and write those particular bytes.
  14.  
  15. 023456: 12ab23bc34cd
  16. :You can add spacing as you wish in the data, including none at all. If the data contains an odd amount of digits, the last one will be discarded.
  17.  
  18. 34567: 89 01 2345
  19. :While every byte in the data needs to be two digits (because that determines the data length), you can omit leading zeros elsewhere.
  20.  
  21.  
  22. :A run block tells the patcher to repeat a single value for a certain amount of bytes, starting at a specified address.
  23. :All limitations about addresses are the same as regular blocks. The length cannot exceed 65,535 bytes either.
  24.  
  25. 9876: 10 * 4a
  26. :That tells the patcher to write 0x10 bytes with the value 0x4a starting at 0x9876 (so it will write 0x4a to the 0x9876 - 0x9885 range).
  27.  
  28. 10aad: 2300 * 0
  29. :The length can have up to 16 bits. You can also omit leading zeros both in the length and the value here.
  30.  
  31.  
  32. :That's everything that is allowed within a source IPS file. This sample file should be compiled to a .ips file without issues by ipspatch.
  33. :To compile it, run: ./ipspatch build sample.ips < sample.txt (assuming that sample.txt is this file, and sample.ips is your desired output file).
  34. :SHA-1 of the compiled patch: c9c046a874268dd15bc970e5b457271985a83bee
Advertisement
RAW Paste Data Copied
Advertisement