Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

0.9.5 Increased portability to Windows via MinGW32

  • Loading branch information...
commit 87a8fbc4bf98de39bad8e12063342b1886e85379 1 parent a20d00b
anaria28 authored

Showing 1 changed file with 90 additions and 83 deletions. Show diff stats Hide diff stats

  1. +90 83 NORDumpTool.c
173 NORDumpTool.c
@@ -7,13 +7,13 @@
7 7 // - Extract some specific console information (S/N, MAC, and so on)
8 8 //
9 9 // Versions :
  10 +// 0.9.5 Increased portability to Windows via MinGW32
10 11 // 0.9.4 Fixed stupid mistake in ReadSection() (Thx @Sarah1331)
11 12 // 0.9.3 Added checking of area filled with unique byte(s) e.g. in flash format: 0x210 -> 0x3FF : full of FF
12 13 // 0.9.2 memory allocation fix (Thx @judges) in CheckPerConsoleData() + fixed wrong English (mixed French...) in main()
13 14 // 0.9.1 Added -D option to display a specific section in Hexa or ASCII
14 15 // 0.9.0 First public release
15 16
16   -
17 17 #include <sys/stat.h>
18 18 #include <unistd.h>
19 19 #include <stdio.h>
@@ -22,6 +22,14 @@
22 22 #include <stdint.h>
23 23 #include <openssl/md5.h>
24 24
  25 +#ifdef __MINGW32__
  26 +// for windows
  27 +#define MKDIR(x,y) mkdir(x)
  28 +#else
  29 +// for the real world
  30 +#define MKDIR(x,y) mkdir(x,y)
  31 +#endif
  32 +
25 33 #define HexaType 0
26 34 #define ASCIIType 1
27 35 #define DisplayAlways 2
@@ -114,7 +122,7 @@ struct IndividualSystemData{
114 122 char* MinFW;
115 123 };
116 124
117   -static struct IndividualSystemData CheckPerSKU[50] = {
  125 +static struct IndividualSystemData CheckPerSKU[] = {
118 126 {"01","DEH-Z1010","1420","113E",0x2D020,"2CFE","2CFE","<=0.80.004"},
119 127 {"01","DECR-1000","EC40","0EC0",0x2A840,"2A7F","2A7F","<=0.85.009"},
120 128 {"01","DEH-H1001-D?","EC40","0EC0",0x2A830,"2A7F","2A7F","<=0.85.009"},
@@ -160,8 +168,7 @@ static struct IndividualSystemData CheckPerSKU[50] = {
160 168 {"0B","CECH-25xx(JSD-001) factory FW 3.60 datecode 1B","F920","0F8E",0x2FFF0,"2FFB","2FFB","3.6"},
161 169 {"0B","CECH-25xx(JTP-001) factory FW 3.60","F920","0F8E",0x2FFF0,"2FFB","2FFB","3.6"},
162 170 {"0C","CECH-30xx(KTE-001) factory FW 3.65","F920","0F8E",0x2FFF0,"2FFB","2FFB","3.6"},
163   - {"0D","CECH-40xx(MSX-001)","","",0,"","","4.10?"},
164   - {"0D","CECH-40xx(MPX-001)","","",0,"","",""},
  171 + {"0D","CECH-40xx(MSX-001 or MPX-001)","F9B0","0F97",0x301F0,"301B","301B","4.20"},
165 172 {NULL,NULL,NULL,NULL,0,NULL,NULL,NULL}
166 173 };
167 174
@@ -172,21 +179,21 @@ void MD5SumFileSection(char* SectionText, FILE *FileToRead, uint32_t Position, u
172 179 int DataWidth = 0x10;
173 180 unsigned char DataValue[DataWidth];
174 181 MD5_CTX mdContext;
175   -
  182 +
176 183 MD5_Init (&mdContext);
177   -
  184 +
178 185 fseek(FileToRead, Position, SEEK_SET);
179 186 for (Cursor=0;Cursor<NOR_FILE_SIZE;Cursor+=DataWidth) {
180 187 ByteSize = fread (DataValue, 1, DataWidth, FileToRead);
181 188 MD5_Update (&mdContext, DataValue, ByteSize);
182 189 }
183   -
  190 +
184 191 MD5_Final (MD5Sum,&mdContext);
185   -
  192 +
186 193 printf ("%s", SectionText);
187 194 for(Cursor = 0; Cursor < MD5_DIGEST_LENGTH; Cursor++)
188 195 printf("%02x", MD5Sum[Cursor]);
189   -
  196 +
190 197 printf("\n");
191 198 }
192 199
@@ -194,21 +201,21 @@ uint8_t ExtractSection(char* SectionName, FILE *FileToRead, uint32_t Position, u
194 201 uint32_t Cursor;
195 202 char *Buffer;
196 203 FILE *BinaryFile2;
197   -
  204 +
198 205 BinaryFile2 = fopen(SectionName, "wb");
199 206 if (!BinaryFile2) {
200 207 printf("Failed to open %s\n", SectionName);
201 208 return EXIT_FAILURE;
202 209 }
203   -
  210 +
204 211 fseek(FileToRead, Position, SEEK_SET);
205   -
  212 +
206 213 if((Buffer = malloc(Size + 1)))
207 214 fread(Buffer, Size, 1, FileToRead);
208   -
  215 +
209 216 for (Cursor=0;Cursor<Size;Cursor++)
210 217 fputc(Buffer[Cursor], BinaryFile2);
211   -
  218 +
212 219 printf("Extraction done for %s\n", SectionName);
213 220 fclose(BinaryFile2);
214 221 return EXIT_SUCCESS;
@@ -220,47 +227,47 @@ void Statistics(FILE *FileToRead) {
220 227 uint16_t Counter;
221 228 uint32_t CountOthers=0;
222 229 uint32_t CountByte[0xFF+1];
223   -
  230 +
224 231 char *Status00="";
225 232 char *StatusFF="";
226 233 char *StatusOthers="";
227   -
  234 +
228 235 printf("******************************\n");
229 236 printf("* Statistics *\n");
230 237 printf("******************************\n");
231   -
  238 +
232 239 fseek(FileToRead, 0, SEEK_SET);
233   -
  240 +
234 241 for (Counter=0x00;Counter<0xFF+1;Counter++)
235 242 CountByte[Counter]=0;
236   -
  243 +
237 244 for (Cursor=0;Cursor<NOR_FILE_SIZE;Cursor++)
238 245 CountByte[fgetc(FileToRead)]+=1;
239   -
  246 +
240 247 for (Counter=0x01;Counter<0xFF;Counter++) {
241 248 if (CountOthers<CountByte[Counter])
242 249 CountOthers=CountByte[Counter];
243 250 }
244   -
  251 +
245 252 if (CountByte[0x00]<Min00)
246 253 Status00="Too Low";
247 254 else if (CountByte[0x00]>Max00)
248 255 Status00="Too High";
249 256 else
250 257 Status00="Good";
251   -
  258 +
252 259 if (CountByte[0xFF]<MinFF)
253 260 StatusFF="Too Low";
254 261 else if (CountByte[0xFF]>MaxFF)
255 262 StatusFF="Too High";
256 263 else
257 264 StatusFF="Good";
258   -
  265 +
259 266 if (CountOthers>MaxOthers)
260 267 StatusOthers="Too High";
261 268 else
262 269 StatusOthers="Good";
263   -
  270 +
264 271 printf ("Bytes '00' found %d times, %2.2f%% %s\n", CountByte[0x00], (double)CountByte[0x00]*100/(double)NOR_FILE_SIZE, Status00);
265 272 printf ("Bytes 'FF' found %d times, %2.2f%% %s\n", CountByte[0xFF], (double)CountByte[0xFF]*100/(double)NOR_FILE_SIZE, StatusFF);
266 273 printf ("Other bytes found %d times maximum, %2.2f%% %s\n", CountOthers, (double)CountOthers*100/(double)NOR_FILE_SIZE, StatusOthers);
@@ -277,15 +284,15 @@ void GetSection(FILE *FileToRead, uint32_t Position, uint8_t Size, char DisplayT
277 284
278 285 uint16_t Cursor;
279 286 *SectionData=NULL;
280   -
  287 +
281 288 fseek(FileToRead, Position, SEEK_SET);
282   -
  289 +
283 290 if (((DisplayType)&(1<<0))==HexaType) {
284 291 for (Cursor=0;Cursor<Size;Cursor++){
285 292 sprintf(SectionData, "%s%02X", SectionData, fgetc(FileToRead));
286 293 }
287 294 }
288   -
  295 +
289 296 else if (((DisplayType)&(1<<0))==ASCIIType) {
290 297 fread(SectionData, Size, 1, FileToRead);
291 298 SectionData[Size]=NULL;
@@ -302,27 +309,26 @@ uint8_t ReadSection(char *SectionName, FILE *FileToRead, uint32_t Position, uint
302 309 // char DisplayType : Print out in Hexa or ASCII, always or only if fail to check
303 310 // char CheckFlag : Check a given pattern
304 311 // char *CheckPattern : Pattern to check, has to be the same size of data read
305   -
  312 +
306 313 uint8_t Cursor;
307 314 uint8_t Status=EXIT_SUCCESS;
308 315 char DisplaySection[0x100]="";
309   -
  316 +
310 317 fseek(FileToRead, Position, SEEK_SET);
311   -
  318 +
312 319 for (Cursor=0;Cursor<Size;Cursor++) {
313 320 if (((DisplayType)&(1<<0))==HexaType)
314 321 sprintf(DisplaySection, "%s%02X", DisplaySection,fgetc(FileToRead));
315   -
  322 +
316 323 else if (((DisplayType)&(1<<0))==ASCIIType)
317 324 sprintf(DisplaySection, "%s%c", DisplaySection,fgetc(FileToRead));
318 325 }
319   -
  326 +
320 327 if (((DisplayType)&(1<<1))==DisplayAlways)
321 328 printf ("Section: %s: read %s \n", SectionName, DisplaySection);
322   -
  329 +
323 330 if (CheckFlag) {
324 331 for (Cursor=0;Cursor<Size;Cursor++) {
325   -
326 332 if (((DisplayType)&(1<<0))==ASCIIType) {
327 333 if (DisplaySection[Cursor]!=CheckPattern[Cursor]) {
328 334 Status=EXIT_FAILURE;
@@ -331,7 +337,6 @@ uint8_t ReadSection(char *SectionName, FILE *FileToRead, uint32_t Position, uint
331 337 return Status;
332 338 }
333 339 }
334   -
335 340 else if (((DisplayType)&(1<<0))==HexaType) {
336 341 if ((DisplaySection[Cursor*2]!=CheckPattern[Cursor*2])||(DisplaySection[Cursor*2+1]!=CheckPattern[Cursor*2+1])) {
337 342 Status=EXIT_FAILURE;
@@ -388,7 +393,7 @@ uint8_t CheckGenericData(FILE *FileToRead) {
388 393 {"FlashRegion 11 name ", SectionTOC[FlashRegion].Offset+0x0200, 0x05, ASCIIType+DisplayFailOnly, 1, "cvtrm"},
389 394 {NULL, 0, 0, 0, 0, NULL}
390 395 };
391   -
  396 +
392 397 printf("******************************\n");
393 398 printf("* Generic Data *\n");
394 399 printf("******************************\n");
@@ -406,25 +411,24 @@ uint8_t CheckGenericData(FILE *FileToRead) {
406 411 }
407 412
408 413 uint8_t CheckPerConsoleData(FILE *FileToRead) {
409   -
410 414 int Cursor=0;
411 415 int SKUFound=0;
412 416 uint8_t Status=EXIT_SUCCESS;
413 417 char *DataRead;
414 418 DataRead = malloc(0x100);
415   -
  419 +
416 420 char *IDPSTargetID;
417 421 char *metldrOffset0;
418 422 char *metldrOffset1;
419 423 char *bootldrOffset0;
420 424 char *bootldrOffset1;
421   -
  425 +
422 426 IDPSTargetID = malloc(3);
423 427 metldrOffset0 = malloc(5);
424 428 metldrOffset1 = malloc(5);
425 429 bootldrOffset0 = malloc(5);
426 430 bootldrOffset1 = malloc(5);
427   -
  431 +
428 432 struct Sections SectionPerConsole[] = {
429 433 {"mtldr size and rev ", SectionTOC[asecure_loader].Offset+0x40, 0x10, HexaType+DisplayAlways, 0, ""},
430 434 {"mtldr size and pcn ", SectionTOC[asecure_loader].Offset+0x50, 0x10, HexaType+DisplayAlways, 0, ""},
@@ -456,11 +460,11 @@ uint8_t CheckPerConsoleData(FILE *FileToRead) {
456 460 {"cvtrm hdr bis ", SectionTOC[cvtrm].Offset+0x024004, 0x04, HexaType+DisplayFailOnly, 1, "5654524D"},
457 461 {NULL, 0, 0, 0, 0, NULL}
458 462 };
459   -
  463 +
460 464 printf("******************************\n");
461 465 printf("* Per Console Data *\n");
462 466 printf("******************************\n");
463   -
  467 +
464 468 while (SectionPerConsole[Cursor].name!=NULL) {
465 469 Status = Status | ReadSection(SectionPerConsole[Cursor].name
466 470 , FileToRead
@@ -471,19 +475,19 @@ uint8_t CheckPerConsoleData(FILE *FileToRead) {
471 475 , SectionPerConsole[Cursor].Pattern);
472 476 Cursor++;
473 477 }
474   -
  478 +
475 479 GetSection(FileToRead, SectionTOC[asecure_loader].Offset+0x40, 0x04, HexaType, DataRead);
476 480 Status = Status | ReadSection("metldr hdr",FileToRead, SectionTOC[asecure_loader].Offset+0x50, 0x04, HexaType+DisplayFailOnly, 1, DataRead);
477   -
  481 +
478 482 GetSection(FileToRead, SectionTOC[bootldr].Offset, 0x04, HexaType, DataRead);
479 483 Status = Status | ReadSection("Bootldr hdr",FileToRead, SectionTOC[bootldr].Offset+0x10, 0x04, HexaType+DisplayFailOnly, 1, DataRead);
480   -
  484 +
481 485 GetSection(FileToRead, SectionTOC[eEID].Offset+0x77, 0x01, HexaType, IDPSTargetID);
482 486 GetSection(FileToRead, SectionTOC[asecure_loader].Offset+0x1E, 0x02, HexaType, metldrOffset0);
483 487 GetSection(FileToRead, SectionTOC[asecure_loader].Offset+0x42, 0x02, HexaType, metldrOffset1);
484 488 GetSection(FileToRead, SectionTOC[bootldr].Offset+0x02, 0x02, HexaType, bootldrOffset0);
485 489 GetSection(FileToRead, SectionTOC[bootldr].Offset+0x12, 0x02, HexaType, bootldrOffset1);
486   -
  490 +
487 491 Cursor=0;
488 492 while (CheckPerSKU[Cursor].IDPSTargetID!=NULL) {
489 493 if ((strcmp(CheckPerSKU[Cursor].IDPSTargetID,IDPSTargetID)==0)
@@ -496,7 +500,7 @@ uint8_t CheckPerConsoleData(FILE *FileToRead) {
496 500 }
497 501 Cursor++;
498 502 }
499   -
  503 +
500 504 if (!SKUFound){
501 505 printf("Data found in NOR to identify the SKU are:\n- TargetID:'%s'\n", IDPSTargetID);
502 506 printf("- metldr Offset 0:'%s'\n", metldrOffset0);
@@ -504,7 +508,7 @@ uint8_t CheckPerConsoleData(FILE *FileToRead) {
504 508 printf("- bootldr Offset 0:'%s'\n", bootldrOffset0);
505 509 printf("- bootldr Offset 1:'%s'\n", bootldrOffset1);
506 510 }
507   -
  511 +
508 512 free(IDPSTargetID);
509 513 free(metldrOffset0);
510 514 free(metldrOffset1);
@@ -523,16 +527,16 @@ uint8_t CheckFilledData (FILE *FileToRead){
523 527 uint32_t bootldrFilledSize;
524 528 uint32_t metldrSize;
525 529 uint32_t metldrFilledSize;
526   -
  530 +
527 531 char *metldrOffset0;
528 532 char *bootldrOffset0;
529   -
  533 +
530 534 metldrOffset0 = malloc(5);
531 535 bootldrOffset0 = malloc(5);
532 536 printf("******************************\n");
533 537 printf("* Area filled with 00 or FF *\n");
534 538 printf("******************************\n");
535   -
  539 +
536 540 GetSection(FileToRead, SectionTOC[asecure_loader].Offset+0x42, 0x02, HexaType, metldrOffset0);
537 541 metldrSize = (strtol(metldrOffset0,NULL,16))*0x10+0x40;
538 542 metldrFilledSize = 0x2F000 - metldrSize - SectionTOC[asecure_loader].Offset - 0x40;
@@ -540,7 +544,7 @@ uint8_t CheckFilledData (FILE *FileToRead){
540 544 GetSection(FileToRead, SectionTOC[bootldr].Offset+0x02, 0x02, HexaType, bootldrOffset0);
541 545 bootldrSize = (strtol(bootldrOffset0,NULL,16))*0x10+0x40;
542 546 bootldrFilledSize = 0x1000000 - bootldrSize - SectionTOC[bootldr].Offset;
543   -
  547 +
544 548 struct Sections SectionFilled[] = {
545 549 {"flashformat", 0x000210, 0x01F0, HexaType+DisplayFailOnly, 1, "FF"},
546 550 {"asecure_loader", SectionTOC[asecure_loader].Offset+0x40+metldrSize, metldrFilledSize, HexaType+DisplayFailOnly, 1, "00"},
@@ -567,7 +571,7 @@ uint8_t CheckFilledData (FILE *FileToRead){
567 571 {"bootldr", SectionTOC[bootldr].Offset+bootldrSize, bootldrFilledSize, HexaType+DisplayFailOnly, 1, "FF"},
568 572 {NULL, 0, 0, 0, 0, NULL}
569 573 };
570   -
  574 +
571 575 while (SectionFilled[Cursor].name!=NULL) {
572 576 for (Cursor2=0;Cursor2<SectionFilled[Cursor].Size;Cursor2++) {
573 577 if ((Status2 = ReadSection(SectionFilled[Cursor].name
@@ -607,35 +611,39 @@ int main(int argc, char *argv[]) {
607 611 struct Options Option[NBOptions];
608 612 uint32_t ExtractionSize;
609 613 char DisplaySection[0x30];
610   -
  614 +
611 615 printf("******************************\n");
612 616 printf("* NOR Dump Tool *\n");
613 617 printf("******************************\n");
  618 + printf("\nVersion 0.9.5\n");
614 619 printf("\nOpen source project aimed to help to validate PS3 NOR dumps\n");
615 620 printf("At the moment (January 2013) the code is probably able\n");
616 621 printf("to give you a validation status of roughly 90%%!?\n");
617 622 printf("It's anyway better to do additional checking by your own,\n");
618 623 printf("unless the code of this tool is fully validated by experts!!!\n\n");
619   -
620   - if (argc < 2) {
  624 +
  625 + if ((argc < 2)||(strcmp(argv[1], "--help")==0)) {
621 626 printf("Usage: %s NorFile.bin (Options)\n", argv[0]);
622   - printf("Option: -P : Give percentage of bytes\n");
623   - printf("Option: -G : Check PS3 Generic information\n");
624   - printf("Option: -C : Check and display perconsole information\n");
625   - printf("Option: -F : Check areas filled with '00' or 'FF'\n");
626   - printf("Option: -S FolderName : Split some NOR section to folder 'FolderName'\n");
627   - printf("Option: -M Start Size : Run MD5 sum on file from 'Start' for 'Size' long\n");
628   - printf("Option: -E FileName Start Size : Extract specific NOR Section from 'Start' for 'Size' long\n");
629   - printf("Option: -D Start Size H/A : Display a specific NOR Section from 'Start' for 'Size' long,\n\t\tuse H or A for Hexa or ASCII\n");
630   - printf("By default -P -G -C and -F will be applied if no option is given\n");
  627 + printf("Options:\n");
  628 + printf("\t--help: Display this help.\n");
  629 + printf("\t-P : Give percentage of bytes\n");
  630 + printf("\t-G : Check PS3 Generic information\n");
  631 + printf("\t-C : Check and display perconsole information\n");
  632 + printf("\t-F : Check areas filled with '00' or 'FF'\n");
  633 + printf("\t-S FolderName : Split some NOR section to folder 'FolderName'\n");
  634 + printf("\t-M Start Size : Run MD5 sum on file from 'Start' for 'Size' long\n");
  635 + printf("\t-E FileName Start Size : Extract specific NOR Section from 'Start' for 'Size' long\n");
  636 + printf("\t-D Start Size H/A : Display a specific NOR Section from 'Start' for 'Size' long,\n\t\tuse H or A for Hexa or ASCII\n");
  637 + printf("\nBy default -P -G -C and -F will be applied if no option is given\n");
  638 + printf("\nRepo: <https://github.com/anaria28/NOR-Dump-Tool>\n");
631 639 return EXIT_FAILURE;
632 640 }
633   -
  641 +
634 642 if (argc==2)
635 643 {
636 644 OptionType = StatisticsOption + CheckGenericOption + CheckPerPS3Option + CheckFilledOption;
637 645 }
638   -
  646 +
639 647 for (Cursor=1;Cursor<argc;Cursor++)
640 648 {
641 649 if (strcmp(argv[Cursor], "-S")==0){
@@ -681,33 +689,32 @@ int main(int argc, char *argv[]) {
681 689 OptionType = OptionType + CheckFilledOption;
682 690 }
683 691 }
684   -
  692 +
685 693 BinaryFile = fopen(argv[1], "rb");
686 694 if (!BinaryFile) {
687 695 printf("Failed to open %s\n", argv[1]);
688 696 return EXIT_FAILURE;
689 697 }
690   -
  698 +
691 699 fseek(BinaryFile, 0, SEEK_END);
692 700 if ((FileLength=ftell(BinaryFile))!=NOR_FILE_SIZE) {
693 701 printf("File size not correct for NOR, %d Bytes instead of %d\n", FileLength, NOR_FILE_SIZE);
694 702 return EXIT_FAILURE;
695 703 }
696   -
  704 +
697 705 if (((OptionType)&(1<<0))==SplitOption) {
698 706 printf("******************************\n");
699 707 printf("* Splitting NOR Dump *\n");
700 708 printf("******************************\n");
701   -
702   - Status = mkdir(Option[0].Name,777);
703   -
  709 +
  710 + Status = MKDIR(Option[0].Name,777);
  711 +
704 712 if (chdir(Option[0].Name)){
705 713 printf("Failed to use folder %s\n", Option[0].Name);
706 714 return EXIT_FAILURE;
707 715 }
708 716 GetSection(BinaryFile, SectionTOC[asecure_loader].Offset+0x18, 0x08, HexaType, DataRead);
709 717 ExtractionSize=strtol(DataRead,NULL,16);
710   - printf("Debug Dataread : '%s' / ExtractionSize : '%08X'\n",DataRead,ExtractionSize);
711 718 Status = ExtractSection("asecure_loader", BinaryFile,SectionTOC[asecure_loader].Offset+0x40,ExtractionSize);
712 719 Status = ExtractSection("eEID", BinaryFile,SectionTOC[eEID].Offset,SectionTOC[eEID].Size);
713 720 Status = ExtractSection("cISD", BinaryFile,SectionTOC[cISD].Offset,SectionTOC[cISD].Size);
@@ -722,32 +729,32 @@ int main(int argc, char *argv[]) {
722 729 Status = ExtractSection("CELL_EXTNOR_AREA", BinaryFile,SectionTOC[CELL_EXTNOR_AREA].Offset,SectionTOC[CELL_EXTNOR_AREA].Size);
723 730 Status = ExtractSection("bootldr", BinaryFile,SectionTOC[bootldr].Offset,SectionTOC[bootldr].Size);
724 731 }
725   -
  732 +
726 733 if (((OptionType)&(1<<1))==MD5Option) {
727 734 printf("******************************\n");
728 735 printf("* MD5 Sum on Section *\n");
729 736 printf("******************************\n");
730 737 MD5SumFileSection("Chosen section MD5 sum is: ",BinaryFile,Option[1].Start,Option[1].Size);
731 738 }
732   -
  739 +
733 740 if (((OptionType)&(1<<2))==ExtractOption) {
734 741 printf("******************************\n");
735 742 printf("* Extracting Section *\n");
736 743 printf("******************************\n");
737 744 Status = ExtractSection(Option[2].Name, BinaryFile, Option[2].Start, Option[2].Size);
738 745 }
739   -
  746 +
740 747 if (((OptionType)&(1<<3))==StatisticsOption) {
741 748 Statistics(BinaryFile);
742 749 }
743   -
  750 +
744 751 // Checking not done yet for a byte reserved dump it's then better to warn and exit for now.
745 752 if ((ReadSection("ByteReserved? ", BinaryFile, SectionTOC[FlashStart].Offset+0x14, 0x04, HexaType, 1, "0FACE0FF")==EXIT_FAILURE)
746 753 && (ReadSection("ByteReserved? ", BinaryFile, SectionTOC[FlashStart].Offset+0x14, 0x04, HexaType, 1, "AC0FFFE0")==EXIT_SUCCESS)) {
747 754 printf("Not treating byte reversed dump at the moment.\n");
748 755 return EXIT_FAILURE;
749 756 }
750   -
  757 +
751 758 if (((OptionType)&(1<<4))==CheckGenericOption) {
752 759 if((Status = CheckGenericData(BinaryFile))) {
753 760 printf("Some checking were not successful.\n");
@@ -758,7 +765,7 @@ int main(int argc, char *argv[]) {
758 765 printf("Seems good, but you'd eventually like to be carefull!\n");
759 766 }
760 767 }
761   -
  768 +
762 769 if (((OptionType)&(1<<5))==CheckPerPS3Option) {
763 770 if((Status = CheckPerConsoleData(BinaryFile))) {
764 771 printf("Some checking were not successful.\n");
@@ -769,12 +776,12 @@ int main(int argc, char *argv[]) {
769 776 printf("Seems good, but you'd eventually like to be carefull!\n");
770 777 }
771 778 }
772   -
  779 +
773 780 if (((OptionType)&(1<<6))==DisplayAreaOption) {
774 781 sprintf(DisplaySection, "Start at '0x%08X' of size '0x%02X'", Option[6].Start, Option[6].Size);
775 782 Status = ReadSection(DisplaySection, BinaryFile, Option[6].Start, Option[6].Size, Option[6].Type, 0, "");
776 783 }
777   -
  784 +
778 785 if (((OptionType)&(1<<7))==CheckFilledOption) {
779 786 if((Status = CheckFilledData(BinaryFile))) {
780 787 printf("Some checking were not successful.\n");
@@ -784,8 +791,8 @@ int main(int argc, char *argv[]) {
784 791 else {
785 792 printf("Seems good, but you'd eventually like to be carefull!\n");
786 793 }
787   -
788 794 }
  795 +
789 796 free(DataRead);
790 797 fclose(BinaryFile);
791 798 return EXIT_SUCCESS;

0 comments on commit 87a8fbc

Please sign in to comment.
Something went wrong with that request. Please try again.