freemyipod r956 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r955‎ | r956 | r957 >
Date:19:14, 16 June 2014
Author:theseven
Status:new
Tags:
Comment:
installer-ipodclassic: Revert r955. This was caused by using broken UMSboot builds.
Modified paths:
  • /apps/installer-ipodclassic/main.c (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/main.c
@@ -95,9 +95,7 @@
9696 for (i = 0; i < 16; i++) SHA1DATAIN[i] = tmp32[i];
9797 }
9898 else for (i = 0; i < 16; i++) SHA1DATAIN[i] = *databuf++;
99 - clean_dcache(); // Not sure why we need this, but apparently we do...
10099 SHA1CONFIG |= 2;
101 - invalidate_dcache(); // Not sure why we need this, but apparently we do...
102100 while (SHA1CONFIG & 1) sleep(0);
103101 SHA1CONFIG |= 8;
104102 }
@@ -231,19 +229,20 @@
232230 if (flags & 8)
233231 {
234232 offs = 0x800;
235 - size = ((size + 0xf) & ~0xf);
 233+ size = ((size + 0xf) & ~0xf) + offs;
236234 }
237235 if (flags & 1)
238236 {
239 - endptr -= ((offs + size + 0xfff) & ~0xfff);
 237+ endptr -= ((size + 0xfff) & ~0xfff);
 238+ memcpy(&norbuf[endptr + offs], data, size);
240239 file = endptr;
241240 }
242241 else
243242 {
 243+ memcpy(&norbuf[beginptr + offs], data, size);
244244 file = beginptr;
245 - beginptr += ((offs + size + 0xfff) & ~0xfff);
 245+ beginptr += ((size + 0xfff) & ~0xfff);
246246 }
247 - memcpy(&norbuf[file + offs], data, size);
248247 if (!(flags & 4))
249248 {
250249 if (dirptr >= 0x2000)
@@ -256,6 +255,7 @@
257256 }
258257 if (flags & 8)
259258 {
 259+ size -= offs;
260260 memset(&norbuf[file], 0, 0x800);
261261 memcpy(&norbuf[file], "87021.0\x01", 8);
262262 *((uint32_t*)&norbuf[file + 0xc]) = size;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r955installer-ipodclassic: Avoid SHA1 trouble for now. We should figure out the r...theseven18:30, 16 June 2014