freemyipod r862 - Code Review

From freemyipod.org
Jump to: navigation, search
Repository:freemyipod
Revision:r861 | r862
Date:18:16, 22 February 2012
Author:theseven
Status:new
Tags:
Comment:emCORE: Fix a rather obvious FAT directory creation bug
Modified paths:
  • /emcore/trunk/fat.c (modified)

Diff [purge]

Index: emcore/trunk/fat.c
===================================================================
--- emcore/trunk/fat.c	(revision 861)
+++ emcore/trunk/fat.c	(revision 862)
@@ -1762,10 +1762,10 @@
             memcpy(&buf[0x20], "..         \x10", 12);

             ((uint16_t*)buf)[0xd] = newdir.firstcluster;

             ((uint16_t*)buf)[0xa] = newdir.firstcluster >> 16;

-            if(dir->file.firstcluster == fat_bpb->bpb_rootclus)

+            if(dir->file.firstcluster != fat_bpb->bpb_rootclus)

             {

-                ((uint16_t*)buf)[0x1d] = fat_bpb->bpb_rootclus;

-                ((uint16_t*)buf)[0x1a] = fat_bpb->bpb_rootclus >> 16;

+                ((uint16_t*)buf)[0x1d] = dir->file.firstcluster;

+                ((uint16_t*)buf)[0x1a] = dir->file.firstcluster >> 16;

             }

         }

         rc = transfer(IF_MV2(fat_bpb,) sector + i, 1, buf, true );

Personal tools
Namespaces
Variants
Views
Actions
Navigation
Info
Software
Basic skills
Reverse engineering Results
Exploiting
Hardware
Toolbox