Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.2 KiB

  1. /*****************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1988-1991 **/
  4. /*****************************************************************/
  5. #include <stdio.h>
  6. #include <process.h>
  7. #include <setjmp.h>
  8. #include <stdlib.h>
  9. #include <time.h>
  10. #include <nt.h>
  11. #include <ntrtl.h>
  12. #include <nturtl.h>
  13. #include <windows.h>
  14. #define PAGE_SIZE 4096
  15. UCHAR Buffer[PAGE_SIZE];
  16. VOID
  17. BlastFile (
  18. IN PUCHAR FName
  19. )
  20. {
  21. FILE *fp;
  22. ULONG fsize, i;
  23. fp = fopen(FName, "r+b");
  24. if (!fp) {
  25. printf ("File %s not found\n", FName);
  26. return ;
  27. }
  28. fseek (fp, 0, SEEK_END);
  29. fsize = ftell(fp);
  30. printf ("Blasting file %s, size = %d\n", FName, fsize);
  31. fseek (fp, 0, SEEK_SET);
  32. for (i=0; i < fsize; i += PAGE_SIZE) {
  33. fwrite (Buffer, PAGE_SIZE, 1, fp);
  34. }
  35. fclose (fp);
  36. }
  37. VOID __cdecl
  38. main (argc, argv)
  39. int argc;
  40. char *argv[];
  41. {
  42. PULONG pl;
  43. ULONG i;
  44. pl = (PULONG) Buffer;
  45. for (i=0; i < PAGE_SIZE/sizeof(ULONG); i++) {
  46. pl[0] = 'RNEK';
  47. pl ++;
  48. }
  49. BlastFile ("hiberfil.sys");
  50. BlastFile ("hiberfil.dbg");
  51. }