Skip to content

Instantly share code, notes, and snippets.

@agluszak
Created March 22, 2019 14:14
Show Gist options
  • Save agluszak/d2e3309dc2b516b64c946b4553b783fa to your computer and use it in GitHub Desktop.
Save agluszak/d2e3309dc2b516b64c946b4553b783fa to your computer and use it in GitHub Desktop.
#include<byteswap.h>
#include<stdio.h>
int main(int argc, char** argv) {
if (argc != 2) return 1;
FILE* ptr = fopen(argv[1], "rb");
unsigned int num;
while(fread(&num, sizeof(int), 1, ptr) != 0) {
printf("%d\n", bswap_32(num));
}
fclose(ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment