nihonium
/
mipt_clang
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

28 lines
507 B
C

3 years ago
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdint.h>
#define SIZE (1024*1024)
int main() {
FILE *in = fopen("source", "r");
FILE *out = fopen("cracked", "wb");
char buffer[SIZE];
size_t bytes;
while (0 < (bytes = fread(buffer, 1, sizeof(buffer), in)))
fwrite(buffer, 1, bytes, out);
fclose(in);
fclose(out);
out = fopen("cracked", "r+b");
long int offset = 0x520;
uint8_t new = 0xe0;
fseek(out, offset, SEEK_SET);
fputc(new, out);
fclose(out);
return 0;
}