Hi! 17-Ноя-2004 18:01 [EMAIL PROTECTED] (Luchezar Georgiev) wrote to [EMAIL PROTECTED]:
LG> +++ exeflat.c 17 Nov 2004 18:01:54 -0000 1.9.2.4 LG> +int exeflat(int UPX, const char *srcfile, const char *dstfile, LG> + const char *start, short *silentSegments, short silentcount) LG> { LG> if (fread(&header, sizeof(header), 1, src) != 1) LG> { LG> - printf("Error reading header from %s\n", argv[1]); LG> + printf("Error reading header from %s\n", srcfile); LG> fclose(src); LG> - return 1; LG> + exit(1); LG> } Small optimization: because BC doesn't knows, that exit() doesn't returns, better to insert explicit "return 0;" after exit() or return error code through return (remaining error handling for main()). For BC, this allows to join common tails. LG> + qsort(reloc, header.exRelocItems, sizeof(reloc[0]), compReloc); Why to spend extra time for sorting relocations? LG> + for (j = 0; j < silentcount; j++) LG> + if (segment == silentSegments[j]) LG> + { LG> + silentdone++; LG> + goto dontPrint; LG> + } Never understand this option. (Though, don't try to study its meaning deeper). The more so, me always annoying tons of some information about some relocations, which garbaes output after exeflat. ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel