freemyipod r958 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r957‎ | r958 | r959 >
Date:19:32, 16 June 2014
Author:theseven
Status:new
Tags:
Comment:
installer-ipodclassic: Un-revert r954
Modified paths:
  • /apps/installer-ipodclassic/main.c (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/main.c
@@ -229,20 +229,19 @@
230230 if (flags & 8)
231231 {
232232 offs = 0x800;
233 - size = ((size + 0xf) & ~0xf) + offs;
 233+ size = ((size + 0xf) & ~0xf);
234234 }
235235 if (flags & 1)
236236 {
237 - endptr -= ((size + 0xfff) & ~0xfff);
238 - memcpy(&norbuf[endptr + offs], data, size);
 237+ endptr -= ((offs + size + 0xfff) & ~0xfff);
239238 file = endptr;
240239 }
241240 else
242241 {
243 - memcpy(&norbuf[beginptr + offs], data, size);
244242 file = beginptr;
245 - beginptr += ((size + 0xfff) & ~0xfff);
 243+ beginptr += ((offs + size + 0xfff) & ~0xfff);
246244 }
 245+ memcpy(&norbuf[file + offs], data, size);
247246 if (!(flags & 4))
248247 {
249248 if (dirptr >= 0x2000)
@@ -255,7 +254,6 @@
256255 }
257256 if (flags & 8)
258257 {
259 - size -= offs;
260258 memset(&norbuf[file], 0, 0x800);
261259 memcpy(&norbuf[file], "87021.0\x01", 8);
262260 *((uint32_t*)&norbuf[file + 0xc]) = size;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r954installer-ipodclassic: Fix 0x800 bytes of garbage data being written to boot ...theseven17:29, 16 June 2014