diff ffstools/tiffs-rd/main.c @ 231:5ceacdbd4490

tiffs IVA: finds the root inode
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 26 Jan 2014 08:11:42 +0000
parents ffaa033e7643
children ae9ff2d1e3da
line wrap: on
line diff
--- a/ffstools/tiffs-rd/main.c	Sun Jan 26 00:34:22 2014 +0000
+++ b/ffstools/tiffs-rd/main.c	Sun Jan 26 08:11:42 2014 +0000
@@ -10,13 +10,7 @@
 #include <string.h>
 #include <strings.h>
 #include "types.h"
-
-char *imgfile;
-u32 eraseblk_size;
-int total_blocks;
-u32 total_ffs_size;
-int index_blk_num = -1, root_node_no;
-int verbose;
+#include "globals.h"
 
 parse_org_arg(arg)
 	char *arg;
@@ -56,6 +50,7 @@
 		exit(1);
 	}
 	total_ffs_size = eraseblk_size * total_blocks;
+	inode_limit = eraseblk_size >> 4;
 }
 
 extern int cmd_blkhdr();
@@ -89,7 +84,7 @@
 			index_blk_num = atoi(optarg);
 			continue;
 		case 'r':
-			root_node_no = atoi(optarg);
+			root_inode = strtoul(optarg, 0, 16);
 			continue;
 		case 'v':
 			verbose++;