In this example of my code, it will skip the first 3804 bytes of data and print Ô at the 3805 byte and 1 at the 3806 byte. I want to be able to write about 2500 more bytes past the 3806 byte. The characters in the data I want to print include everything from symbols to numbers even (") are included which would end the fputs command. Is there a way to do this?
printf("\n\nIOS Patcher v1.0 by Streamlinehd\n");
printf("Patch any IOS to v54321 or v65535\n\n");
if (argc != 3) {
fprintf(stderr, "Usage: %s IOS.wad [a]= Patch IOS version to v54321\n", argv[0]);
fprintf(stderr, "Usage: %s IOS.wad [b]= Patch IOS version to v65535\n", argv[0]);
return EXIT_FAILURE;
}
file = argv[1];
if (!(fp = fopen(file, "r+b"))) {
fprintf(stderr, "%s: %s: %s\n", argv[0], file, strerror(errno));
return EXIT_FAILURE;
}
am = argv[2];
if( (argv[2][0] != 'a') && (argv[2][0] != 'b') )
{
printf("Incorrect Command can not patch. Please use [a]v54321/[b]v65535\n");
return EXIT_FAILURE;
}
For example: fputs ( "Ô1" , fp ); - the data Ô1 will print but the " will not.
If I'm writing this much data (2500-bytes+) should I store it in a separate file (e.g. patch.data) and have the data go to buffer then use the buffer to write to the target file?
For example: fputs ( "Ô1" , fp ); - the data Ô1 will print but the " will not.
sure that doesn't since that quote doesn't belong to the string. "abc" is a c string which ends with 0. like rocketboy9000 stated if you want a quote within your string do what he says.
streamline wrote:
If I'm writing this much data (2500-bytes+) should I store it in a separate file (e.g. patch.data) and have the data go to buffer then use the buffer to write to the target file?
todays memory can easily hold 2500+ bytes. no need to make that file detour. (if I get it right)