Skip to content

Instantly share code, notes, and snippets.

@n0obit4
Last active August 23, 2021 20:32
Show Gist options
  • Save n0obit4/3f74d8656eb6ec81299baead443e7bb1 to your computer and use it in GitHub Desktop.
Save n0obit4/3f74d8656eb6ec81299baead443e7bb1 to your computer and use it in GitHub Desktop.
Fake PDF Maker | By: N0obit4
#include <stdio.h>
#include <stdlib.h>
//By: N0obit4
main(int argc,char *argv[]){
if (argc == 2){
//Variables
FILE * fp;
int i;
unsigned int j;
time_t t;
//Headers
fp = fopen(argv[1],"wb");
fprintf(fp,"\x25\x50\x44\x46\x2D\x31\x2e\x35\x0a\x25"
"\xc3\xa4\xc3\xbc\xc3\xb6\xc3\x9f\x0a\x32\x20\x30\x20"
"\x6f\x62\x6a\x0a\x3c\x3c\x2f\x4c\x65\x6e\x67\x74\x68"
"\x20\x33\x20\x30\x20\x52\x2f\x46\x69\x6c\x74\x65\x72"
"\x2f\x46\x6c\x61\x74\x65\x44\x65\x63\x6f\x64\x65\x3e"
"\x3e\x0a\x73\x74\x72\x65\x61\x6d\x0a\x78\x9c\x45\x4e"
"\xbb\x0a\x02\x31\x10\xec\xf7\x2b\xa6\x16\x2e\x6e\x1e"
"\x9b\x07\x1c\x29\x44\x05\xed\x0e\x02\x16\x62\xe5\xab"
"\x3a\xe5\xae\xf1\xf7\x4d\xce\x42\x16\x76\xd8\x61\xe7"
"\xc1\x4a\xe3\x43\x13\x18\xac\xd8\x44\x48\x12\x65\x82"
"\x20\x3a\xad\xa2\xd7\x98\xef\x74\x5a\xe1\xf5\xfb\xa8"
"\x33\x3f\x69\x53\x48\xbc\x8a\x08\xc1\xaa\x14\x13\xca"
"\x0d\xeb\xbd\x86\x36\x28\x8f\x73\xcf\x3a\x77\xa6\x67"
"\xc3\x36\x57\x70\xb9\xf3\x3d\x0b\xfb\x76\x04\x8e\x9c"
"\xd8\xe4\x4b\x39\xd2\xae\xd0\x40\x03\x26\x68\x17\x94"
"\xa4\x04\x27\x41\xb9\xea\x66\x99\x6b\xa5\x65\x57\xf6"
"\x1f\x5f\x99\xa5\x40\xc3\xa6\xf1\xb2\x48\xbc\x4d\xb8"
"\x8e\xb4\x3e\x8c\x0e\xdb\x37\x9a\xe7\x17\x5a\x22\x2c"
"\x5f\x0a\x65\x6e\x64\x73\x74\x72\x65\x61\x6d\x0a\x65"
"\x6e\x64\x6f\x62\x6a\x0a\x0a\x33\x20\x30\x20\x6f\x62"
"\x6a\x0a\x31\x36\x31\x0a\x65\x6e\x64\x6f\x62\x6a\x0a"
"\x0a\x34\x20\x30\x20\x6f\x62\x6a\x0a\x3c\x3c\x2f\x54"
"\x79\x70\x65\x2f\x58\x4f\x62\x6a\x65\x63\x74\x2f\x53"
"\x75\x62\x74\x79\x70\x65\x2f\x49\x6d\x61\x67\x65\x2f"
"\x57\x69\x64\x74\x68\x20\x34\x30\x30\x20\x2f\x48\x65"
"\x69\x67\x68\x74\x20\x34\x30\x30\x20\x2f\x42\x69\x74"
"\x73\x50\x65\x72\x43\x6f\x6d\x70\x6f\x6e\x65\x6e\x74"
"\x20\x38\x20\x2f\x43\x6f\x6c\x6f\x72\x53\x70\x61\x63"
"\x65\x2f\x44\x65\x76\x69\x63\x65\x52\x47\x42\x2f\x46"
"\x69\x6c\x74\x65\x72\x2f\x44\x43\x54\x44\x65\x63\x6f"
"\x64\x65\x2f\x4c\x65\x6e\x67\x74\x68\x20\x31\x39\x38"
"\x38\x38\x3e\x3e\x0a\x73\x74\x72\x65\x61\x6d\x0a\xff"
"\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01"
"\x00\x47\x00\x47\x00\x00\xff\xdb\x00\x43\x00\x03\x02"
"\x02\x03\x02\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05"
"\x08\x05\x05\x04\x04\x05\x0a\x07\x07\x06\x08\x0c\x0a"
"\x0c\x0c\x0b\x0a\x0b\x0b\x0d\x0e\x12\x10\x0d\x0e\x11"
"\x0e\x0b");
//End Headers
fclose(fp);
//Random Generator
srand((unsigned) time(&t));
//Content
fp = fopen(argv[1],"ab");
for ( i=0;i<sizeof(i);i++){
for (j=0;j<1000000;j++){ //Change this (this is the size of the file)
//printf("Valor: %p\n",j);
//Random value
fprintf(fp,"%c",rand() % 1024);
fprintf(fp,"%c",j);
}
}
//EOF
fprintf(fp,"\x34\x30\x37\x31\x0a\x3e"
"\x3e\x0a\x73\x74\x61\x72\x74\x78\x72"
"\x65\x66\x0a\x32\x37\x32\x38\x36\x0a"
"\x25\x25\x45\x4f\x46\x0a");
pclose(fp);
}else{
printf("Please run: %s FILENAME.pdf\n",argv[0]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment