Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Created December 16, 2014 17:47
Show Gist options
  • Save misodengaku/66c57e6b651c13130d31 to your computer and use it in GitHub Desktop.
Save misodengaku/66c57e6b651c13130d31 to your computer and use it in GitHub Desktop.
Reverseit
#include <stdio.h>
void main()
{
int i = 0;
unsigned char d = 0;
FILE *fp = fopen("Reverseit", "rb");
FILE *ofp = fopen("reversed_1.jpg", "wb");
while (i < 0x1e12)
{
fseek(fp, 0x1e11 - i, SEEK_SET);
d = fgetc(fp);
d = (d >> 4) | (d << 4);
printf("%02x ", d);
fputc(d, ofp);
i++;
}
fclose(fp);
fclose(ofp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment