FreeCalypso > hg > freecalypso-reveng
annotate pirollback/analyze.c @ 185:a820d9f9adbf
leo-obj: started analyzing tpudrv.lib objects
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 11 Aug 2014 21:32:30 +0000 |
parents | 78ac405716db |
children |
rev | line source |
---|---|
42
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 #include <stdio.h> |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 #include <stdlib.h> |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 extern char *imgfile; |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 extern int last_inode; |
46
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
44
diff
changeset
|
6 extern int journal_start_ino; |
42
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 main(argc, argv) |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 char **argv; |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 { |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 if (argc != 2) { |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 fprintf(stderr, "usage: %s ffs-image\n", argv[0]); |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 exit(1); |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 } |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 imgfile = argv[1]; |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 read_img_file(); |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 read_inodes(); |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 printf("Last inode is #%x\n", last_inode); |
43
9f4469766c74
pirollback: tree walk implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
42
diff
changeset
|
19 walk_tree(); |
9f4469766c74
pirollback: tree walk implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
42
diff
changeset
|
20 printf("Tree walk succeeded\n"); |
44
074237879eca
pirollback: name check implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
43
diff
changeset
|
21 check_object_names(); |
074237879eca
pirollback: name check implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
43
diff
changeset
|
22 printf("Name check succeeded\n"); |
46
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
44
diff
changeset
|
23 parse_journal(); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
44
diff
changeset
|
24 printf("Journal parse successful, start inode is #%x\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
44
diff
changeset
|
25 journal_start_ino); |
42
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 exit(0); |
15c2ac2c5c73
pirollback: started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 } |