| 82 | #endif |
| 83 | |
| 84 | static uLong computePatchCRC(MFILE *f, unsigned int size) { |
| 85 | Bytef buf[4096]; |
| 86 | long readed; |
| 87 | |
| 88 | uLong crc = crc32(0L, Z_NULL, 0); |
| 89 | do { |
| 90 | readed = memfread(buf, 1, MIN(size, sizeof(buf)), f); |
| 91 | crc = crc32(crc, buf, readed); |
| 92 | size -= readed; |
| 93 | } while (readed > 0); |
| 94 | |
| 95 | return crc; |
| 96 | } |
| 97 | |
| 98 | bool patchApplyIPS(MFILE * f, u8 **r, int *s) { |
| 99 | // from the IPS spec at http://zerosoft.zophar.net/ips.htm |
no test coverage detected