Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <stdint.h>
- void main(int argc, char** argv)
- {
- if (argc != 2)
- {
- printf("No input file specified\n");
- return;
- }
- FILE* ccFile = fopen(argv[1], "r+b");
- if (ccFile == NULL)
- {
- printf("Unable to open file\n");
- return;
- }
- if (fseek(ccFile, 0x7a, SEEK_SET) != 0)
- {
- fclose(ccFile);
- printf("Unable to seek to position\n");
- return;
- }
- uint8_t b1 = fgetc(ccFile);
- uint8_t b2 = fgetc(ccFile);
- if (b1 != 0x00 || b2 != 0x27)
- {
- fclose(ccFile);
- printf("Unexpected data\n");
- return;
- }
- fseek(ccFile, 0x7a, SEEK_SET);
- fputc(0x80, ccFile);
- fputc(0x13, ccFile);
- fclose(ccFile);
- printf("Done!\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement