// Code by gynvael.coldwind//vx // www : http://gynvael.coldwind.pl // e-mail : gynvael@coldwind.pl // license: public domain ;> // // This code sets that linker version in the PE header to 6.0. // The Vista's msvcrt.dll checks at init if the linker version // of the exe module is 6.0, and if so, it enables the %n tag // in printf, otherwise the tag remains disabled. // Use at your own risk. // #include #include int main(int argc, char **argv) { // Args ? if(argc != 2) { puts("usage: fixprintf "); return 1; } // Load file FILE *f = fopen(argv[1], "r+b"); if(!f) { printf("file %s not found\n", argv[1]); return 2; } // Read the DOS header IMAGE_DOS_HEADER Dos; fread(&Dos, 1, sizeof(Dos), f); // Seek fseek(f, Dos.e_lfanew + 0x1A, SEEK_SET); // Write fwrite("\6\0", 1, 2, f); // Done fclose(f); puts("done..."); // Bye bye... return 0; }