CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 20:19:33 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=b2b3a10cef6fd9a28930df01a9166c8e37147c678162d637efc7d34a31e8ee33a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22CnBUfzeqZifNgNkwqP6bbtas8glxdTPU%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d10d924d97ad8b-BLR
Bad file header cleaner thing - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dirent.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- void check_file(const char *path) {
- FILE *file = fopen(path, "rb");
- if(!file)
- return;
- fseek(file, 0, SEEK_END);
- int size = ftell(file);
- rewind(file);
- unsigned char *buffer = (char*)malloc (sizeof(char)*size);
- if(!buffer)
- goto error;
- int result = fread(buffer, 1, size, file);
- if(result != size)
- goto error;
- int bad = buffer[14] || buffer[15];
- if(bad) {
- printf("Fixing bad header: %s\n", path);
- for(int i=0; i<15; i++)
- printf("%.2X ", buffer[i]);
- putchar('\n');
- fclose(file);
- file = fopen(path, "wb");
- if(!file) {
- puts("Couldn't open the file for writing to fix it though");
- goto error;
- }
- for(int i=7; i<16; i++) // clear out the last 9 bytes of the header
- buffer[i] = 0;
- fwrite(buffer, sizeof(char), size, file);
- }
- error:
- free(buffer);
- if(file)
- fclose(file);
- }
- int is_directory(const char *path) {
- struct stat statbuf;
- if (stat(path, &statbuf) != 0)
- return 0;
- return S_ISDIR(statbuf.st_mode);
- }
- void scan(const char *name) {
- DIR *d;
- struct dirent *dir;
- d = opendir(name);
- if(d) {
- while ((dir = readdir(d)) != NULL) {
- if(dir->d_name[0] == '.')
- continue;
- char full_path[500];
- sprintf(full_path, "%s/%s", name, dir->d_name);
- if(is_directory(full_path)) {
- scan(full_path);
- continue;
- }
- char *extension = strrchr(dir->d_name, '.');
- if(!extension)
- continue;
- if(strcasecmp(extension+1, "nes"))
- continue;
- check_file(full_path);
- }
- closedir(d);
- }
- }
- int main(int argc, char *argv[]) {
- scan(".");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
✅ Make $2500 in 20 minutes⭐⭐⭐ X
JavaScript | 1 sec ago | 0.25 KB
-
⭐ Free Crypto Method ⭐
JavaScript | 7 sec ago | 0.24 KB
-
📌 Swapzone +37% glitch ⭐ O
JavaScript | 10 sec ago | 0.25 KB
-
📝 Crypto Swap Glitch ✅ Working
JavaScript | 17 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 5
JavaScript | 19 sec ago | 0.25 KB
-
📝 EASY MONEY GUIDE ✅ Working
JavaScript | 26 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 28 sec ago | 0.25 KB
-
📌 ChangeNOW Exploit
JavaScript | 35 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand